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

Re: [pygame] freetype + unusual font format: What am I doing wrong?



I've added a note to Pygame issue #75 to add a Font.get_sizes() method to list available sizes for a bitmap font.

Lenard Lindstrom

On 13-10-08 06:42 PM, Jason Marshall wrote:
Thanks for digging into this. If multiplying the em width by 2 // 3 is the most difficult step in using a bitmap font with pygame, then I'm happy!

Jason

------------------------------------------------------------------------
*From:* Lenard Lindstrom <len-l@xxxxxxxxx>
*To:* pygame-users@xxxxxxxx
*Sent:* Tuesday, October 8, 2013 12:32 AM
*Subject:* Re: [pygame] freetype + unusual font format: What am I doing wrong?

I looked at the BDF code in freetype2, and then ran a debugger on
pygame.freetype to confirm. In freetype2, when only a "SIZE" record in a
BDF file, the width, in pixels-per-em, is calculated as (height * 2 / 3)
[1], which may not be the point size given in the "SIZE" record. For
c64.dbf this is (8 * 2 / 3) = 5. The width is used as the font size.
This is a quirk of the freetype library. I see no easy work-around.

Lenard Lindstrom

[1] bdfdrivr.c:438, see
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/bdf/bdfdrivr.c?id=VER-2-5-0-1#n438