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: Daniel Plakhotich
Subject: Re: [ft] The fastest way to query size of a rendered bitmap
Date: Mon, 18 Sep 2017 12:03:59 +0300

So hinting instructions may result in 8-bit bitmap with 1 px width,
while dropout control will give 2 px one (as in your example)?

That is, the 8-bit bitmap may be rendered like this:

#
#
:
#
#

Instead of this, when that pixel is rendered with some level of
transparency, giving 2 px width (which I usually expect when the shape
is between two pixel columns):

#
#.
::
#.
#

On Mon, Sep 18, 2017 at 9:39 AM, Werner LEMBERG <address@hidden> wrote:
>
>> Am I right that drop-out control can result in a 1-bit bitmap
>> smaller (but never bigger) than the 8-bit one?
>
> I don't think so.  Consider a glyph like `)'.  If rendered without
> dropout control, you might get
>
>   x
>   x
>
>   x
>   x
>
> and with dropout control it might be rendered as
>
>   x
>   x
>    x
>   x
>   x
>
> which increases the bbox by one pixel.
>
>> The tutorial (3. Coordinates, scaling and grid-fitting) mentions the
>> drop-outs and describes the steps to compute an approximate size of
>> a bitmap by grid-fitting the bounding box of a glyph.  It seems like
>> this is the best solution for my case.
>
> If you apply ceiling for the maximum values and flooring for the
> minimum values, this should work, yes.
>
>
>     Werner



reply via email to

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