GLBasic forum

Feature request => IDE/Syntax => Topic started by: S. P. Gardebiter on 2011-May-30

Title: Loadfont limit
Post by: S. P. Gardebiter 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?
Title: Re: Loadfont limit
Post by: Moru 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.
Title: Re: Loadfont limit
Post by: Schranz0r on 2011-May-30
You can use polyvector to do that?!
Title: Re: Loadfont limit
Post by: Kitty Hello on 2011-May-30
limit is 32.
Title: Re: Loadfont limit
Post by: S. P. Gardebiter 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:
Title: Re: Loadfont limit
Post by: Moru on 2011-May-30
Aw, the library is made to be used, you have all the source right there, nothing hidden.
Title: Re: Loadfont limit
Post by: Kitty Hello on 2011-May-30
There's no license issue with source code on our forums, is there?
Title: Re: Loadfont limit
Post by: Schranz0r on 2011-May-30
Quote from: Kitty Hello 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 :)
Title: Re: Loadfont limit
Post by: S. P. Gardebiter 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:
Title: Re: Loadfont limit
Post by: Slydog 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).