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

Reduce the ttf file size #94

Closed
inkeliz opened this issue Nov 20, 2020 · 3 comments
Closed

Reduce the ttf file size #94

inkeliz opened this issue Nov 20, 2020 · 3 comments

Comments

@inkeliz
Copy link

inkeliz commented Nov 20, 2020

I downloaded the "ThickFallback" release (TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1.zip), but the .ttf file is almost ~11MB.


I use some online tools (such as convertio.co) to convert TTF to WOFF, then I use the same tool from WOFF to TTF. In general, it is TTF -> WOFF -> TFF. That process drops the file size from 11MB to almost 3.5MB. Far I'm testing, there's no issue.

In order to compare, the default Windows file (seguiemj.ttf) is around 2MB.


There's any proper tool to reduce the size of the ttf file? Why the WOFF to TTF manage to reduces the file size so significantly?

@13rac1
Copy link
Owner

13rac1 commented Nov 20, 2020

My first guess is that tool drops the SVG tables. Can you confirm your converted version still has all color SVGs?

I'm always concerned with performance and efficiency, but why does the file size matter in this case? Apple Color Emoji is 99MB for comparison

@inkeliz
Copy link
Author

inkeliz commented Nov 20, 2020

I don't know about the color. I'm only using one opentype library to parse the .ttf, and that library seems to only handle black-white. So regardless of the size, it will only use the black-white.

The size matters because the executable (the .exe, .apk or .ipa) have around 8MB. The inclusion of the font almost doubles the size. It's possible to compress (either using some zstd, zip, upx in some scenarios), but still significant.

I usually don't care about the size, but I want to keep as small as possible and avoiding plataform-dependent fonts. The ~3.5MB makes much more sense, if it gets smaller will be even better. 😂


I can't confirm about the color, but your guess makes sense.

@13rac1
Copy link
Owner

13rac1 commented Nov 20, 2020

Yes, then it's probably dropping the color tables. Not sure where to go from here? The ThickFallback is just an experiment for #74 but the build time is far too long to be implemented. The way to make the file smaller is to drop the characters you don't need.

@13rac1 13rac1 closed this as completed Jun 22, 2021
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

No branches or pull requests

2 participants