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 jar size by invisibly replacing fonts #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hubcapp
Copy link
Member

@Hubcapp Hubcapp commented May 26, 2024

This PR should remove about 2.7 MB from the final jar without changing the rendering of any fonts. It would still be possible to remove arial.ttf by fully embracing jf, but it's not really worth it.

I have not removed h12p or h20b because the savings are only 2.8 KB and it's kind of mean to do to them.

  • Times New Roman font was not used
  • Arial Bold was a duplicate of Helvetica-Bold (which is not actually Helvetica, it's Arial)
  • OpenSans-Bold & Regular were very nearly identical to Arial, and only used for non-native notification bubbles, so I've replaced them with Arial Bold & Regular.
  • The entire Symbola font was included, even though we only use 5 glyphs from it. I trimmed the font down to just a few glyphs that we use, plus a few that might possibly be useful for the queue window in the future. It has gone from 3.17 MB to just 15.6 KB.

Before & After Arial Bold was replaced with Helvetica-Bold (the map window is the only place this was used):
image

After image of non-native notification bubbles (very acceptable)
image

The glyphs I chose to include in the Symbola font (edited with Fontforge):
image
image

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.

1 participant