freetype
[Top][All Lists]
Advanced

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

Re: [ft] Determining pixel dimensions for bitmap


From: Dave Arnold
Subject: Re: [ft] Determining pixel dimensions for bitmap
Date: Mon, 3 Nov 2014 15:36:19 -0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

I'm sorry if I've missed whether you are interested in hinted glyphs or not. 
But for hinted rendering, it is impossible to know the exact bounds of the 
result without actually executing the hints, at the desired ppem size.

-Dave

On 11/3/2014 2:54 PM, Marco Wertz wrote:
Actually, xMin and and yMin have to be rounded down, and xMax and yMax
have to rounded up individually *BEFORE* you calculate the pixelwidth
and pixelheight.
Ok. But what's your exact definition of "rounding up"? Should it be rounded
up whenever the fractional value is != 0? Or should it only be rounded up
in case the fractional value is >= 0.5? (i.e. 32 in 26.6. fixed point format)

What's the big deal about an empty row or column? When rendering text
we suggest using lsb_delta and rsb_delta to properly place the
rendered glyphs.
The problem for me is that I'm not using the glyph API but the FT_Stroker
and FT_Outline APIs directly. Of course I can detect an empty row or
column on my own, but if I want to have a bitmap that doesn't contain
any empty rows or columns, I'm forced to copy the pixels to another
bitmap because the current APIs don't give me the chance to allocate
a bitmap of the *exact* dimensions before drawing to it.

And copying the bitmap without the empty row and column to a new bitmap
is overhead that could be avoided IMHO.

Marco

_______________________________________________
Freetype mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/freetype
.





reply via email to

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