rscplus icon indicating copy to clipboard operation
rscplus copied to clipboard

reduce jar size by invisibly replacing fonts

Open Hubcapp opened this issue 1 year ago • 0 comments

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

Hubcapp avatar May 26 '24 08:05 Hubcapp