Skip to content

Conversation

@dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jul 12, 2025

This PR aims to help somewhat with #126 by removing all font files that aren't actually used in the project.

I determined which were used very manually, by grepping through all the .tres and .tscn files.

Assuming I didn't get this wrong anywhere, this should be a straight win for export size! The only downside is that if later we want to use one of the font variations that was removed, we'll need to re-download it from the source.

Here are the font sizes before:

5.4M    assets/fonts/CormorantGaramond
8.4M    assets/fonts/NotoSans
6.1M    assets/fonts/NotoSansBengali
50M     assets/fonts/NotoSansJapanese
16M     assets/fonts/NotoSansMono
62M     assets/fonts/NotoSerifJapanese
147M    total

And here is after:

2.7M    assets/fonts/CormorantGaramond
2.2M    assets/fonts/NotoSans
1.2M    assets/fonts/NotoSansBengali
11M     assets/fonts/NotoSansJapanese
828K    assets/fonts/NotoSansMono
31M     assets/fonts/NotoSerifJapanese
49M     total

We could reduce it even further if we only used a sans-serif font for Japanese, which we're already doing for Bengali.

If you'd be OK with removing the Japanese serif font, I'd be happy to update the PR for that! (I'd need to add back some of the sans-serif fonts that I removed, so that they could be used as fallbacks on CormorantGaramond, which means the total size will probably only go down by ~11mb)

@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 12, 2025

With the rest of the current size reduction PRs (at least at the time that I write this comment), if we decided to only use a sans-serif font for Japanese (which I'd expect to reduce the size by another ~11 MB, although, I haven't tested it), we'd get the PCK file down to around ~114 MB!

That's within striking distance of 100 MB - I personally think we should go for it, but please let me know :-)

@m4ym4y
Copy link
Owner

m4ym4y commented Sep 23, 2025

Let's go for it, I support taking out serif font in Japanese, it's a pretty small price to get us much closer to the size goal. Thank you! Would you like to update this PR removing the serif font?

@dsnopek dsnopek force-pushed the remove-unused-fonts branch from 7ed9aa8 to 0df0ace Compare September 27, 2025 18:38
@dsnopek
Copy link
Contributor Author

dsnopek commented Sep 27, 2025

Sure! I've switched Japanese to always use the sans-serif font and removed the serif one.

The size reduction was a little better than I thought it would be! I had estimated that it would reduce the size by ~11mb, but it looks like it ended up being more like ~20mb.

Here's the font directories now:

2.7M    assets/fonts/CormorantGaramond
2.2M    assets/fonts/NotoSans
1.2M    assets/fonts/NotoSansBengali
22M     assets/fonts/NotoSansJapanese
828K    assets/fonts/NotoSansMono
29M     total

@m4ym4y
Copy link
Owner

m4ym4y commented Sep 27, 2025

looks great, thank you!!

@m4ym4y m4ym4y merged commit 3963c20 into m4ym4y:main Sep 27, 2025
2 checks passed
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