[HarfBuzz] Caching of glyphmetrics and cmap data

Keith Stribley devel at thanlwinsoft.org
Thu Sep 23 05:52:15 PDT 2010


Hi Behdad,

I've been comparing the rendering times taken by Harfbuzz-NG with 
different fonts and documents and as part of this experimented with 
caching for the freetype face and font. A lot of the time seems to be 
taken by calls to FreeType at the moment, specifically FT_Get_Char_Index 
and FT_Load_Glyph.

I found that by caching both glyphmetric lookups (in the font) and the 
unicode to glyph mapping (in the face) I was able to improve the 
rendering performance by between 8 and 50 times depending on the font in 
large documents which don't require a lot of OT lookups.

I've attached the patch that I was using. Perhaps it might be worth 
adding something like this as an option for clients for which memory is 
not at a high premium. The patch will probably need extending to benefit 
CJK and vertical metric fonts.

Regards,
Keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: hb-caching-krs.diff
Type: text/x-patch
Size: 6772 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20100923/b64369c5/attachment.bin>


More information about the HarfBuzz mailing list