You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is more severe on the CJK character set. I tested it on the Source Han Serif font, and the original font file is about 18MB. The document generated by typst contains 2MB of fonts, but after further compression, the actual used glyph data is only 47KB.
CFF font subsetting is unfortunately rather complicated.
I agree. Just for the record, it took over a year for PrinceXML to implement good CFF subsetting. And for Affinity Designer, it's still an issue after 3 years since it's reported.
Just for the record, it took over a year for PrinceXML to implement good CFF subsetting
The subsetter, together with other font tools, for PrinceXML has apparently been extracted into a Rust library called allsorts. I am not well-versed in font shaping and subsetting, nor do I have extensive knowledge in Rust, so I apologize in advance if this library has already been deemed unsuitable for Typst, but perhaps the library is still worth considering.
Activity
laurmaedje commentedon Apr 20, 2023
The subsetter indeed doesn't produce minimal sizes, yet.
[-]Large file sizes: font subsetting faulty?[/-][+]More efficient font subsetting[/+]Wybxc commentedon Nov 2, 2023
This issue is more severe on the CJK character set. I tested it on the Source Han Serif font, and the original font file is about 18MB. The document generated by typst contains 2MB of fonts, but after further compression, the actual used glyph data is only 47KB.
laurmaedje commentedon Nov 2, 2023
CFF font subsetting is unfortunately rather complicated.
Andrew15-5 commentedon Nov 2, 2023
Consider using binary prefixes to remove any confusion with the legacy SI prefixes (for size of digital information). See https://en.m.wikipedia.org/wiki/Binary_prefix. Also note that KB is not an existing unit of measurement. There is either kB or KiB (which are 1000 B and 1024 B respectively).
laurmaedje commentedon Nov 2, 2023
Andrew15-5 commentedon Nov 2, 2023
laurmaedje commentedon Nov 2, 2023
Andrew15-5 commentedon Nov 2, 2023
wdscxsj commentedon Nov 3, 2023
I agree. Just for the record, it took over a year for PrinceXML to implement good CFF subsetting. And for Affinity Designer, it's still an issue after 3 years since it's reported.
0ip commentedon Nov 3, 2023
The subsetter, together with other font tools, for PrinceXML has apparently been extracted into a Rust library called allsorts. I am not well-versed in font shaping and subsetting, nor do I have extensive knowledge in Rust, so I apologize in advance if this library has already been deemed unsuitable for Typst, but perhaps the library is still worth considering.