<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi!</p>
<p>Thanks for your hint. It solved the problem!</p>
<p>I set the the font options to <span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">CAIRO_HINT_METRICS_OFF</span></span>
with <span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">cairo_font_options_set_hint_metrics(fo,
CAIRO_HINT_METRICS_OFF);</span></span></p>
<p><span style="color:#000000;background-color:#ffffff;">Thank you
very much!</span></p>
<p><span style="color:#000000;background-color:#ffffff;">Best
regards,<br>
Bernhard</span></p>
<p><span style="color:#000000;background-color:#ffffff;"><br>
</span><span style="font-family:monospace"></span></p>
<div class="moz-cite-prefix">On 15.12.2024 19:45, Theo Veenker
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:97288b42-0ed8-4886-aa14-0ad1580fb3ec@beexy.nl">Hi
Bernhard,
<br>
<br>
Could it be it is caused by font hinting? Maybe try playing with
the hint style (see font options). Just a wild guess.
<br>
<br>
Theo
<br>
<br>
On 14/12/2024 10:34, Bernhard R. Fischer wrote:
<br>
<blockquote type="cite">Dear list,
<br>
<br>
It has been a long time since I posted here for the last time.
Sorry for the long text but it's to so easy to explain.
<br>
<br>
I'm using Cairographics extensively for an OSM data rendering
software since many years (<a class="moz-txt-link-freetext" href="https://github.com/rahra/smrender">https://github.com/rahra/smrender</a>),
so I'm not new to it.
<br>
<br>
What I regularly do is to use a recording surface internally and
finally paint it to a PDF, SVG, or whatever surface is required.
<br>
<br>
In respect to the units I always assumed that 1 unit within the
recording surface is to be 1 millimeter in the final result. To
accomplish this I create the recording surface with the size of
the final page (e.g. create_recording_surface(210, 297) for an
A4 page have 210x297mm), then I draw on it and finally at the
cairo_paint to the PDF surface I scale the paint operation to
meet the points unit of the PDF.
<br>
<br>
This concept works fine but unfortunately recently within a
different project (where I use the same drawing concept) I made
the discovery that the resolution of the recording surface seems
to be limited at least with the toy text API. I use the
get_text_extents and similar functions to place some text at
specific positions and with some debugging I found out that it
does not use any fractional part of the extents member
variables.
<br>
<br>
E.g. the text_extents.width always returns e.g. 3.0, 4.0, 8.0,
but never something like 3.17, 4.28 and so on. The final result
is that the text (obviously) is not placed on exact positions
(where it should be).
<br>
<br>
With further experiments I found out that if I make the
recording surface width/height e.g. 100 times bigger
(21000x29700) and then scale it by factor 100 the text_extents
will work with higher resolution as expected. But if I further
increase the recording surface to a factor of e.g. 1000, it will
internally hang somewhere within an endless loop (within
libcairo). So there seems to be some upper limit.
<br>
<br>
So my question is: is there a limit in the resolution of the
recording surface? Or is this a limitation of the toy text API?
Or did I stumble on something else? Or is my drawing concept
somehow incorrect?
<br>
<br>
Best regards,
<br>
Bernhard
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
</body>
</html>