GLBasic forum

Feature request => 2D => Topic started by: Jonás Perusquía on 2012-Apr-29

Title: real font
Post by: Jonás Perusquía on 2012-Apr-29
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) Select
LOADFONT "Comic Sans MS", 1
SETFONT 1
SETFONTSIZE 18
PRINT *"Hello "* + "Hello"

* = bold
result:

Hello Hello
Title: Re: real font
Post by: fuzzy70 on 2012-Apr-29
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

Lee
Title: Re: real font
Post by: Jonás Perusquía on 2012-Apr-29
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
Title: Re: real font
Post by: fuzzy70 on 2012-Apr-29
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.

Lee
Title: Re: real font
Post by: Moru on 2012-Apr-30
The major benefit from using bitmap fonts is the speed. We lose UNICODE support though.