Re: [PyOpenGL-Users] Re: Re: any font fns on the horizon? (in Linux)
Brought to you by:
mcfletch
From: <mi...@na...> - 2003-09-21 19:03:12
|
On Sun, Sep 21, 2003 at 01:43:58PM -0400, Maciej Kalisiak wrote: > On Sun, Sep 21, 2003 at 03:09:46AM -0400, mi...@na... wrote: > > On Sun, Sep 21, 2003 at 12:06:54AM -0400, Maciej Kalisiak wrote: > > > I would encourage you strongly to refactor this a bit, to make it a > > > separate, stand-alone package, since it seems terribly useful and quite > > > robust. It seems like little work. Not only separate it from BZEngine, > > > but hopefully from pygame as well, to give it the largest application > > > > Patches welcome :) > > Heh. I won't have the time to do a complete, nicely polished package, > but perhaps the stuff I do for my own project might be of use to whoever > decides to go all the way. Is GLText.py code fairly stable now, or > does it still change quite a bit. It still needs better Unicode support (for example, searching for missing glyphs in other fonts) but aside from that and some polishing I think it's pretty much done. > > > Hinting is the process of tweaking a font's rendering a bit so stems of > > Ah, thanks. What is "escapement" then? Is it just the width of a > glyph? Oop, forgot that one. Escapement is a vector added to the 'pen' location when the glyph is drawn. Usually the x component is the 'width' and the y is zero. It's important to make a distinction between the escapement and the glyph width though, since there may be extra space between characters or there might be overlap. Then this leads into kerning... I'm no font guru, I've just used freetype a good bit and have read their documentation ;) > > > > I'm not too familiar with fonts in pygame, but my understanding is that > > > it only handles truetype fonts at the moment. Do you know if adding > > > support for general X11 fonts is in the plans, or even how hard a task > > > that is? (Murphy's Law says that soon enough I'll find that I must have > > > a given font, and it won't be .ttf... :) > > > > Well, GLText uses pygame's font capabilities, which is just a python binding > > for SDL_ttf. SDL_ttf is a simple wrapper for freetype, so it will handle any > > font format freetype can. This includes truetype, Postscript Type1, .pcf, > > windows fonts, and probably more. > > Oh. So I just have to pass it the full path to a .pcf file? Just tried > it; cool! Although when I tried it with helvetica, it seems it lacks > metrics on ascenders because all the letters don't line up on the > baseline, but are flushed to the top of the bounding box. Does this > sounds like a GLText.py bug or something upstream in SDL_ttf? I'd guess something in SDL_ttf. I've dealt with bitmapped fonts in .pcf files before in a freetype-based font engine I wrote a while ago. Freetype handled them fine. SDL_ttf hides all the metrics from GLText. > > > The downside of using SDL_ttf is that it hides most of the glyph metrics stored > > in the original font. The glyphs GLText stores will be padded to the font's > > line height rather than stored in tightly fitting bounding boxes. > > Hmm, basically sounds like helvetica is NOT padded. I also tried "modd" > font (character cell), and those were lined up. I guess the problem > is only with proportional fonts (Utopia had the problem as well). I > suppose it's not a big deal though.. these bitmapped fonts don't look > nearly as nice as the scalable ones. SDL_ttf probably wasn't written with bitmapped fonts in mind. When such high quality free truetype fonts exist, there's no reason to use X's fonts. Bitstream Vera looks beautiful and is OSS-friendly. Before Vera was released, I had been using some fairly nice fonts from the OpenOffice and Ghostscript projects. --Micah > > -- > "In a time of universal deceit, telling the truth is a revolutionary act." > -- George Orwell > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |