Ftgl

Member
Posts: 33
Joined: 2002.04
Post: #1
I've been playing around with FTGL and I'm hoping you guys could give me a few pointers.

Bitmaps can be colored but not anti-aliased.
Pixmaps can not be colored but are anti-aliased.

What about the others? Why would I pick any one above the others?

And is there something special about textures? When I switch to them in the demo it crashes.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
My personal experience has been that texture fonts are best if you have plenty of VRAM available and are low on transform rate, and polygon fonts are best if you have plenty of transform rate but are low on VRAM. Those two seem to give the best flexibility. They also tend to look better/worse than each other in different situations.

What OS / version of FTGL / version of FreeType are you running that the texture font crashes?
Quote this message in a reply
Member
Posts: 33
Joined: 2002.04
Post: #3
It was just a low memory thing...I pumped up the PPC target and it works fine. Makes sense now with what you say about textures.

As cool as ftgl seems, I think i've made every mistake possible while getting it to work.
Quote this message in a reply
henryj
Unregistered
 
Post: #4
The crash is a bit of a worry. Could you send me a stack trace and I'll try and track it down. Texture fonts only allocate 1 meg at a time which shouldn't be a big deal.

The font type you use is dependent on your application.
Bitmaps are the fastest and use the least memory but the quality is low. They can't be transformed either.
Pixmaps are excellent quality but you can't transform them. The colour is set when the glyph is created which can be a bit tricky.
Texture fonts are as good a quality as Pixmap fonts but if you have limited vram they can be a bit slow. If you have bucket loads of vram they will probably be the fastest. They can also be transformed. They can be a bit tricky to use because most people scale them up too much making them look crap.

The vector fonts, Outline, polygon and extruded, are good if you have a good geometry engine and are texture limited. The down side is the quality. Apart from the outline font they can't be anti aliased, and no, fullscreen anti aliasing doesn't make it any better. Some tesselators don't handle asian fonts too well though the OSX one seems fine.
Quote this message in a reply
Member
Posts: 33
Joined: 2002.04
Post: #5
Before I put a breakpoint at case FTGL_TEXTURE in do_display() and stepped it down ...

it crashed on fonts[current_font]->render(myString);

This was on OS 9 and the memory was set pretty low...somewhere around a meg or two.

Now I can't seem to reproduce it though. Maybe I'm wrong and it wasn't exactly a crash...just quitting because there wasn't enough memory.

The only reason it came up I'm betting is because I had to make the CW project myself and still don't know exactly what I'm doing.

sorry if this doesn't exactly help...maybe you could just throw in a CW project for the demo and this wouldn't even be an issue.
Quote this message in a reply
henryj
Unregistered
 
Post: #6
I don't have code warrior any more so I haven't been able to keep the project up to date sorry. I'm looking for volunteers to keep it updated.
Quote this message in a reply
Member
Posts: 33
Joined: 2002.04
Post: #7
I could send you the codewarrior project once I clean it up a bit.

I'm finally starting to understand how the demo is set up and the conversion between opengl screen units and the BBox() function.

However my other code is set up using a different Projection matrix and I'm having trouble getting both to show up at the same time.

Is it possible to use two Projection matricies like...

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(...)
gluPerspective()

glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

draw my 3d stuff

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho2D(...)

glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

draw pixmap fonts
Quote this message in a reply
henryj
Unregistered
 
Post: #8
Yep, that's not a problem, I do it all the time.


You don't have to use the projection set up in the demo. Feel free to change it. See if you can get it to work using your own projection.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How do I flip upside down fonts in FTGL mr5z 4 513 Mar 3, 2014 03:36 PM
Last Post: JustinFic
  Xcode and FTGL hiddenspring81 7 5,418 Oct 10, 2013 03:00 PM
Last Post: ardowz
  Anyone run into this problem with FTGL? wadesworld 1 2,900 Apr 21, 2009 02:19 PM
Last Post: Oddity007
  FTGL crash when exiting program Malarkey 8 4,997 Mar 27, 2008 03:33 PM
Last Post: Malarkey
  More Freetype/FTGL trouble Fenris 33 16,394 Sep 15, 2006 06:27 AM
Last Post: TomorrowPlusX