[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Ugly font rendering?



Assuming that those actually *are* the same font (SysFont will fallback to the default font if the named font can't be found and loaded, for whatever reason), you may be seeing the lack of font hinting:
http://en.wikipedia.org/wiki/Font_hinting
 


the issue is the font you are trying to use (tahoma) was designed to be seen with font hinting on at small sizes (basically the designer nudged pixels around), but font hinting as used in true type fonts is a patented process, so much open source software (like free type) does not use it. There is auto-hinting, which is an algorithmically based replacement for the patented process, which I personally think works great, but it definitely produces different results than the nudging a designer would have done for the manual hinting.

you will probably be happiest with a font that was not created with hinting. The windows tahoma font definitely uses hinting (and is both not the same on all platforms and restricted by copyright from being redistributed).

...also, for what it's worth, the pygame part of the screenshot with anti-aliasing is the one that looks best and easiest to read to me. The photoshop one looks crowded and hard to read.


On Tue, Dec 22, 2009 at 10:36 AM, Frozenball <orkkiolento@xxxxxxxxx> wrote:
Hello,

For some odd reason the fonts in Pygame seem rather ugly. I have tried
different fonts with and without antialiasing but still they have
little pixel issues when rendered in small size while the fonts in
Photoshop/The GIMP/whatever are always sharp and good-looking.

Picture: http://img707.imageshack.us/img707/3601/fontsarebleedingmyeye.png
Code used:

self.font = pygame.font.SysFont("tahoma",10)
self.window.blit(self.font.render(self.title, 0, (255,255,255)),(5,3))

What I am doing wrong?

P.S. I'm not really used to mailing lists.