GLBasic forum

Main forum => Announcements => Topic started by: Kitty Hello on 2010-Oct-18

Title: Font kerning
Post by: Kitty Hello on 2010-Oct-18
Yes. Finally will be in with the PRINT text$, x,y [, bKerning%]
To get the width of that string in pixels, use LEN(text$, bKerning%)

Next update - weekend.
Title: Re: Font kerning
Post by: MrTAToad on 2010-Oct-18
Yey!
Title: Re: Font kerning
Post by: Marmor on 2010-Oct-18
cool Gernot
Title: Re: Font kerning
Post by: bigsofty on 2010-Oct-18
Excellent addition!

Cheers,


Ian
Title: Re: Font kerning
Post by: Hatonastick on 2010-Oct-19
Very cool!   :good:
Title: Re: Font kerning
Post by: XanthorXIII on 2010-Oct-19
YAY!!!!!!! <DOES A BACKFLIP> YAY!!!!!!!
Title: Re: Font kerning
Post by: hardyx on 2010-Oct-20
Thank you Gernot, is a great improvement!!
Title: Re: Font kerning
Post by: ampos on 2010-Oct-20
Quote from: Kitty Hello on 2010-Oct-18
Next update - weekend.

Will we have retina settings?  :whistle:
Title: Re: Font kerning
Post by: Kitty Hello on 2010-Oct-21
Folks, these days my day time job is really pushing on me. I'm so sorry. I do my very best. I have the device, so it's just a matter of a few hours I think.
Title: Re: Font kerning
Post by: MrTAToad on 2010-Oct-21
As long as its well tested, we can wait :)
Title: Re: Font kerning
Post by: Hatonastick on 2010-Oct-22
I agree, no need to apologise mate.
Title: Re: Font kerning
Post by: Moebius on 2010-Oct-23
Very nice!  Thankyou!
Title: Re: Font kerning
Post by: bigsofty on 2010-Oct-23
No worries, Gernot, take your time.  :)
Title: Re: Font kerning
Post by: Leginus on 2010-Oct-23
I am just over the moon that you have created this software that allows me to develop for the iphone without the hassle of objective C. 

Therefore, if features take a while it doesnt matter, as if i had to do it in objective C it would take a lot longer anyway :)
Title: Re: Font kerning
Post by: matchy on 2010-Oct-24
I've been using PeejJay's Bitmap Font Routines, so kerning would be great. Center and color text is also used a lot. :P
Title: Re: Font kerning
Post by: MrTAToad on 2010-Oct-24
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...
Title: Re: Font kerning
Post by: Moru on 2010-Oct-24
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 :-)
Title: Re: Font kerning
Post by: ampos on 2010-Oct-26
Quote from: Kitty Hello on 2010-Oct-18
Next update - weekend.

Weekend has just passed  :nana:
Title: Re: Font kerning
Post by: BdR on 2010-Nov-07
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]
Title: Re: Font kerning
Post by: Wampus on 2010-Nov-07
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.
Title: Re: Font kerning
Post by: MrTAToad on 2010-Nov-07
Yes, I mentioned earlier that the width of space is a bit too big...  Needs to be slightly smaller really.
Title: Re: Font kerning
Post by: hardyx on 2010-Nov-08
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.
Title: Re: Font kerning
Post by: Moru on 2010-Nov-08
Space needs to be the size of whatever the "n" character is.
Title: Re: Font kerning
Post by: Kitty Hello on 2010-Nov-08
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.
Title: Re: Font kerning
Post by: ampos on 2010-Nov-08
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..
Title: Re: Font kerning
Post by: Moru on 2010-Nov-08
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.