Re: FreeType

Brian Hook <[email protected]> Tue, 3 Jan 2006 02:16:48 -0500
Newsgroups gmane.games.devel.general
Message-ID <20061321648.268472@GATEWAY>
> I believe the problem you are seeing is that the fonts are small
> _and_ antialiased. 

Well, yeah.  But un-antialiased and they look bad, just in a different 
way =)

I ended up hacking a simple Python package that lets me render a 
string in a given font to a buffer, which I can then insert into a 
texture.  I don't have the higher level string caching in place, but 
so far the results are very promising in terms of quality.  The API is 
pretty brute force simple:

import winfont

f = winfont.createfont( 'Courier New', height=16,italic=True)
buf,w,h = f.render('Hello world!',(255,255,255),(64,64,64))
surf = pygame.image.fromstring( buf, w, h, "RGBX", True )
pygame.image.save( surf, 'test.tga')

I'll worry about the string caching and subtex modifications next and 
see if this is all everyone claims it is =)

Brian



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU7