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

Rolf Eike Beer eb at emlix.com
Fri Apr 12 07:36:12 UTC 2019


Am Donnerstag, 11. April 2019, 18:23:24 CEST schrieb Uli Schlachter:
> 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?

Liberation something, which are the only ones installed on the target.

> [...]
> 
> > 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)) =
> 9090423496703681033747047890550501147621169273561563201479712084405348886581
> 6695273723469097858056257517020191247487429516932130503560650002327564517570
> 778480236724525140520121371739201496540132640109977779420565776568942592.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?

This is Linux, but…

the configure test uses not just grep, but

strings -a conftest$ac_exeext | grep -a 

Because strings is not part of our chroot build environment this doesn't work. 
If I replace the "strings -a" with a simple cat or just do grep on the file 
itself I get results:

root at devpool35:/tmp/e2/build/cairo# grep seesnoon endianess-safe          
Binary file endianess-safe matches

And now I guess this is the reason: I worked around that by simply setting 
ax_cv_c_float_words_bigendian before, but had a typo in my check, so it was 
writing the inverse value.

Thanks for the hint.

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 313 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.cairographics.org/archives/cairo/attachments/20190412/1b2dff9a/attachment.sig>


More information about the cairo mailing list