Text gets messy when scale decreased.

Started by
2 comments, last by Paulpetk123 8 years, 1 month ago

Hey, I'm using my own text library and I came over this bug :

http://imgur.com/dLu1PLM Does anybody know what happened and how to fix it? Thanks :)

Advertisement
You need to generate mipmaps for your text image. I told you that yesterday, but if you still don't know why, read up on mipmaps:
https://en.m.wikipedia.org/wiki/Mipmap
The problem that you are seeing is a common problem in font rendering. Its difficult to find a way to render text on a variety of scales. This is where you might want to do one of a couple things. First like I mentioned above, easiest is just generate mipmaps for the different scales. You'll have better quality mipmaps if you generate them yourself, but directx 11 has a function to automatically generate them I think.

Use truetype fonts instead of bitmaps. TrueType fonts contain vectors and curve data, so it always looks the same no matter how big or small it is.

You could use directwrite to render font, which I believe has a built in TrueType font format reader.

if you want to spend the time, make your text renderer able to read and render truetype font. This is not the easiest thing to do though, there are a lot of different ways to go about rendering true type font.

I fixed my problem by adding really beautiful font rendering technique. So now I can make good small texts and really beautiful large texts : http://imgur.com/IFZNlSJ You can implement that font rendering technique by following this video :

It's java/opengl tutorial, but it's easy to implement in C++/D3D11 and others. You can add some effects to the text.

This topic is closed to new replies.

Advertisement