freetype
[Top][All Lists]
Advanced

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

Re: [ft] bitmap_left description


From: Phil Endecott
Subject: Re: [ft] bitmap_left description
Date: Sat, 27 Sep 2014 15:55:33 +0100

Hi Werner & others,

Werner LEMBERG wrote:

The docs for bitmap_left say:

    This is the bitmap's left bearing expressed in integer
    pixels. Of course, this is only valid if the format is
    FT_GLYPH_FORMAT_BITMAP.

I'm rendering individual glyphs from a TrueType font using
FT_Load_Glyph() followed by FT_Render_Glyph().  Having done that I
had been struggling to work out the metrics for the result.  Then I
discovered that bitmap_left and bitmap_top seem to tell me exactly
what I need to know - but I had been avoiding them because this not
a bitmap font and the description quoted above.

Well, after calling FT_Render_Glyph, `face->glyph' *does* hold a
bitmap, as specified by the `face->glyph->format' field.  Please read
the documentation of its type, `FT_GlyphSlotRec'.

Is it OK to use bitmap_left/top after FT_Render_Glyph()?

Yes.

Thanks for confirming that.  I'll shortly write a more general "am
I doing this right?" email, but I do seem to be getting the results
I expected now that I'm using bitmap_left/top.

Is this a documentation issue?

Obviously.  Please suggest an improvement.

My "mental disconnect" was between the format of the glyph, which
I imagined to be vector (and only vector) for a glyph from a vector
font, and the presence of a bitmap in the glyph slot after rendering.

So my suggestion would be to say:

     This is the bitmap's left bearing expressed in integer
     pixels. This is only valid if the glyph slot contains
     a bitmap.


Thanks,  Phil.







reply via email to

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