diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-04-22 12:40:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 10:40:55 +0000 |
commit | 363651c7f756e7b47281bbe22fda21b7ccfda7e3 (patch) | |
tree | 7821303db66c2b29417cae01df612af0147fdc63 /components/layout/inline.rs | |
parent | 821893b2eecfc72918ab8154c3cb61cd45d53857 (diff) | |
download | servo-363651c7f756e7b47281bbe22fda21b7ccfda7e3.tar.gz servo-363651c7f756e7b47281bbe22fda21b7ccfda7e3.zip |
fonts: Fix emoji font selection on macOS (#32122)
This fixes two issues that were preventing emojis from being properly
selected from fonts on macOS.
1. `CTFont::get_glyphs_for_characters` takes the input characters as
UniChar which are UTF-16 encoded characters. We need to encode the
input `char` as UTF-16 before passing it to CoreText.
2. The font fallback list is updated with the latest logic from Gecko,
which importantly adds "Apple Color Emoji" to the list of fallback
fonts. Sorry for the big change, but this is just a direct port of
the code from Gecko.
With these two changes, emojis display but in grayscale. 😅 To fix this,
another part of the font stack will need to detect when the font
supports color and pass that information to WebRender when creating the
font instance. We will likely do this in platform independent way later
that will depend on some more preliminary changes.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes are part of #17267.
- [x] There are tests for these changes, but the macOS CI does not
currently run WPT so we cannot observe the updated results.
<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->
<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
Diffstat (limited to 'components/layout/inline.rs')
0 files changed, 0 insertions, 0 deletions