[cairo] Rotated glyph inked area problem

Bill Spitzak spitzak at gmail.com
Fri Sep 10 11:31:19 PDT 2010



mpsuzuki at hiroshima-u.ac.jp wrote:
> On Fri, 10 Sep 2010 09:13:55 -0300
> Ian Britten <britten at caris.com> wrote:
>>> In fact, my long term plan is for cairo to get the glyph
>>> outline from FreeType and do everything (rasterization, extent calculations,
>>> etc) all within cairo itself since FreeType has proved to be very
>>> low-precision at those.
>> 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...
> 
>>>> So, should I pursue either of these issues (Bugzilla?), or are
>>>> they known issues?
>>> 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.

If I understood what he said right, that is the effective resolution for 
a very small font, but a larger font raises the resolution to 16.16.

He was wondering what size should be used to send the path from FreeType 
to Cairo, it would seem the best one is such that the resolution exactly 
matches that used by TTF files (which are fixed-point, right?), or is 
some integer multiple of it. Then there would be no rounding errors.

It may also be desirable to have smooth scaling of a *hinted* font, for 
instance to zoom in to a document that you are expected to read when the 
zoom is 1:1. I certainly found this useful in some of our code where we 
wanted this effect. Also produces interesting results if you hint for a 
very small size and draw very large. This may require both a font matrix 
and a "hint as though the matrix is this" matrix.




More information about the cairo mailing list