freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] (no subject)


From: Michael Pfeiffer
Subject: Re: [Freetype] (no subject)
Date: Tue, 19 Jun 2001 19:25:46 +0000

Hello David,

>OK, first of all, having a FT_Face per FT2Font object is probably a bad 
idea.

Well, it is only one FT_Face per FT2FontFile. A FT2Font represents a font 
with
a specific size and rotation that referes to a FT2FontFile, so there is only
on face per font.

>That's because a FT_Face can be a very large object in memory, depending on
>the font format and other internal information that cannot be provided to
>client applications for various good reasons.
>
>This means that you should always try to minimize the number of opened
>FT_Face (and FT_Size) objects in your program. A good way to do that is
>to use the cache manager, that allows you to do, simply just that :-) !!
> 
>(note that you can cache FT_Face and FT_Size object within the cache
> manager, while using your own cache for glyph images/bitmaps, these
> two schemes are not incompatible)

Ok, the FT2 documentation says that the cache sub-system is stile <- typo in 
doco :-)
(ft2-cache_subsystem.html) in beta. Do you recommend to use it nevertheless?

>Second, the FT_BitmapGlyph data type is by far not the smallest possible
>one (it's designed to be convenient to use, and a descendant of the
>FT_Glyph type). You'll probably benefit from not using it but design,
>instead, a specific glyph node for your bitmap cache.
>
>If you're only interested in bitmaps, you could simplify your code
>with something like:
>
>  load_flags = fontFile->engine->aa
>             ? FT_LOAD_RENDER
>             : ( FT_LOAD_RENDER | FT_LOAD_MONOCHROME ) ;
>
>  error = FT_Load_Glyph( fontFile->face, glyph_index, load_flags );
>
>  /* here, the glyph bitmap is in "face->glyph->bitmap", you could */
>  /* _copy_ its content to your own cache node structure..         */
>
>  .....
>
>  this prevents the use of FT_BitmapGlyph types..
>
Ok, I will give this a try.

Thanks,
Michael




reply via email to

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