Spaces between text characters

Previous topic - Next topic

XanthorXIII

Hello,
While writing a test program, I noticed that when printing to the screen that the text had a lot of spaces between the letters. Is this due to the font that I am using? I'm currently using the default but can change to another if there is one that works better.
Thanks.

XanthorXIII
Owlcat has wise

Nobiag

#1
As far as i know this is due to the bitmap font system. Glbasic doesn't use real font files, it uses picture files like bitmap or png with the letters in it and gives every character the same pixel space. I hate this too, because good looking text is very important for a clean, polished look i think. I once wrote a function that splits text into single characters and then i defined a width value for every letter, but thats hard and tedious work and you have to do it for every font individually...

Edit: Also i don't know if you lose performance when using a print command for every single character. Maybe a function that only gives W, M, G more space and I,l,t less space is enough for the start, since it would probably be an improvement for every font.

MrTAToad

You usually use a font whereby each character uses as much space as possible, which reduces any spaces between characters.  Fixedsys is good for this.

Alternatively, Moru has a proportional font system.

Moru

Downloadable on my homepage... There is also proportional spacing possible with the DDGUI library if you use that.

XanthorXIII

Thanks for the excellent advice. I will look into fixing that.

Owlcat has wise

Kitty Hello

Code (glbasic) Select

DDGui_UpdateFont(TRUE);
DDGui_PrintIntern(text$, x,y)


There's other libraries here. Search for "kerning"

okee

I've found that courier new created in the font creator to a size of 96 x 96
and with cleartype winxp ticked works great.
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)