freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Ready for 2.0.8


From: Keith Packard
Subject: Re: [Devel] Ready for 2.0.8
Date: Sat, 09 Feb 2002 09:34:38 -0800

Around 15 o'clock on Feb 9, David Turner wrote:

>   - first, it correspond to another common usage of charmap enumeration,
>     since some programs need to retrieve (charcode,glyph_index) pairs to
>     build custom mappings (for example, to keep it outside of a FT_Face
>     object).

That seems like a reasonable operation; I do this incrementally to avoid
the up-front cost, but others may have different requirements.

>    It's also not much to add to the internal code, since you can
>    normally access the glyph index directly within the implementation
>    of FT_Get_Next_Char

That's just a linear effect; if the API were cleaner without it, I'd say it
wasn't all that important.

>   - the second reason is that it provides much better semantics, since
>     you don't need to do special checks for charcode 0 or for emptiness.
>     Instead, a simple enumeration loop can be written as:

That's the best reason -- you might in fact argue that the return values
from these functions should be glyph indices instead of char codes:

        for (glyph = FT_Get_First_Char (face, &c);
             glyph;
             glyph = FT_Get_Next_Char(face, &c))
        {
                ...
        }


But, that obscures the notion of "first" and "next" perhaps.  I think 
yours is better.

> I know that I probably look rather picky regarding API additions these
> days, but that's mainly because I'm currently re-organizing stuff within
> the library, and the high-level API limitations simply strike me as
> extremely annoying in many cases.

Not at all -- all that FreeType has to advertise is an API.  That's your 
"public" face to the developers.  I spent an hour yesterday changing the 
names of functions to make them consistent in my fontconfig library.

Keith Packard        XFree86 Core Team        Compaq Cambridge Research Lab





reply via email to

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