FreeType Tips?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pcmattman
Member
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:

FreeType Tips?

Post by pcmattman »

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)?
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post by carbonBased »

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
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

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.
C8H10N4O2 | #446691 | Trust the nodes.
pcmattman
Member
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:

Post by pcmattman »

Alboin wrote:even simpler library would be sdl_picofont.
Wow, it is simple! And it's done in such a way that I can keep the font but take away the SDL part.

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 :D
Post Reply