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: Marco Wertz
Subject: Re: [ft] Determining pixel dimensions for bitmap
Date: Mon, 3 Nov 2014 23:54:16 +0100

> 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



reply via email to

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