> when using FT_Outline_Get_BBox() to get the dimensions of the
> outline, the values are all in the 26.6 fixed point format. How do I
> determine the optimal pixel size for a bitmap to pass to
> FT_Outline_Get_Bitmap() so that the outline fits *exactly* into the
> bitmap dimensions?
>
> The obvious approach would be something like this:
>
> width = bbox.xMax - bbox.xMin;
> height = bbox.yMax - bbox.yMin;
>
> pixelwidth = width >> 6;
> pixelheight = height >> 6;
>
> if((width & 0x3f) > 31) pixelwidth++;
> if((height & 0x3f) > 31) pixelheight++;
>
> This will add another pixel in case the fractional part of the 26.6
> fixed point value is >= 0.5. But I'm not sure if this is the right
> approach....
Yes, this looks good.
> is there maybe an "official" way of determining the pixel allocation
> size for the bitmap passed to FT_Outline_Get_Bitmap() in order to
> get an *exact* fit?
No.
Werner
_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype