Page 1 of 2

wrong bitmap Font rendering in löve 0.10.2

Posted: Thu May 18, 2017 12:09 pm
by SiENcE
Since love 0.10.2 i noticed, that bitmap font rendering is broken. I think this has todo with the space (width) you give to the drawing container.

love 0.7.2
Image

love 0.8.0
Image

love 0.9.2
Image

love 0.10.2 (broken)
Image

Can someone help or tell how to solve this?

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Thu May 18, 2017 1:57 pm
by raidho36
Looks like a bug. You should put that to the issue tracker.

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Thu May 18, 2017 2:17 pm
by slime
Since love 0.10.0, the separator pixels in an image font aren't treated as spacing when rendering text with the font. You can use the optional spacing argument in love.graphics.newImageFont to add a constant amount of spacing to every glyph in the font.

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Thu May 18, 2017 2:26 pm
by raidho36
slime wrote: Thu May 18, 2017 2:17 pm Since love 0.10.0, the separator pixels in an image font aren't treated as spacing when rendering text with the font. You can use the optional spacing argument in love.graphics.newImageFont to add a constant amount of spacing to every glyph in the font.
It should be just rendering letters all crammed together, not with strips of pixels missing. And sometimes it shows those strips anyway? That doesn't look right.

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Thu May 18, 2017 4:18 pm
by slime
Without seeing what the code's actually doing, I could guess that the rendered text is being translated or scaled by non-integer values. 0.10.0 removed the internal floor() it used to do to the x and y parameters of love.graphics.print.

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Fri May 19, 2017 9:07 am
by SiENcE
Spacing does not fix the crippled letters :-/ and it's not scaled.

All monospaced bitmap fonts are correct rendered.

So I assume that this problem happens only with uneven bitmap fonts (uneven spacing) as the one above.

All monospaced bitmap font works correct with love 0.10.2
Image

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Fri May 19, 2017 4:03 pm
by slime
Can you provide a minimal .love which reproduces the issue?

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Sun May 21, 2017 7:47 pm
by SiENcE
Sure :).

It seems the problem has todo with font:getWidth and also with extraspacing.

For uneven fonts you can't use it and font:getWidth seems to return wrong values.

Test (same for all löve versions):
First string uses a calc. x and y position depending on fontsizes
Second string uses a fixed x,y position

love 0.7.2, 0.8.0, 0.9.2
Image

love 0.10.1 or 0.10.2
Image

love 0.10.1 or 0.10.2 with extraspacing of 1
Image

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Wed May 24, 2017 7:47 am
by SiENcE
Can anybody confirm this?

Re: wrong bitmap Font rendering in löve 0.10.2

Posted: Wed May 24, 2017 8:26 am
by Nixola
I tried your demo, I can confirm it works in 0.7.2, 0.8.0, 0.9.2; it's bugged in 0.10.2 and whatever the love-hg AUR package is (I'm assuming last commit)