GLBasic forum

Main forum => GLBasic - en => Topic started by: nabz32 on 2016-Mar-13

Title: How GLBasic does its kerning internally?
Post by: nabz32 on 2016-Mar-13
Hello, I am in the process of writing a polyvector print function for my game, to achieve some cool effects.

I just wanted to know how GLBasic internally calculates its kerning in its PRINT function?
Does it use some kind of std kerning table ( since fonts are only loaded as .bmp / .png and not the .fnt file itself or how it is called )?
Or does it calculate a kerning table using the font.bmp data on loadfont ( by parsing each letter field with some algorythm )?

Title: Re: How GLBasic does its kerning internally?
Post by: kanonet on 2016-Mar-13
Probably the 2nd way, because thats how usually all bitmap fonts are done, when you dont have a file to load all the needed informations from.

If you want to write your own proportional bitmap font, you may also want to have a look at work that others did before:
Title: Re: How GLBasic does its kerning internally?
Post by: nabz32 on 2016-Mar-13
Thx for all the good links Kanonet :good:

I think I will load the font sprite into mem then, upon first use of a new font texture.
From this array I will parse each characters grids colorkeys, once from left to right and once fro right to left.
With this I will gain the real xLeft and xRight boarders of the characters in the font sprite and can store them in a fitting array.

Title: Re: How GLBasic does its kerning internally?
Post by: nabz32 on 2016-Mar-13
I solved the kerning issue with this approach =D.
Tomorrow I can finally start to experiment with the vector fonts for effects.