freetype-devel
[Top][All Lists]
Advanced

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

Re: some more issues with the new API


From: David Turner
Subject: Re: some more issues with the new API
Date: Thu, 16 Mar 2000 11:36:41 +0100

Hi Just,

> >The glyph slot can be seen as bitmap/outline factory if you really want to
> >speak in OO terms, however there is no reason to decouple it from its parent
> >FT_Face..
> 
> I think it doesn't need be be completely decoupled. The point is: a glyph
> may have a reference to a face object (and probably should, for all the
> reasons you brought up), but the face should *not* store a reference to the
> glyph!
> 
> Right now there's this relationship:
> 
>    face->glyph->face
> 
> The proposed change would get rid of the first, leaving only
> 
>    glyph->face
> 
> ...and the face will then be merely be a factory for glyphs.
> 
It's hard to explain in a few lines, but I think that exposing the
FT_Size and FT_GlyphSlot objects in a high-level wrapper is simply
not a good idea. These things should be kept internal and not
exposed in the HL-API.

Then, you could use the face object as a glyph bitmap or outline
factory..

> (likewise for FT_Size)
> 
> >> Ok. Now I'v read a bit the embedded docs and I'm somewhat confused about
> >>what
> >> glyphs are. It seems a Glyph is loaded already together with some 
> >> 'drawable'
> >> type (bitmap or outline) to be used in the rendering process.
> >> Is there any advantage in combining these steps into one ?
> >>
> >Actually, it's not a glyph, but a "glyph slot",
> 
> This distinction strikes me as artificial, but it definitely confuses me! I
> mean, you called the FT_GlyphSlot field in the FT_Face struct "glyph", not
> "glyphSlot"...
> 
for convenience, but it seems that I should have called it "slot", as
in most of the low-level driver code.. that would have avoided any
confusion..

> Is this what it is?:
> 
> - a "glyph" is one glyph from a font, say an 'a'.
> - a "glyph slot" is an *instance* of such a glyph, eg. an 'a' at 12 points.
> 
> Does that sound about right?
> 
Not bad, but what about this:

a "slot" is factory for glyph bitmaps and outlines. Before doing so, you
must load a glyph image in the slot.. (the image isn't necessarily a bitmap
or an outline, by the way).

As a convenience, you can directly access the image's data in the slot
through face->glyph->bitmap and face->glyph->outline, when their format
is respectively ft_glyph_format_bitmap & ft_glyph_format_outline..


a "glyph" object is normally metrics+bitmap or outline. Its exact structure
is completely application-dependent, in my opinion.. You can however easily
generate them from a slot.. and FreeType provides the types FT_Bitmap and
FT_Outline that you can use directly if you want to..

- David
> Just



reply via email to

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