Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct vertical offset for Apple Color Emoji #792

Merged
merged 3 commits into from
Jan 17, 2025
Merged

Correct vertical offset for Apple Color Emoji #792

merged 3 commits into from
Jan 17, 2025

Conversation

dfrg
Copy link
Collaborator

@dfrg dfrg commented Jan 17, 2025

Experimentation indicates that CoreText special cases the Apple Color Emoji font and adds a 100 font unit vertical offset when rendering. This PR adds a hack to mimic that behavior for correct emoji placement on Mac.

Also fixes a tiny general sbix bug where we were adding rather than subtracting the height of the image.

parley's vello_editor with this fix applied:
Screenshot 2025-01-17 at 10 39 45 AM

dfrg added 2 commits January 17, 2025 10:47
Experimentation indicates that CoreText special cases the Apple Color Emoji font and adds a 100 font unit vertical offset when rendering. This PR adds a hack to mimic that behavior for correct emoji placement on Mac.

Also fixes a tiny general sbix bug where we were adding rather than subtracting the height of the image.
Copy link
Collaborator

@waywardmonkeys waywardmonkeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tired at the end of a very long day, so maybe someone else might take a look, but LGTM.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory we should test this, but that's not practically possible. Code looks good, and has been confirmed to work. I also agree with the location of the fix

Thanks

@dfrg dfrg added this pull request to the merge queue Jan 17, 2025
Merged via the queue into main with commit d5ebe12 Jan 17, 2025
17 checks passed
@dfrg dfrg deleted the sbix_offset branch January 17, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants