[cairo] Rotated glyph inked area problem

Ian Britten britten at caris.com
Tue Sep 14 10:11:17 PDT 2010


On 10/09/10 01:19 PM, mpsuzuki at hiroshima-u.ac.jp wrote:

>> Agreed.  We've encountered similar problems before (Overflow, if I
>> recall...).  The details are fuzzy at the moment, but I believe we
>> load fonts at a specific/fixed size, then do all the subsequent
>> scaling ourselves...
>
>>> Known issues.  Here's what I wrote previously:
>>>
>>>     http://lists.freedesktop.org/archives/cairo/2008-May/014146.html
>
> Sorry for asking a stupid question. This issue is caused
> by the bug(s) in FreeType's scaler, rasterizer etc? Or,
> caused by API limitation? Behdad's comment in 2 years ago
> told that 26.6 fixed type is insufficient precision for
> the purpose.

Not sure if your question was directed at Bedhad or me, but I'll
offer what I can...

After digging around in our code, here's some of the comments
which might help illuminate our problem (Which was overflow of
some FT values):

/*!
   These should only be used internally when computing scaling
   factors from Freetype internal grid to the actual rendering
   device units.

   Internally Freetype is generating glyph positions based on a
   grid of a resolution of:
   \code
   Internal resolution = FREETYPE_SCALE * FREETYPE_DEFAULT_DPI
   \endcode

   The reason the scaling factor is used is to generate points with
   an increased resolution.  When the scaling factor is 1:1 some
   small font size are not displayed at quite the right size because
   the internal Freetype grid is too coarse.  Freetype actually uses
   1/72th of an inch as a default grid.
*/
enum {
         FREETYPE_SCALE=400, //!< Internal scaling factor to improve 
resolution
         FREETYPE_DEFAULT_DPI=72, //!< Default Freetype grid resolution
         FREETYPE_LOADING_SIZE=12 //!< Loading size used with freetype
};


// This loading size concept was introduced because of problems loading
// a font at a very large size.  The problem was integer overflow when
// trying to specify that big size in resolution units.


Hope this answers your question!
Ian


More information about the cairo mailing list