BASIC

Author Topic: real font  (Read 3281 times)

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
real font
« 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
<HTML><BASIC><EC>
Be free and do good things

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: real font
« Reply #1 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
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: real font
« Reply #2 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
<HTML><BASIC><EC>
Be free and do good things

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: real font
« Reply #3 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
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1774
    • View Profile
    • Homepage
Re: real font
« Reply #4 on: 2012-Apr-30 »
The major benefit from using bitmap fonts is the speed. We lose UNICODE support though.