The attached library can load converted TTF fonts and render them in real time. This gives the option to dynamically scale fonts and use colours.
I've not done any performance tests on mobile devices, yet.
I also attached a tiny command line program that generates the font from your installed ttf files in windows.
Just run:
TTF-create.exe arial
and it will create an arial.glbvf file (GLBasic Vector Font).
Characters 33 to 255 are supported. The font must be available as C:\Windows\Fonts\****.ttf
Nice! Thanks Kitty! :good:
I´m sure going to give a go with it as soon as I finish current project.
Thanks Gernot :)
Thank you Gernot. Very timely as I was current pondering how to support foreign fonts in my game. The answer, not easily. This should give me a decent option. :good:
Thanks Gernot! Probably it's worth rewriting my font engine in my upcoming game.
Thanks Gernot for this font engine.
I ask you if you can increase the font resolution that seems very low as you can see from the image. For example, the letter "g" is not rounded as it should be. Is it possible to work on generating the glbvf file?
in TTF.gbas:
FUNCTION pt2px: pt
// points = pixels * 72 / dpi
STATIC dpi = PLATFORMINFO$("DPI")
RETURN pt / 72.0 * dpi * 50.0 // this factor is by try/error
ENDFUNCTION
I guess you have to change the DPI in the Editor itself?
It does not work.
I think it depends on how the font was triagolarized previously in the glbvf file
I haven't tried this yet - but could be very useful for a game I am planning.
On this font system - can the fonts be relocated to the media/fonts/ ?
That way its isn't dependant on the windows setup of the machine?
I guess Gernot use SDL_TTF for it.
He need to change the
ttf_rendertext_solid
to
ttf_rendertext_shaded
then it's smooth :)
I must use finer resolution internally. And I also must pre-render the glyphs to a bitmap. It is just to slow in real time.