<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>It is important to know which version of cairo I am using.</p>
<p>The sample I posted earlier is run on cairo-1.14.8-2.el7.x86_64on
RHEL7.5</p>
<p>The problem appeared only with the update of Redhat Linux from
RHEL6 to RHEL7.</p>
<p>If I run the samples on the old machine, which has
cairo-1.10.2-1.el6.x86_64, the fonts scale properly:</p>
<p><tt>[alois@as81 devlop]$ ctest1</tt><tt> bitmap surface<br>
</tt><tt>9.0 pt on Size: 45x7 9.0 pt off Size: 45.7764x7</tt><tt><br>
</tt><tt>9.1 pt on Size: 45x7 9.1 pt off Size: 46.222x7</tt><tt><br>
</tt><tt>9.2 pt on Size: 45x7 9.2 pt off Size: 46.7418x7</tt><tt><br>
</tt><tt>9.3 pt on Size: 46x7 9.3 pt off Size: 47.1874x7</tt><tt><br>
</tt><tt>9.4 pt on Size: 46x7 9.4 pt off Size: 47.7072x7</tt><tt><br>
</tt><tt>9.5 pt on Size: 46x7 9.5 pt off Size: 48.1528x7</tt><tt><br>
</tt><tt>9.6 pt on Size: 46x8 9.6 pt off Size: 48.5984x8</tt><tt><br>
</tt><tt>9.7 pt on Size: 46x8 9.7 pt off Size: 49.1183x8</tt><tt><br>
</tt><tt>9.8 pt on Size: 48x8 9.8 pt off Size: 49.5639x8</tt><tt><br>
</tt><tt>9.9 pt on Size: 53x8 9.9 pt off Size: 50.0837x8</tt><tt><br>
</tt><tt>10.0 pt on Size: 55x8 10.0 pt off Size: 50.5293x8</tt></p>
<p><tt>[alois@as81 devlop]$ ctest2</tt><tt> PDF surface<br>
</tt><tt>9.0 pt on Size: 45.4951x6.8125 9.0 pt off Size:
45.4951x6.8125</tt><tt><br>
</tt><tt>9.1 pt on Size: 45.9407x6.8125 9.1 pt off Size:
45.9407x6.8125</tt><tt><br>
</tt><tt>9.2 pt on Size: 46.4606x6.8125 9.2 pt off Size:
46.4606x6.8125</tt><tt><br>
</tt><tt>9.3 pt on Size: 46.9062x6.8125 9.3 pt off Size:
46.9062x6.8125</tt><tt><br>
</tt><tt>9.4 pt on Size: 47.426x6.8125 9.4 pt off Size:
47.426x6.8125</tt><tt><br>
</tt><tt>9.5 pt on Size: 48.1841x7.5625 9.5 pt off Size:
48.1841x7.5625</tt><tt><br>
</tt><tt>9.6 pt on Size: 48.6297x7.5625 9.6 pt off Size:
48.6297x7.5625</tt><tt><br>
</tt><tt>9.7 pt on Size: 49.1496x7.5625 9.7 pt off Size:
49.1496x7.5625</tt><tt><br>
</tt><tt>9.8 pt on Size: 49.5951x7.5625 9.8 pt off Size:
49.5951x7.5625</tt><tt><br>
</tt><tt>9.9 pt on Size: 50.115x7.5625 9.9 pt off Size:
50.115x7.5625</tt><tt><br>
</tt><tt>10.0 pt on Size: 50.5605x7.5625 10.0 pt off Size:
50.5605x7.5625</tt><br>
</p>
<p>What happened between cairo 1.10 and cairo 1.14 to cause this
issue?<br>
</p>
<br>
<div class="moz-cite-prefix">On 29.09.18 10:57, Alois Treindl wrote:<br>
</div>
<blockquote type="cite"
cite="mid:97838e87-6f54-815e-fe52-762e4f4fed5c@astro.ch">sorry,
sent html message again which this list dos not accept.
<br>
I send a second time.
<br>
----
<br>
I added font size changes to the example, and print extents with
metric on and off.
<br>
The problem which I am addressing appears: font size changes only
in steps.
<br>
<br>
9.0 pt on Size: 49x7 9.0 pt off Size: 45.7764x7
<br>
9.1 pt on Size: 49x7 9.1 pt off Size: 45.7764x7
<br>
9.2 pt on Size: 49x7 9.2 pt off Size: 45.7764x7
<br>
9.3 pt on Size: 49x7 9.3 pt off Size: 45.7764x7
<br>
9.4 pt on Size: 49x7 9.4 pt off Size: 45.7764x7
<br>
9.5 pt on Size: 51x7 9.5 pt off Size: 50.5293x7
<br>
9.6 pt on Size: 51x7 9.6 pt off Size: 50.5293x7
<br>
9.7 pt on Size: 51x7 9.7 pt off Size: 50.5293x7
<br>
9.8 pt on Size: 51x7 9.8 pt off Size: 50.5293x7
<br>
9.9 pt on Size: 51x7 9.9 pt off Size: 50.5293x7
<br>
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>
<br>
On 29.09.18 08:12, Uli Schlachter wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
On 28.09.2018 14:10, Alois Treindl wrote:
<br>
<blockquote type="cite">I noticed that cairo does not allow me
to set a precise font size, like 9.4 pt
<br>
or 9.7 pt.
<br>
What I get is exactly the same font size, for a range of font
sizes.
<br>
</blockquote>
Try disabling metrics hinting via CAIRO_HINT_METRICS_OFF. See
the
<br>
attached example program. Per the docs, this metrics hinting
quantizises
<br>
font metrics so that they are integer values in device space,
i.e. does
<br>
exactly what you are trying to get rid of.
<br>
<br>
You might also want to do cairo_font_options_set_hint_style(opt,
<br>
CAIRO_HINT_STYLE_NONE), depending on, well, if you want the font
<br>
outlines to be hinted or not.
<br>
<br>
Cheers,
<br>
Uli
<br>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>