in reply to anti aliasing fonts

In the general case, no you can't anti alias a ttf font in advance. A ttf (True Type) font, is defined as a vector outline, so the font cannot contain an anti aliased form.

Anti aliasing happens when the font is rendered to a bitmap output device. The rendering process is specific to the output device, and depends on the resolution and greyscale depth of the output device. Typical anti aliasing is done for low resolution devices with high greyscale depth. (eg computer screens), but not for high resolution devices with low greyscale depth. (eg laser printers).

Having said all that, If you can explain in more detail what you are trying to do then there may be a solution. For example, on some systems, the font libraries will create and store a cache of font glyphs pre-rendered at common resolutions and grey-scale depths. There are probably ways to pre-populate that cache before it is used.

Replies are listed 'Best First'.
Re^2: anti aliasing fonts
by vishnu.prasad (Novice) on Jan 18, 2011 at 07:16 UTC
    i am generating a bitmap from the ttf file using freetype library. The generated bitmap is having greycale values but the rendered font has uneven greyscale even though it is anialiased. Say if it is the letter E then only some parts have a black bord since they have to be anti aliased but the others dont. I want it to look smooth wich it is now but i also want it to look uniform, which it is not.. Is there a solution??

      Details on how a font gliph gets rendered come from the font and your font rendering libary. There is a trade off between readability and aesthetics. In general on windows fonts are rendered for readability, but on Apple computers they are rendered for aesthetics. There are also features of the font that guide how it is rendered such as scaffolding and hinting.

      It sounds to me like you are on a windows computer and are not finding your screen beautiful enough. If you go to your local Apple store and give them $2000, they should be able to help you out. :-)

      Seriously, this question has nothing to do with perl and is out of scope for Perl Monks.

        i seriously doubt your claim that it has nothing to do with perl. With whatever searching i have done i was able to come across some perl modules that provide interfaces to freetype library. I was not able to get that module to work in my setup, which i am still trying to. Mean while i wanted to know whether perl has any built in modules or if anyone has tried out that using perl for any implementation which makes it relevant to perl and perlmonks. After all i was under the impression in perl community some one would have tried out something or the other which could be helpful to others. If you still maintain i quoted the question out of context forgive me because i am relatively new to perl programming.