Re: Imprecise font scaling

Jean Abou Samra <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <[email protected]>
Sorry, my mail client changed the formatting in a way I didn't expect.
Resending.

> 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/gUCZcfAfgAKCRCj8PYLiTOX
/rZBAP9LWqxMkHT5VOseHLbjygG9plL4optXMvLCaAayNt0T+QEAzoxOV2wwgEX2
iiDJs15Notq33/HIQWiKXywkamghlw8=
=wfLD
-----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.