Re: Imprecise font scaling

Jean Abou Samra <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <[email protected]>
I'm running the following code

\version "2.25.12"
\markup { LOL }
\markup { \magnify #2.0 LOL }

and the results are not really precise. When producing --eps, the relevant output lines are

/C059-Roman 3.86523438 output-scale div selectfont
/C059-Roman 7.73242188 output-scale div selectfont

However, 2 * 3.86523438 = 7.73046876 != 7.73242188. Basically the same behaviour can be observed when using Cairo (both for EPS and SVG).
> (Producing SVG without Cairo is pretty disastrous in this regard, but
> that doesn't bother me too much at the moment.)


I'm quite sure this is because of

      int pango_size = static_cast<int> (
        std::lround (static_cast<Real> (requested_size) * PANGO_SCALE));

in lily/font-select.cc, which we cannot really do anything about, because
the Pango API

https://docs.gtk.org/Pango/method.FontDescription.set_size.html

expects an integer size scaled by PANGO_SCALE, which is 1024. That is, we are
limited to a precision of 1/1024 points on the font size.
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZce/jAAKCRCj8PYLiTOX
/s0dAQCwOI4GdTNvNXzNCRqMpChj2T40qm8RWhJUsGChDb76JQD+N+41Rc9J6Tpy
2jEPjc7KVzyPW9FdW58GUZeJOEU8jAM=
=BbfM
-----END PGP SIGNATURE-----
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.