Does anyone have any tips for implementing the FreeType library into my OS? I'm planning to do this ASAP so I can get my GUI programming started (I can't start until I have text output). What sort of runtime is necessary? Will I need file i/o, if so what functions and how are they called?
And has anyone got any other method of printing text in graphics mode (short of getting the BIOS font)?
FreeType Tips?
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
I read up on the Borland stroked (*.CHR) font format and wrote a quick loader/renderer for it in my first graphics library.
You can probably find a few stroked fonts online (I believe I include some in my graphics library, actually), and there was also a stroked font creation app for DOS available back in the day.
These fonts aren't as configurable, or pretty, as true type fonts, but if you're looking to get something up and running quickly, these fonts are easy to parse and render (only about a hundred lines of code!).
Then, later, once you've got your APIs solidified, you can patch in the FreeType library.
If you want to take this approach, the source can be downloaded from http://www.neuraldk.org (the product is called Petal).
--Jeff
You can probably find a few stroked fonts online (I believe I include some in my graphics library, actually), and there was also a stroked font creation app for DOS available back in the day.
These fonts aren't as configurable, or pretty, as true type fonts, but if you're looking to get something up and running quickly, these fonts are easy to parse and render (only about a hundred lines of code!).
Then, later, once you've got your APIs solidified, you can patch in the FreeType library.
If you want to take this approach, the source can be downloaded from http://www.neuraldk.org (the product is called Petal).
--Jeff
If you can port something using SDL, then you're pretty much set. I found Sfont which has a C++ interface. There's no other libraries involved. Moreover, an even simpler library would be sdl_picofont. (Which would be the one I would suggest as the font is programmed right in the library.)
If you're set on freetype, however, the Design of freetype might be of some help.
If you're set on freetype, however, the Design of freetype might be of some help.
C8H10N4O2 | #446691 | Trust the nodes.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Wow, it is simple! And it's done in such a way that I can keep the font but take away the SDL part.Alboin wrote:even simpler library would be sdl_picofont.
Edit: I ported it to my OS by taking out the SDL references and rewriting the font renderer. It only took me about an hour, you just need to be able to plot pixels onto the screen.
So now I have 8-bit fonts in my OS GUI