Author Topic: Loadfont limit  (Read 4038 times)

Offline S. P. Gardebiter

  • Mr. Polyvector
  • ***
  • Posts: 245
    • View Profile
    • Tile 44 Interactive
Loadfont limit
« on: 2011-May-30 »
It would be cool to load more than 8 fonts into GLBasic O:
My program is able to output colored text but only 8 colors is a bit of a restriction. Is there anyway the limit could be increased to 16 or something?
~ Cave Story rules! ~

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
Re: Loadfont limit
« Reply #1 on: 2011-May-30 »
I did some changes to the font library by PeeJay, you have unlimited fonts and colors. No need to load more than one font, you can change colors on every character if you would like to. See my homepage below.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5068
  • O Rly?
    • View Profile
Re: Loadfont limit
« Reply #2 on: 2011-May-30 »
You can use polyvector to do that?!
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10752
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Loadfont limit
« Reply #3 on: 2011-May-30 »
limit is 32.

Offline S. P. Gardebiter

  • Mr. Polyvector
  • ***
  • Posts: 245
    • View Profile
    • Tile 44 Interactive
Re: Loadfont limit
« Reply #4 on: 2011-May-30 »
@Gernot: Really? o: It says "LOADFONT datei$, num# // num#: 0 - 7" in the GUI. Or is the "7"  a mistake? o: In the helpfile it says "LOADFONT bmp$, num%" btw.

@Schranzor: I know but writing an own function for this stuff seems to be kind of an hassle when I only need two or three colors more than 8. Or is there an easy to do it? O:

@Moru: Thanks. I kind of stay away from libaries that aren't official though because of copyright/licensing stuff, sorry D:
« Last Edit: 2011-May-30 by S. P. Gardebiter »
~ Cave Story rules! ~

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
Re: Loadfont limit
« Reply #5 on: 2011-May-30 »
Aw, the library is made to be used, you have all the source right there, nothing hidden.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10752
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Loadfont limit
« Reply #6 on: 2011-May-30 »
There's no license issue with source code on our forums, is there?

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5068
  • O Rly?
    • View Profile
Re: Loadfont limit
« Reply #7 on: 2011-May-30 »
There's no license issue with source code on our forums, is there?

Thats right!
If you want you can add a credit to the member... thats enough :)
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline S. P. Gardebiter

  • Mr. Polyvector
  • ***
  • Posts: 245
    • View Profile
    • Tile 44 Interactive
Re: Loadfont limit
« Reply #8 on: 2011-May-30 »
Uh but the problem is I tend to stay on the "safe side" so to say. I can sell programs created with GLBasic itself because I bought it and therefor Gernot grants me that right. But when it comes to the modificated version of the libary Moru is the author and that's why he owns the rights, aslong as he didn't released it as PD (or something simular) or handling the rights over to Gernot. Same for PeeJay. Means: If I'm ever going change my mind and sell my game I either have to ask all the owners of the 3rd party libaries and make some kind of contract or I don't use any libaries from the beginning O:
~ Cave Story rules! ~

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: Loadfont limit
« Reply #9 on: 2011-May-30 »
Depending on your needs, I would recommend using a library for your fonts.
Either one from these forums, or create / modify one for yourself.
Before, the main reason was for proportional fonts, but Gernot added that to the built in fonts a bit ago.
(also referred to as 'kerning', but I'm pretty sure 'kerning' is specifically the concept of different character pairs having different spacing, eg: 'WA' and 'WB', the 'A' actually overlaps the 'W' to make it appear closer because they share the same angle, but the 'B' doesn't)

You'd want a custom font library for performance and features.
If you have tons of text on screen during intensive game play, every ms counts.
For that you would want to use polyvectors for speed.
Plus polyvectors have the ability to scale (and rotate) your fonts to any size very easily.
(eg: you could have 'START' rotating around getting smaller until it rests in the middle of the screen.)

Plus you can display them in any colour, even using a gradient concept (all four corners of a character can have a different colour and the result will be blended between the four colours).
Features that could be added are: font scale, font colour / alpha, justification, rotation, anchor point, etc.
For the fastest font routine, it should buffer all the font requests for a frame and display them all at once using the same material and only one material change per font used.  (mine does this, at the cost of more complex code, but I wanted the fastest fonts possible, for the future)

As far as the other library licensing, maybe the licensing should be officially stated (on a per library basis I assume).
What's the license name / type for it to be used 100% with no restrictions, and for commercial use also?

But for initial testing and prototyping, the built in fonts are good (well never really used them much, so don't really know).
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]