Skip to main content
GameDev.net gamedev.net
🔒 Locked

scalable font solution?

Started by Captian Goatse Apr 24, 2004 at 2:47 AM 9 replies 2.4k views
Original Post
Captian Goatse
Captian Goatse
Has anyone figured out a scalable font solution? I tried to use 1024x1024 texture fonts and then scale it, however when i make it smaller (undr 1.0 in normal scale) it gets really, really fuzzy, I tried to solve the problem by using no mipmaps but it gets even worse. My text system is similiar to nehe''s lesson 17 except i create the font from freetype. Now has anyone figured out how to get best looking fonts with minumum amount of memory used?
666_1337
666_1337
use cubic splines.
our new version has many new and good features. sadly, the good nes are not new and the new nes are not good oo
benjamin bunny
benjamin bunny
quote:
I tried to use 1024x1024 texture fonts and then scale it, however when i make it smaller (undr 1.0 in normal scale) it gets really, really fuzzy, I tried to solve the problem by using no mipmaps but it gets even worse.

What minification filtering mode were you using? You should be using trilinear or anisotropic filtering.

quote:
Original post by 666_1337
use cubic splines.


Nobody really uses cubic splines for screen fonts. They''re always converted to bitmap fonts prior to rendering.

Captian Goatse
Captian Goatse
How exactly do you enable trilinear / anisotropic filtering? Are they driver options?

The texture looks just fine, the result is just smudgy.
Captian Goatse
Captian Goatse
Damn, I have done everything mentioned so far.

The scaled down 1024x1024 font looks like it had anti-aliasing although it doesn''t and shouldn''t (i prefer my text sharp) the smaller 256x256 font just looks better, however scaling it is impossible.
Captian Goatse
Captian Goatse
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);

gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pBitmap[0]->w,
pBitmap[0]->h,
GL_RGB,
GL_UNSIGNED_BYTE,
pixels);


This is what I use to build the font.

The small font is simply sharp and good looking, the way I wish the big font would look. However it is kind of antialiased, which I don''t want.
666_1337
666_1337
try this one:

glTexParameterf(GL_TEXTURE_2D, TEXTURE_MAX_ANISOTROPY_EXT, 8.0f);

quote:
Original post by benjamin bunny
Nobody really uses cubic splines for screen fonts. They''re always converted to bitmap fonts prior to rendering.


I meant he shall store the splines and convert them into rastergraphics during his programm loads. it''s always better storing ... say 1000 controll points than 10 different-sized bitmaps to have 10 different font sizes.
our new version has many new and good features. sadly, the good nes are not new and the new nes are not good oo
Captian Goatse
Captian Goatse
quote:
Original post by 666_1337
try this one:

glTexParameterf(GL_TEXTURE_2D, TEXTURE_MAX_ANISOTROPY_EXT, 8.0f);

quote:
Original post by benjamin bunny
Nobody really uses cubic splines for screen fonts. They're always converted to bitmap fonts prior to rendering.


I meant he shall store the splines and convert them into rastergraphics during his programm loads. it's always better storing ... say 1000 controll points than 10 different-sized bitmaps to have 10 different font sizes.


That spline technique seems too complicated for my purposes.
That MAX_ANISOTROPY_EXT works decently. it is still little fudgy(anti-aliased), but it removed most of the irregularities.

How widely supported is this ext?

[edited by - captian goatse on April 24, 2004 8:40:13 AM]
_the_phantom_
_the_phantom_
should be on most cards, however its best to check it exists AND its best to test for the max aniotropy level, as i''mnot sure what would happen if you request a level the card cant do (also the higher the level the more work the card has to do)
666_1337
666_1337
quote:
Original post by _the_phantom_
should be on most cards, however its best to check it exists AND its best to test for the max aniotropy level, as i''mnot sure what would happen if you request a level the card cant do (also the higher the level the more work the card has to do)


it will activate the highest posible level of anisotrophy. at least my geforce fx does that, if i set it to a value too high.
our new version has many new and good features. sadly, the good nes are not new and the new nes are not good oo

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.