Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Glyph Keeper - a text rendering library

This thread is locked; no one can reply to it. rss feed Print
Glyph Keeper - a text rendering library
Kirr
Member #5,060
September 2004
avatar

Glyph Keeper is a text rendering library for Allegro. Essentially it is a FreeType wrapper with effecient glyph caching and fast drawing code. Now that AllegTTF and AllegroFont are not updated for some years, it seemed a time for some next step.

Glyph Keeper is still in the early stage. API will probably have some changes in near future. Gradually I will also add documentation and examples. Currently you have to guess how to use it by reading a header file (or source to understand what it does).

I will appreciate any feedback about the design and API of Glyph Keeper (although still undocumented, I know). It would be also nice if you just try using it and report any problems, or successful story as well. Bug-reports are of course welcome.

Happy coding! Here you find it:
http://kd.lab.nig.ac.jp/glyph-keeper/

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

Mark Oates
Member #1,146
March 2001
avatar

yay! I'd like fast anti-aliased text... and all the usual stuff.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Inphernic
Member #1,111
March 2001

Good news, thanks. I'll try it out when I have some spare time on my hands.

Torbjörn Josefsson
Member #1,048
September 2000
avatar

Something that many seem to need: A text engine that can draw Outlines around the letters.. would really be Da Bomb if your thing could do that :)

--
Specialization is for insects

Kirr
Member #5,060
September 2004
avatar

Quote:

Good news, thanks. I'll try it out when I have some spare time on my hands.

Great, thanks, I'm waiting to hear about your experience.

Quote:

Something that many seem to need: A text engine that can draw Outlines around the letters.. would really be Da Bomb if your thing could do that

Thanks for suggestion! Actually it was already on Glyph Keeper 2.0 to do list. After v1.0 is out I will start thinking how to do it. Of course, if you will contribute a good idea on doing that, it may come true a bit faster. :)
(Glyph Keeper to do list is here: http://kd.lab.nig.ac.jp/glyph-keeper/future.html )

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

gnolam
Member #2,030
March 2002
avatar

Nice! Maybe I won't have to wade through raw FreeType now then :)
I'll have to check it out when I get some free time later tonight...

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Steve Terry
Member #1,989
March 2002
avatar

Kirr: I wish you the best of luck with your lib, we could use a freetype lib with those capabilities you plan on supporting.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Trezker
Member #1,739
December 2001
avatar

Sweet, I'll have to take a look at this some day.
(I have to get myself broadband)

Kirr
Member #5,060
September 2004
avatar

Quote:

Nice! Maybe I won't have to wade through raw FreeType now then :)
I'll have to check it out when I get some free time later tonight...

I hope so. :-)

Quote:

Белая армия, чёрный барoн \ Снoва гoтoвят нам царский трoн, \ Нo oт тайги дo британских мoрей \ Красная Армия всех сильней

:-) :-))))))

Quote:

Kirr: I wish you the best of luck with your lib, we could use a freetype lib with those capabilities you plan on supporting.

Sure, no problem. If you just mind that 1. Using Glyph Keeper is using FreeType. 2. FreeType does not do glyph caching in a way Glyph Keeper does. 3. FreeType can't render to Allegro BITMAP, not to mention transparent rendering, and doing it fast. You will have to write code to do it. 4. Using FreeType directly turns your program to a hairy mess, unless you write your own wrapper.
Saying all that, I should add that actually FreeType really rocks, it is amazing work, generously provided for free for all of us.

Quote:

Sweet, I'll have to take a look at this some day.

I hope it can fit your needs.

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

gnolam
Member #2,030
March 2002
avatar

Ok, had time to download and test it a bit. Here's a few quick and random thoughts:

  • License

  • Documentation

  • Build process

  • Output

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Daniel Schlyder
Member #257
April 2000
avatar

Looks very cool. What about OpenGL / AllegroGL support?

Kirr
Member #5,060
September 2004
avatar

gnolam
First, thanks for trying, and I'm glad you could see some text!

Quote:

Documentation is sorely lacking - a library like this should have at least a simple readme with build installation instructions and an API summary. Having to read through the source will scare off a lot of people.

Right, documentation should be the next thing to come. It's great you could use Glyph Keeper without it :)

Quote:

Second, this would definitely be better off as a library (hopefully with the build automated by a makefile)

I'm not sure what means "as a library" - Glyph Keeper is a library. Do you mean making something like 'libglyph.a' file? Compiled Glyph Keeper is just one object file, but if you prefer .a (or .lib) for some reason it's OK, I can do a makefile for that. OK, next version will have some makefile at least.

Quote:

I couldn't get it to compile on its own.

Currently it is not supposed to compile on its own, it needs FreeType and Allegro installed. Do you mean it's better to bundle FreeType with Glyph Keeper? AllegTTF and AllegroFont are both doing that. But I'm not sure if it is a good idea: 1. You may want to use newer FreeType, or the one you already have installed on your system. 2. FreeType itself is very easy to compile, and it already has a bunch of makefiles. 3. You may prefer to use FreeType DLL, while Glyph Keeper seems more suitable for static linking.
But you are right, that could make it easier to compile/install. OK, I am still thinking which way is better. :)

Daniel Schlyder

Quote:

Looks very cool. What about OpenGL / AllegroGL support?

OpenGL would be surely nice to have. My plan is to first finish SDL port of Glyph Keeper, then I will think about OpenGL / other targets. Actually it might be better if someone more familiar with OpenGL did it. It's easy. For adding each new target you only need to implement one function - put_glyph(). One day there will be a Glyph Keeper porting manual, but for now you have to to read existing Allegro-specific put_glyph() and just do similar things with OpenGL.

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

gnolam
Member #2,030
March 2002
avatar

Err, expressed myself a bit badly before.

Quote:

I'm not sure what means "as a library" - Glyph Keeper is a library. Do you mean making something like 'libglyph.a' file? Compiled Glyph Keeper is just one object file, but if you prefer .a (or .lib) for some reason it's OK, I can do a makefile for that. OK, next version will have some makefile at least.

Yeah, that was basically what I meant. And...

Quote:

Currently it is not supposed to compile on its own, it needs FreeType and Allegro installed. Do you mean it's better to bundle FreeType with Glyph Keeper?

No, I meant I couldn't compile glyph keeper it as a stand-alone object file, only together with the rest of my project (got some rather strange errors) - had I been able to do so I could probably just have ar:ed it myself. :)
Both Freetype and Allegro are quite exemplary when it comes to building and installing, and they both get updated pretty often, so keep them separate :)

I'll have to look into why I couldn't compile glyph keeper properly...

[EDIT]
Argh! It really does compile on its own, unless you do silly typos on the command line ;)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Kirr
Member #5,060
September 2004
avatar

Glyph Keeper 0.16 is ready, with improved rendering speed and one bugfix. Also, web-site now has some documentation, I will add more in a few days.
Good luck!

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

Go to: