[Dev-luatex] Slowdown of font loading

Hans Hagen pragma at wxs.nl
Fri Apr 4 11:48:33 CEST 2014


On 4/4/2014 11:44 AM, Patrick Gundlach wrote:
>
>> It looks as if the main computation time is in glyph.boundingbox. Is there any way to speed up the bounding box calculation?
>
> I now believe that most of the time is spent accessing a glyph from the list, such as
>
> f = fontloader.open(...)
>
> f.glyphs[n]
>
> and
>
> f.glyphs[n].name
>
> Is that possible, that this is slowing down the process significantly?

Sure, use this:

local g = f.glyphs[n]

g.name
g.whatever

as in your case you create the glyph table again!

by using local the glyph table gets collected so the memory footprint is 
smaller then the few years ago case of creating the whole table in 
advance (could become huge for cjk fonts)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list