freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Possible implementation error of function FT_Bitmap_Embol


From: Werner LEMBERG
Subject: Re: [ft-devel] Possible implementation error of function FT_Bitmap_Embolden()
Date: Sat, 27 Dec 2008 22:50:14 +0100 (CET)

> No, there isn't.  In your program, you do this:
> 
>   err_ebd = FT_Bitmap_Embolden(library, &emb_bitmap,
>                                xStrength, yStrength);
>   ((FT_BitmapGlyph)glyph)->bitmap = emb_bitmap;
>   FT_Glyph_Get_CBox(glyph, 0, &cbox);
> 
> Assigning the emboldened bitmap back to the FT_Glyph structure.

Oops!  This should read:

  Assigning the emboldened bitmap back to the FT_Glyph structure is
  not sufficient.

> While `width' and `row' are part of an FT_Bitmap structure, the
> `left' and `top' values are not.  The computation within
> FT_Glyph_Get_CBox thus returns the values you've observed.
> 
> Either update the `top' value in `FT_BitmapGlyph' by yourself or
> reuse the code from `FT_GlyphSlot_Embolden' (in `ftsynth.c'), which
> adjusts the `bitmap_top' field in the FT_GlyphSlot structure.


    Werner




reply via email to

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