Page 1 of 2

newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:09 pm
by tomshreds
Hi,

I was wondering if it would be possible to get a bit less letter spacing when using newImageFont ?

Image

Thanks!

Re: newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:22 pm
by Nixola
I didn't get so much spacing the last time I used one, could you upload the image so we can see if there's something wrong in it? If I recall well, Imagefonts have a default spacing of 1 which gets added to the actual space between the glyphs inside the image (except for the separator coloumn, which is not considered)

EDIT: Now that I read my post again, I could have said that the separator coloumn IS considered and there's no added spacing... Nevermind, it's about the same, isn't it?

Re: newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:25 pm
by tomshreds
Nixola wrote:I didn't get so much spacing the last time I used one, could you upload the image so we can see if there's something wrong in it? If I recall well, Imagefonts have a default spacing of 1 which gets added to the actual space between the glyphs inside the image (except for the separator coloumn, which is not considered)

EDIT: Now that I read my post again, I could have said that the separator coloumn IS considered and there's no added spacing... Nevermind, it's about the same, isn't it?
Haha, Here's the bitmap font file:
download/file.php?mode=view&id=22824

Maybe it's the spacing IN that file?

Thanks!

Re: newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:29 pm
by Nixola
The yellow coloumns should be only 1px wide, otherwise you get increased spacing (Actually I'd have said it would have just messed up something, but it doesn't seem like it's that)

Re: newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:31 pm
by tomshreds
Nixola wrote:The yellow coloumns should be only 1px wide, otherwise you get increased spacing (Actually I'd have said it would have just messed up something, but it doesn't seem like it's that)
Ah! Alright! I'll try to change it and will try again. Thanks a lot!

Re: newImageFont, letter spacing

Posted: Mon Jan 21, 2013 11:33 pm
by Nixola
You're welcome ;)

Re: newImageFont, letter spacing

Posted: Wed Feb 25, 2015 11:05 pm
by xaa3
Is it possible to remove the spaces in between characters completely? I'm trying to use pixel fonts to make health bars but the spaces makes it look wrong.

Posted a pic of what I'm going for.

Re: newImageFont, letter spacing

Posted: Thu Feb 26, 2015 3:36 am
by Jasoco
The problem is that image fonts don't have letter spacing at all. Let alone negative spacing. I wish they did though. It'd be so useful. Especially to replicate a lot of fonts from the SNES era which had black borders that overlapped. The way it is now you'd have to write your own text display system or a shader to add the border which is overkill. Has anyone suggested it to the Issue Tracker yet? Seems like it'd be easy to implement unless the text display library Löve uses has a limitation.

And in reply to xaa3 above, why not just use images or rectangles?

Re: newImageFont, letter spacing

Posted: Thu Feb 26, 2015 7:23 am
by slime
In LÖVE 0.10.0, the special coloured spacing pixels in ImageFonts will be ignored completely for character spacing calculations.
Using a font isn't an optimal way to create a health bar either way though, you could just use two overlaid rectangles or images as Jasoco says.

Re: newImageFont, letter spacing

Posted: Thu Feb 26, 2015 10:47 am
by Jasoco
But will we be able to set the letter spacing on image fonts in 0.10.0? And also, why 0.10.0 and not 0.9.3 too? Isn't 0.10.0 really really far off?