Feature request > 2D

real font


Jonás Perusquía:
hi, i make this suggestion having in mind it is possible and easy to implement, however i dont know if it really is...

i suggest real font for GLBasic

just like:

--- Code: (glbasic) ---LOADFONT "Comic Sans MS", 1
PRINT *"Hello "* + "Hello"
--- End code ---
* = bold

Hello Hello

The problem with that is cross platform compatibility. Comic Sans MS may be on windows machines but what about iPad/iPhone/Cannoo/Android etc etc. Some may not even know what a Truetype font is so a font rasterizer would have to be written for that target plus other problems.

I am pretty sure that is why GLBasic uses it's current method of using bitmap fonts for ease of portability. There are some code examples in the forum that give extra features & control over text. Ignore my one as there are better ones posted  :D


Jonás Perusquía:
but a real font could not be imported?

for example add to "media" folder the font.ttf

and LOADFONT "font.ttf"

so you can use your own "realfont"

and change size of the text with SETFONTSIZE 18

While it is simple for Windows & the other platforms that support .ttf, adding support for the other platforms may not be so easy like I said in my last post.

Different commands would probably need to be added so to not interfere with the current font commands along with print etc & break existing code using bitmap fonts.

Making it available to just certain platforms would be a bad idea, as one of GLBasic's main strengths is all the platforms you can code for with zero or little modification.


The major benefit from using bitmap fonts is the speed. We lose UNICODE support though.


[0] Message Index

Go to full version