-
Notifications
You must be signed in to change notification settings - Fork 7
Update Roboto font, add NotoSansSymbols, compress them #163
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
base: master
Are you sure you want to change the base?
Conversation
23920ee to
199f020
Compare
|
The Qt resource system is supposed to support compression by default according to https://doc.qt.io/qt-6/resources.html. But it says compression will not be used if it does not hit some desired compression ratio, which can be configured in I'll try to push my Qt6 branch soon if you want to try out any of these file size tricks against it. |
Good to know! Doing some measurements I confirm the size of the resulting binary would be way much larger if it didn't do some compression, because by default it doesn't save that much to compress before hand, using a generic compression tool like gzip. What's interesting in compressing beforehand is that we can use much slower compressors that are too slow for their usage to be viable at build time, and such compressors can produce better results than the default Qt zlib profile. Here is some comparison, I don't expect Qt to do better than gzip when Qt uses zlib:
The win isn't big, but it adds up when we accumulate more file optimizations:
Here combining the optimized ttf.gz trick with optimized png saves 456K, close to half a MB! I read in that page that Qt6 can support zstd as compression format. We may investigate that because I expect zstd to perform better than a bruteforced gzip, while being usable at build time, and not needing any custom decompression code. Of course linking against zstd would increase the executable file size, but the tradeoff may be welcome. |
|
Maybe we should just enable Qt's fontconfig option and try to take advantage of system fonts? That would probably be better for reducing binary size. Besides the arrow symbol, we can also benefit from emoji fonts since there are several news posts that use emojis. (Or if we don't care about emojis, let's nuke Harfbuzz and save a megabyte 😛 ) If the AI can be believed, fontconfig should work for most users: |
|
I would like to get fontconfig support yes. I already had to modify some of my news blog post to not put an emoji in the first sentences to get them looking good in the updater, that's annoying. Adding one font just for one symbol is a bit annoying, though I think all the characters we display (that we don't fetch from a blog post) should display by default. We can also rethink what symbols we display by default. |
|
In my When doing the trick on our current font (only our old Roboto font that is smaller than the one in this branch), for some unknown reasons it only benefits the zip, not the updater itself: Before: After: Basically 3K and only in the zip. Those 3K is the size earned by an heavy I would like to know where those 3K are spent in the updater!? |

Update Roboto font, add NotoSansSymbols, compress them.
Fixes:
Doesn't fix:
This also compress fonts to save space, basically the two fonts now take the size of one.