Author Topic: kerning issue?  (Read 354 times)

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
kerning issue?
« 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

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: kerning issue?
« Reply #1 on: 2020-May-01 »
has anyone verified?
Ciao

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: kerning issue?
« Reply #2 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?
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: kerning issue?
« Reply #3 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

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: kerning issue?
« Reply #4 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.
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: kerning issue?
« Reply #5 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

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
Re: kerning issue?
« Reply #6 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)