Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » OpenGL text rendering library

This thread is locked; no one can reply to it. rss feed Print
OpenGL text rendering library
gnolam
Member #2,030
March 2002
avatar

As it looks like I might finally have some spare time coming up, I thought I'd start working on my (AllegroGL) projects again. However, I need a decent text rendering library to proceed.

I need at least:

  • printf() equivalent functionality.

  • Text justification.

  • Unicode (UTF-8) support.

  • TTF support.

</li>

AllegroGL's built-in text functionality doesn't handle justification (and I haven't managed to wrangle it to do Unicode either) and Glyph keeper had no official support for OpenGL last I checked (which is right before it was left to bit rot). So what else is out there?

[EDIT]
Added the cross-platform requirement I forgot earlier.

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

kikabo
Member #3,679
July 2003
avatar

Fudgefont if your on linux, I had trouble with building on mingw. I don't know if it meets all of your requirements but must be worth a look.

gnolam
Member #2,030
March 2002
avatar

And of course, it comes with a non-make own build system and Yet Another Dependency (and LF endings in the Readmes). sigh
I'll try to check it out and report back. :P

[EDIT]
Nope. No dice. Didn't manage to compile it.

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

kikabo
Member #3,679
July 2003
avatar

Quote:

Nope. No dice. Didn't manage to compile it.

Well, that makes me feel better then.

It's a shame because it looks really useful, I did mean to write a makefile, someone must really hate make to use python as a build system which is only likely to work on systems where make would have worked anyway ...

Richard Phipps
Member #1,632
November 2001
avatar

Gnolam:

Fix GlyphKeeper, or FreeType in OpenLayer for us. ;)

gnolam
Member #2,030
March 2002
avatar

Quote:

Fix GlyphKeeper

I have neither the time nor will to fix a library whose internals I'm unfamiliar with.

Quote:

FreeType in OpenLayer

I don't use it.

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

You could just rip the text rendering methods if you wanted...

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

kikabo
Member #3,679
July 2003
avatar

well I fudged :) a makefile just to link the examples locally but with mixed results :(

...oh, I had to change include <> to include "" and add END_OF_MAIN() to examples 2 and 3

1# make gl=1 == build allegrogl examples
2 
3cc=gcc
4CFLAGS=-Wall -Isrc -fomit-frame-pointer -O2 -ffast-math -funroll-loops
5 
6OBJDIR = build/shared/release
7 
8 
9ifdef MINGDIR
10 
11 ifdef gl
12 CFLAGS=-DALLEGROGL
13 LDFLAGS=-lagl -lopengl32 -lglu32
14 suffix=_gl
15 endif
16 
17 LDFLAGS+=-lm -mwindows -Wl,--subsystem,windows -lalleg -luser32 -lgdi32 -lfreetype
18 ext=.exe
19else
20 
21 ifdef gl
22 CFLAGS=-DALLEGROGL
23 LDFLAGS=-lagl -lGL -lGLU
24 endif
25 
26 LDFLAGS+=-lm `allegro-config --libs` `freetype-config --libs`
27 CFLAGS+=`freetype-config --cflags`
28endif
29 
30FILES = example1.c example2.c example3.c
31EXBINS = $(addprefix src/, $(addsuffix $(suffix)$(ext), $(basename $(FILES))))
32EXOBJS = $(addprefix $(OBJDIR)/, $(addsuffix $(suffix).o, $(basename $(FILES))))
33LIB = $(OBJDIR)/fudgefont.o
34 
35all: library examples
36 
37library: $(LIB)
38 
39examples: $(EXBINS)
40 
41$(BINARY) : $(OBJS)
42 $(cc) -o $(BINARY) $(OBJS) $(LDFLAGS)
43 
44src/example%$(ext) : $(OBJDIR)/example%.o
45 $(cc) -o $@ $(LIB) $< $(LDFLAGS)
46 
47$(EXBINS) : $(EXOBJS)
48 
49 
50$(OBJDIR)/%$(suffix).o: src/%.c
51 $(cc) $(CFLAGS) -Isrc -c $< -o $@
52 
53clean:
54 del $(OBJDIR)/*.*
55

Go to: