Pyggles should render non-ASCII glyphs from Unicode fonts

Issue #2 new
Peter Hansen
repo owner created an issue

The font support comes from generic bbutil.c in RIM's samples, and that preloads chars only up to code 127. I've thrown in a quick proof-of-concept with a "litre" symbol (\u2113) to prove that the FreeType stuff handles it okay, so we just need something less simplistic than what's there now.

Initially I envision something that reserves space for additional glyphs, and just loads them dynamically (caching them) into the texture (subtexture images) as it encounters them in the input. Haven't really thought much about it yet.

Comments (1)

  1. Peter Hansen reporter

    Having spent quite some time on this area in the last week, refactoring much of the font stuff so more of it's done in Python (and to make it able to handle more than one context, etc) I can say that my initial thought should work fine. The fonts are rendered from a texture which basically is a big rectangle containing bitmaps for each of the glyphs, and although it's currently 32x16 (for 128 glyphs) there's no reason it can't be made bigger. Space could be reserved and new glyphs could be added on-the-fly using glTexSubImage2D(). Just needs someone who actually needs this, and a bit of coding.

  2. Log in to comment