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

Build FreeType against libpng #228

Merged
merged 1 commit into from
Mar 24, 2024
Merged

Conversation

kleisauke
Copy link
Collaborator

It seems colored emoji glyphs are stored as PNG images in OpenType fonts, so compile FreeType with -Dpng=enabled to ensure that emoji can be rendered.

Tested by replacing node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.42 with the produced binary and by doing:

$ node -e "require('sharp')({text: { text: 'sharp is awesome! 🧩 ❤️', rgba: true }}).toFile('x.png')"

x

Context: lovell/sharp#3959.

@lovell
Copy link
Owner

lovell commented Mar 24, 2024

Ah this is interesting, I thought "emoji" fonts stored glyphs using COLR vectors, but you're quite right that the common ones such as Noto still use the CBDT raster format, i.e. PNG.

Will we ever be able to remove libpng? ;)

@lovell lovell merged commit aaff2e7 into lovell:main Mar 24, 2024
14 checks passed
@kleisauke kleisauke deleted the freetype-libpng branch March 24, 2024 15:48
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.

2 participants