[cairo] font size change only in large steps

Uli Schlachter psychon at znc.in
Sat Sep 29 06:12:51 UTC 2018


Hi,

On 28.09.2018 14:10, Alois Treindl wrote:
> I noticed that cairo does not allow me to set a precise font size, like 9.4 pt 
> or 9.7 pt.
> What I get is exactly the same font size, for a range of font sizes.

Try disabling metrics hinting via CAIRO_HINT_METRICS_OFF. See the
attached example program. Per the docs, this metrics hinting quantizises
font metrics so that they are integer values in device space, i.e. does
exactly what you are trying to get rid of.

You might also want to do cairo_font_options_set_hint_style(opt,
CAIRO_HINT_STYLE_NONE), depending on, well, if you want the font
outlines to be hinted or not.

Cheers,
Uli
-- 
Sent from my Game Boy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 712 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180929/99379e98/attachment.c>


More information about the cairo mailing list