GLBasic forum

Main forum => GLBasic - en => Topic started by: XanthorXIII on 2010-Aug-08

Title: Spaces between text characters
Post by: XanthorXIII on 2010-Aug-08
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
Title: Re: Spaces between text characters
Post by: Nobiag on 2010-Aug-08
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.
Title: Re: Spaces between text characters
Post by: MrTAToad on 2010-Aug-08
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.
Title: Re: Spaces between text characters
Post by: Moru on 2010-Aug-08
Downloadable on my homepage... There is also proportional spacing possible with the DDGUI library if you use that.
Title: Re: Spaces between text characters
Post by: XanthorXIII on 2010-Aug-08
Thanks for the excellent advice. I will look into fixing that.

Title: Re: Spaces between text characters
Post by: Kitty Hello on 2010-Aug-09
Code: (glbasic) [Select]
DDGui_UpdateFont(TRUE);
DDGui_PrintIntern(text$, x,y)

There's other libraries here. Search for "kerning"
Title: Re: Spaces between text characters
Post by: okee on 2010-Aug-10
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.