freetype
[Top][All Lists]
Advanced

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

Re: [ft] The fastest way to query size of a rendered bitmap


From: Werner LEMBERG
Subject: Re: [ft] The fastest way to query size of a rendered bitmap
Date: Mon, 20 Nov 2017 07:52:48 +0100 (CET)

> Strange, but in rare cases grid-fitting FT_Outline_Get_BBox() gives
> 1-2 px smaller size than those of the rendered bitmap, while
> FT_Outline_Get_CBox() always works fine.

I really doubt that.  Example, please (with C code).

> Moreover, it sometimes returns significantly larger box than
> FT_Outline_Get_CBox(), for example, for glyphs U+2686 - U+2689 from
> DevaVu Sans.

Impossible.  I've just had a look at those glyphs (DejaVuSans.ttf,
version 2.34), and their shapes are completely regular.  Are you sure
that you are comparing the CBox and BBox of either both the unhinted
or both the hinted outline?

>> We thus define the control box (also called cbox) as the smallest
>> possible rectangle that encloses all points of a given outline
>> (including its ‘off’ points).  Clearly, it always includes the
>> bbox, and the two boxes are identical in most cases.

This is always mathematically correct.


    Werner

reply via email to

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