[OpenFontLibrary] font linking bandwidth issues: sub-setting fonts or complex scripts

Pierre Marchand pierremarc at oep-h.com
Sat May 2 01:06:12 PDT 2009


Vous avez écrit :
> Font sub-setting is very tricky for complex Indic and Arabic scripts
> that use OpeenType lookups in the font to select and position the final
> glyphs to be rendered. As these lookups reference glyphs by their index
> value in a font, if you sub-set the font then the lookups also need to
> be updated. Substitution lookups also often rely on glyphs which may not
> rendered in the final output, so though they are not rendered on a site
> they may need to be present in a sub-setted font for the lookups to
> function.
>
> Any font sub-setting tool that does handle these things is only going to
> be practical for scripts like Latin, Greek, Cyrillic, and CJK that do
> not normally rely on applying OpenType features for correct rendering.

Exact. It’s the reason why there’s the conditional statement: 
 "if(uc.unicode >= 0):"
which I expect to avoid removing glyphs used in substitutions for non-tricky-
fonts (tricky fonts here would be the ones with almost all glyphs referenced 
in a cmap even those without a regular code point). Another condition could be 
to not remove glyphs mapped in a PUA. For the GSUB/GPOS part of the problem, 
I’d tend to trust Fontforge at doing the right thing. Eventually I did a test 
with _Lohit Hindi_, ICU and the following text as the target of the subset:
"हालाँकि सूर के जीवन के बारे में कई जनश्रुतियाँ प्रचलित हैं, पर इन में कितनी सच्चाई है यह कहना कठिन है। 
कहा जाता है उनका जन्म सन् १४७८ में दिल्ली के पास एक ग़रीब ब्राह्मीण परिवार में हुआ। जनश्रुति के अनुसार 
सूरदास जन्म से ही अंधे थे। आजकल थी अंधे आदमी अक्सर ‘सूरदास’ कहलाते हैं। कई लोगों ने उन्हें गुरु के 
रूप में अपनाया और उनकी पूजा करना शुरु कर दिया ।"
Apparently the result is good, same rendering with the original and the 
subset… apparently.

The sizes are (according to `ls`):
lohit_hi.ttf 			76K
subseted-lohit_hi.ttf 	61K
Not exactly over exciting but _Lohit Hindi_is just 344 glyphs, I guess we 
could have more spectacular results with CJK fonts or extended latin ones such 
as _Libertine_.

By the way, I do not pretend at all to know much about what we are talking 
here :-) And thus will be happy to learn enough to improve the script I 
posted.

Hey, could be a cool after-lunch discussion at LGM!

-- 
Pierre Marchand
http://www.oep-h.com




More information about the OpenFontLibrary mailing list