Jump to content
  • Advertisement
Sign in to follow this  
rein

OpenGL An Ultimate Font library? help please

This topic is 3611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think my head is going to blow up now. I've spent several days trying to find a reasonable TTF Bitmap generated-at-startup font library for OpenGL. What I seek is a library that will create a font from a given .ttf file and draw it as quads (or any other faster method) - both aliased and antialiased - that will look EXACTLY like on Windows. I don't want anything pregenerated in separate files and I don't use SDL. Let me share my findings: - Nehe Lesson #13 and wglUseFontBitmaps - precise, but no antialiasing and slow - FreeType2 - forced antialiasing (I've found of no working way to disable it) and unclear small fonts + the output differs from windows rendering - OGLFT, GLTT, FTGL and others - all share the above flaws the only technique I can think of is to somehow draw a certain font on a bitmap using GDI and then convert it to gl texture, storing all glyph metrics. But I'm green when it comes to windows-specific programming so I have actually no idea where to even begin I mean, on DirectX AFAIK it was easy as pie, there were no surprises. come on, isn't there a single polished library that will save me all the trouble? I was stuck on this one 10 years ago and after all this time, still I must deal with such tedious task, while there are tons of new stuff waiting to be leanrt :(

Share this post


Link to post
Share on other sites
Advertisement
Erm. If you don't mind me asking... why?

You surely have no way of knowing whether a user has ClearType on or off, and therefore you can't know whether your font will look "exactly" the same anyway, no?

Share this post


Link to post
Share on other sites
I'm sorry, what I meant was not imitating actual user settings but only the pixel precision of the letters displayed in comparison to adequate rendering style (bolded, cleartype, italic) in Windows GDI.

I just noticed, that in nearly all libraries (mostly freetype2) output text of the same size, font and style looks a bit different than the same text in web browser, or notepad (like Verdana, size 9 for example - some letters have pixels in different places, letter spacing is off by a pixel here and there, some symbols semm to be truncated for example, or look wider than in GDI counterpart)


Kambiz:
but that requires me to pregenerate a file with glyphs and metrics and ship it with my program, right? what if I want the user to have the freedom to choose a font of his liking (i.e. by supplying his own .ttf file) ?
or you suggest reverse engineering this program? In that case, I'm afraid I'm not skilled to do that yet :/

Share this post


Link to post
Share on other sites
heh few days wasted and now, after my act of desperation I've just stumbled upon exactly what I was looking for:

http://www.devmaster.net/forums/showthread.php?t=7991

I've quicktested it and voilla! it renders precisely the same image as GDI (now wonders if it's gdi based). I've yet to decipher the antialiasing and benchmark it

have any of you used this library ?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!