<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>I added font size changes to the example, and print extents with
metric on and off.</tt><tt><br>
</tt><tt>The problem which I am addressing appears: font size
changes only in steps.</tt><tt><br>
<br>
</tt><tt>9.0 pt on Size: 49x7 9.0 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.1 pt on Size: 49x7 9.1 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.2 pt on Size: 49x7 9.2 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.3 pt on Size: 49x7 9.3 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.4 pt on Size: 49x7 9.4 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.5 pt on Size: 51x7 9.5 pt off Size: 50.5293x7</tt><tt><br>
</tt><tt>9.6 pt on Size: 51x7 9.6 pt off Size: 50.5293x7</tt><tt><br>
</tt><tt>9.7 pt on Size: 51x7 9.7 pt off Size: 50.5293x7</tt><tt><br>
</tt><tt>9.8 pt on Size: 51x7 9.8 pt off Size: 50.5293x7</tt><tt><br>
</tt><tt>9.9 pt on Size: 51x7 9.9 pt off Size: 50.5293x7</tt><tt><br>
</tt><tt>10.0 pt on Size: 51x7 10.0 pt off Size: 50.5293x7<br>
<br>
I ran also the same example but with PDF surface, and get as
output:<br>
ctest2<br>
9.0 pt on Size: 45.4951x6.8125 9.0 pt off Size:
45.4951x6.8125<br>
9.1 pt on Size: 45.4951x6.8125 9.1 pt off Size:
45.4951x6.8125<br>
9.2 pt on Size: 45.4951x6.8125 9.2 pt off Size:
45.4951x6.8125<br>
9.3 pt on Size: 45.4951x6.8125 9.3 pt off Size:
45.4951x6.8125<br>
9.4 pt on Size: 45.4951x6.8125 9.4 pt off Size:
45.4951x6.8125<br>
9.5 pt on Size: 50.5605x7.5625 9.5 pt off Size:
50.5605x7.5625<br>
9.6 pt on Size: 50.5605x7.5625 9.6 pt off Size:
50.5605x7.5625<br>
9.7 pt on Size: 50.5605x7.5625 9.7 pt off Size:
50.5605x7.5625<br>
9.8 pt on Size: 50.5605x7.5625 9.8 pt off Size:
50.5605x7.5625<br>
9.9 pt on Size: 50.5605x7.5625 9.9 pt off Size:
50.5605x7.5625<br>
10.0 pt on Size: 50.5605x7.5625 10.0 pt off Size:
50.5605x7.5625<br>
<br>
with PDF, metrics on or off makes no difference. But the font size
changes are in steps.<br>
</tt><br>
<div class="moz-cite-prefix">On 29.09.18 08:12, Uli Schlachter
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:958b7937-857c-dbf7-db79-999e6c038a88@znc.in">
<pre wrap="">Hi,
On 28.09.2018 14:10, Alois Treindl wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap="">
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
</pre>
</blockquote>
<br>
</body>
</html>