Font kerning

Previous topic - Next topic

MrTAToad

Yes, being able to change the colour of sentances (or even indivual characters) would be great - saves having to have multiple font files with different colours...

Moru

Good, then the Bitmap Font library is still useful for something, bold, italic and change colors in the middle of a sentence is still possible there :-)

ampos

Quote from: Kitty Hello on 2010-Oct-18
Next update - weekend.

Weekend has just passed  :nana:
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

BdR

The kerning option with PRINT command looks great, this is a great improvement. There's only one thing, it sets the font width as the width for space-characters, which looks a bit weird. You can work around this by changing the font bitmap, and draw a dark grey box in the space character. But then all spaces contain a dark grey box. See screenshot in attachment.

I'm not sure how this could be solved. Maybe the space width should be the same as the width of the 'i' character in the bitmap (or the 'a' character?), or maybe the avarage width of all characters. Or maybe the PRINT command should only increase the x-position with the width of the space-character in the bitmap, but not draw it.

[attachment deleted by admin]

Wampus

I see what you mean BdR. Space width does look a bit odd. Another solution to those suggestions you made could be for the space width to be a variable than can be user defined.

MrTAToad

Yes, I mentioned earlier that the width of space is a bit too big...  Needs to be slightly smaller really.

hardyx

Quote from: Kitty Hello on 2010-Oct-18
To get the width of that string in pixels, use LEN(text$, bKerning%)
This LEN() function could be confuse with the length of a string. I suggest PIXLEN() or PXLEN() as names to inform that the result units are different.

Moru

Space needs to be the size of whatever the "n" character is.

Kitty Hello

After some experiments, I found out that the width of the character "j" (small jay) is approximately the space consumed by most variable fonts. So, I pick that width for the space for the next update.

ampos

What about giving the kerning value, a value?

kerning=1=std space
kerning=2=std space+1pixel (this +1 also in all letters)
kerning=3=std space+2pixel (this +2 also in all letters)

Just an idea..
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Moru

Well, if you want that fine-grained control, why don't you just use the bitmap font routines? :-) There you can also do gradient colours, italic, bold and some other things too.