Re: A question regarding text extents

Uli Schlachter <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Hi,

On 10.11.2012 13:33, Zozó Teki wrote:
> I use cairo_text_extents() to retrieve how much space is needed for a
> piece of text to be able to draw a simple box around it. I have
> noticed that this function returns a different value depending on the
> transformation matrix in effect. Specifically, if I scale the context,
> the returned x_advance is somewhat larger (and also the text is drawn
> somewhat larger) - but not by the scaling factor.
[...]

Welcome to hinting. It makes fonts look better by making them "stick" to the
pixel grid. This also means that animations which zoom in/out of text look bad,
because the text "stutters".

The API documentation can tell you a little more (especially how to disable
hinting):

http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-hint-style-t

Cheers,
Uli
-- 
Bitte nicht mit dem verbleibenden Auge in den Laser gucken.
 - Vincent Ebert
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.