Altering DrawText character spacing

BlitzMax Forums/BlitzMax Programming/Altering DrawText character spacing

Grey Alien(Posted 2007) [#1]
DrawText uses the font's default character spacing (is that called Kerning?). Anyway is there are way to alter the spacing by say 10%? Perhaps a setting in the DrawText module?

Otherwise I'll have to do this manuall i.e. draw a character then use TextLength to get the width of the char and add a % to it and then draw the next char. Could be a bit slow...

Thanks!


tonyg(Posted 2007) [#2]
Look at the imagefont.draw method in imagefont.mod. It simply does what you're suggesting by looping through the text array and drawing each character at x+n


grable(Posted 2007) [#3]
Like this? ;)

(Code ripped from BRL.ImageFont and BRL.Max2D)


Grey Alien(Posted 2007) [#4]
yeah like that ;-) thx. But I may not need it now. See my other post...

Permission to add to framework with your name as a credit please?

Thanks TonyG, you are correct as usual but I have a secret "fear" of looking in the largely uncommented mod files.


Grey Alien(Posted 2007) [#5]
Grable: Well I've used it anyway. thanks!