GLBasic forum

Main forum => Bug Reports => Topic started by: Qedo on 2020-Apr-11

Title: kerning issue?
Post by: Qedo on 2020-Apr-11
I don't know if it has already been reported and if it is a bug but with the kerning to true of PRINT (PRINT, string$, 0,0, true) and LEN (string$, true) it does not work with background colors other than black or transparent.
Ciao
Title: Re: kerning issue?
Post by: Qedo on 2020-May-01
has anyone verified?
Ciao
Title: Re: kerning issue?
Post by: dreamerman on 2020-May-01
hm.. I'm using Print only for basic info like FPS counter, for in-game stuff using my own text drawing routines. Can You provide any small source / project to verify that fast?
Title: Re: kerning issue?
Post by: Qedo on 2020-May-01
Try this:
Thank you.

string$="Computer 123456789Ww"
LOADFONT "arial32.png", 1
SETFONT 1
PRINT string$+" "+LEN(string$,TRUE), 10, 150 , TRUE
SHOWSCREEN
MOUSEWAIT
END
Title: Re: kerning issue?
Post by: dreamerman on 2020-May-01
From what I understand, in such example it's working as it should, because font bitmap background is red so it's treated as part of a font, in order to change font transparent color (that will be omitted during drawing and such functions like LEN or rather when loading a font) use "SETTRANSPARENCY color%". Default transparent color for loaded font is black.
Title: Re: kerning issue?
Post by: Qedo on 2020-May-01
according to my logic, but I can be wrong, kerning should analyze the forecolor and not the backgroung.
However I thank you for the analysis and the solution.
Ciao
Title: Re: kerning issue?
Post by: Moru on 2020-May-03
A font can have any number of colors. In old times rainbow colors on the font was not uncommon :-) I guess you need to tell the computer what really is the background color if you aren't using a transparent image for the font (If that is possible even)