Page 1 of 1

Why does my image font not work?

Posted: Thu Jun 06, 2019 8:17 am
by Ratchet
Other Image fonts work good. Why this one don't?

Image

Code: Select all

function love.load()
	bombing = love.graphics.newImageFont("bombing.png", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-;:_!\"$/()=?#*+", 1)
end

function love.draw()
	love.graphics.setFont(bombing)
	love.graphics.print("Hello World 123", 0, 0)
end

Re: Why my image font doesn't work?

Posted: Thu Jun 06, 2019 10:33 am
by pgimeno
It has some pink with alpha = 1/255 which seems to be confusing the separator.

I've fixed it with gimp, first selecting the pink by colour with threshold 0, then transferring the alpha to a layer mask, applying a threshold to the mask (so that alpha is either 255/255 or 0/255 in the areas that were pink) and saving.

You could suggest in the bug tracker to consider the alpha when separating the characters, to avoid issues like this.

Re: Why does my image font not work?

Posted: Thu Jun 06, 2019 12:08 pm
by Ratchet
Oh, thanks for fixing it. I checked the rgb of the pink separators but not the alpha - no idea where the alpha comes from.
Thank you so much.