[cairo] text measuring speed

Bill Spitzak spitzak at d2.com
Fri Jun 17 09:37:34 PDT 2005



Jon Smirl wrote:
> On 6/15/05, Bill Spitzak <spitzak at d2.com> wrote:
> 
>>It seems to me that the way FreeType does the hinting is perhaps
>>desirable and Cairo should copy it.
> 
> 
> This sounds like a really good idea to me if I understand it right.
> Cairo has the same problem with thin lines disappearing as FreeType
> does. Why not generate the scene as vectors, run the autohinter over
> everything, including the Cario generated vectors, then rasterize it
> all. The autohinter will adjust all of the line centers to pixel
> boundaries just like it does for FreeType.
> 
> Wouldn't this fix the gap problem everyone is talking about too? 
> 
> Does it let the app ignore pixelization and assume infinite resolution?
> 

I was talking about applying the CTM to the font outlines *after* the 
hinting. So the exact shape is transformed by the CTM. I think this 
would have some speed and convienence advantages, with the problem that 
hinting is only correct if the CTM is about the same size as the default 
transform for the device.

As for this idea, I think it was discussed and decided that all useful 
transforms could be done by the calling program, as long as it can peek 
at the CTM.

I do feel there is a need for a special "0-linewidth" mode that would 
draw a sort of auto-hinted 1-pixel thick lines (all strokes are adjusted 
so the end points are at the centers of pixels). This would only affect 
the stroke command, fill and glyphs would be unaffected (except the 
fill's antialiased pixels are required to be the same pixels the 
0-linewidth stroke would draw). The main reason for this is that most 
other graphic API's provide this and the lack of it makes porting to 
Cairo difficult, since many programs leave the graphics in this mode at 
all times. Triggering the mode with zero line width would match what all 
other API's do.





More information about the cairo mailing list