freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] (no subject)


From: Werner LEMBERG
Subject: Re: [ft-devel] (no subject)
Date: Mon, 21 Apr 2014 08:57:11 +0200 (CEST)


> 1. a simple problem -- I failed to build a demo project using
> freetype2.  [...]

Since I don't use Windows, I can't help.  Maybe someone else can chime
in?

> *2. When does the freetype parse the glyph data?
>
> My ttf_parser reads ttf file and parses the tables into classes
> right away (This process is laterly referred as *LOAD *time).  But
> now I wonder if I can delay the glyph data parsing process to the
> time when users fetch the glyph outline (referred as *FETCH *time).
> I have two reasons supporting this change.

Yes, you should read glyph data only on demand if you want quick
parsing.  Loading them completely is time consuming and costs a lot of
memory.

> But I am also afraid of the trade-off -- the FETCH process might
> slow down.

This should be neglegible compared to the rendering process itself.

> Besides, I cannot pre-determine by how many simple glyph a specific
> composite glyph is composed (is it?).

Since composite glyphs can be nested, there is no way to get this
number in advance without full parsing.  Instead, there are the values

  maxComponentElements
    Maximum number of components referenced at “top level” for any
    composite glyph.

  maxComponentDepth
    Maximum levels of recursion; 1 for simple components.

in the `maxp' table that should be sufficient to allocate the
necessary memory in advance if necessary.  [Unfortunately, some fonts
don't compute the values correctly, but this is a different issue.]


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]