Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

johnnyboy

Text "Anti-Alias" algorithm

This topic is 5705 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

Hi! Does anyone know of a ''good'' text-antialias algorithm? I think I know how to do it myself/am figuring it out, and am not sure if it would look something like say photoshop quality. Basically what I am thinking is this: 1) Create a mask (for the text) 2) Plop it on my background image 3) Do simple blurring for the surrounding pixels (i.e., (x,y),(x+1,y),(x,y+1),(x+1,y+1)). Is that basically what text ''anti-aliasing'' is? (I''m guessing that''s how it is done). Or is there either a sample algorithm somewhere, (or, sample source code?) Thanks!

Share this post


Link to post
Share on other sites
Advertisement
No, that''s merely careful blurring, which might well give you the result you want, but isn''t technically anti-aliasing. Anti-aliasing is about seeing how your drawing algorithms cause jaggies and compensating for that. Technically you''d use it when drawing a vector font to the screen, by calculating where the vector intersects each pixel.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
ok, thx Kylotan, but do you know where I can then find a sample/either
some math showing that, or a code sample, etc? I''ve looked,
but either not looking it the right places, or people just don''t seem
to talk much about that...

Share this post


Link to post
Share on other sites
quote:

Hi -- not a crosspost -- I just realized this may be a more
appropriate category. (If you want to delete the other one, that''s
ok).


OK, I cleared off the duplicates and moved your original thread. In the future you can simply email a moderator, if you feel that you posted in the wrong forum, instead of posting again. They will move your thread if it is justified.

Ontopic: As Kylotan said. Real antialiasing is done when a vectorfont is rendered. You can either ask the Windows API to do that when rendering a text, or you can use your own font renderer. The later one is very hard to write, so I would suggest using an existing package such as Freetype.

/ Yann

Share this post


Link to post
Share on other sites

  • 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!