Skip to content

Enable use of subset fonts#13

Merged
yashovardhan99 merged 2 commits intomainfrom
optimize-assets
Aug 17, 2025
Merged

Enable use of subset fonts#13
yashovardhan99 merged 2 commits intomainfrom
optimize-assets

Conversation

@yashovardhan99
Copy link
Owner

All the included fonts were causing the repo size and the dist size to increase substantially. Not all glyphs included in the .ttf files will actually be used in real-life. As such, this commit refactors the fonts to subset fonts with limited glyphs. NotoSans-Regular has been left as-is to support all unicode characters as a fallback font.

Note that there is also an issue with FPDF2, that causes fallback fonts to not work sometimes if they have a space in the name. As such, I have changed all font names to remove spaces. See py-pdf/fpdf2#1535 for more details.

All the included fonts were causing the repo size and the dist
size to increase substantially. Not all glyphs included in the
.ttf files will actually be used in real-life. As such, this
commit refactors the fonts to subset fonts with limited glyphs.
NotoSans-Regular has been left as-is to support all unicode
characters as a fallback font.

Note that there is also an issue with FPDF2, that causes fallback
fonts to not work sometimes if they have a space in the name. As
such, I have changed all font names to remove spaces.
See py-pdf/fpdf2#1535 for more details.
@yashovardhan99 yashovardhan99 added the T-enhancement Type - new features or improvements to existing features (issue/PR) label Aug 17, 2025
@yashovardhan99 yashovardhan99 added T-refactor code changes that neither fix a bug nor add a feature S-In progress State - actively being worked on (issue/pr) P-medium Priority - medium and removed T-enhancement Type - new features or improvements to existing features (issue/PR) labels Aug 17, 2025
@yashovardhan99 yashovardhan99 merged commit eb78086 into main Aug 17, 2025
3 checks passed
@yashovardhan99 yashovardhan99 deleted the optimize-assets branch August 19, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P-medium Priority - medium S-In progress State - actively being worked on (issue/pr) T-refactor code changes that neither fix a bug nor add a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant