[cairo] Text not rendered because of big offset in glyph bbox

Uli Schlachter psychon at znc.in
Thu Apr 11 16:23:24 UTC 2019


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi Rolf,

On 11.04.19 11:20, Rolf Eike Beer wrote:
[...]
> My testcase is quite simple:
> 
> pango-view "--text=|" -qo abc.png

Any idea which font this is using? Does using a different font make a
difference here, perhaps?

[...]
> In my opinion this looks really strange:
> 
> Breakpoint 1, _cairo_fixed_from_double (d=4) at
> cairo-fixed-private.h:118 118         u.d = d +
> CAIRO_MAGIC_NUMBER_FIXED; (gdb) n 120         return u.i[1]; (gdb)
> p u $1 = {d = 26388279066628, i = {1024, 1119354880}} (gdb) p d $2
> = 4

Hm. This seems to be an endian issue. The fixed point value for "4" is
"1024". However, your compiler seemed to be using u.i[1] instead.

[...]
> Can anyone give me a hint where I need to poke to get that right?

If you are building cairo yourself: Can you grep config.h for
FLOAT_WORDS_BIGENDIAN? Apparently, for you that symbol is #define'd,
but should not.

The configure test that is used to decide ff FLOAT_WORDS_BIGENDIAN is
define'd or not basically does the following:

$ echo 'double d __attribute__((used)) =
90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
int main() { return 0; }' > t.c && gcc t.c && strings -a a.out | grep
- -E 'noon|sees'

If it finds "noonsees", then floats are big endian. If it finds
"seesnoon", then floats are little endian. If it finds neither, it
complains.

Well, there is also a special case for darwin. Are you on something
darwin-y? If not, could you run the above command and see what it
prints and if configure sees the same result?

Cheers,
Uli
- -- 
99 little bugs in the code
99 little bugs in the code
Take one down, patch it around
117 little bugs in the code
  -- @irqed
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEK7MviP89HnbmgjA/IuQo68uPywYFAlyvafMACgkQIuQo68uP
ywaSkQf/Y0ecdABWpEX7mYAcz4srLAzIt9WyVP514qmWTZnNKzQt1PQ/kxEPbvUk
kEP4w5sOhubXYCTSROLGKCNE6UA088huNPpQyViDf2vkReWDEWYUZQ+tqRNklVj2
67AunDzEBibOHzHGWh5X3ek0LdkWK4u9iCiK7lfZ0jn5dyDpTnfvnkRIlG7bemIr
LH5Ki0m8kTarxB/dEKDNUKpUoR2hlVUJfdSbEdm6XXuTM+2Zsx7yVkqYm1j+NT1c
BKPsKlpnZCUYuK2zxOqkzis4/Jyk7XxvU/FIDwni4zqJPTfNVVFYASRrQtpfdGsA
IaJmTJD0/1uQOd8rtTyGdclOzSzf7w==
=tWOw
-----END PGP SIGNATURE-----


More information about the cairo mailing list