X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fgraphics%2FFont.java;fp=src%2Forg%2Fibex%2Fgraphics%2FFont.java;h=9870aa69faddba415f4e70d0bac3f00d55a3c44f;hp=2b8b13cdca0f92feb663aa29e999f9b74e87feb6;hb=5f0b1c28e1c93b3fc14236fa9eb9742aa3304377;hpb=c8598d51fe71ce77d466c02b6fa264617be9335b diff --git a/src/org/ibex/graphics/Font.java b/src/org/ibex/graphics/Font.java index 2b8b13c..9870aa6 100644 --- a/src/org/ibex/graphics/Font.java +++ b/src/org/ibex/graphics/Font.java @@ -21,7 +21,7 @@ public class Font { public int max_ascent; ///< the maximum ascent, in pixels public int max_descent; ///< the maximum descent, in pixels boolean latinCharsPreloaded = false; ///< true if a request to preload ASCII 32-127 has begun - Glyph[] glyphs = new Glyph[65535]; ///< the glyphs that comprise this font + public Glyph[] glyphs = new Glyph[65535]; ///< the glyphs that comprise this font public abstract static class Glyph { protected Glyph(Font font, char c) { this.font = font; this.c = c; } @@ -33,6 +33,7 @@ public class Font { public int width = -1; ///< the width of the glyph public int height = -1; ///< the height of the glyph public byte[] data = null; ///< the alpha channel samples for this font + public String path = null; // FIXME this should be shared across point sizes void render() { if (!isLoaded) try { renderGlyph(this); } catch (IOException e) { Log.info(Font.class, e); } isLoaded = true; @@ -167,11 +168,16 @@ public class Font { glyph.width = rt.getUserInfo(1); glyph.height = rt.getUserInfo(2); - + glyph.data = new byte[glyph.width * glyph.height]; int addr = rt.getUserInfo(0); rt.copyin(addr, glyph.data, glyph.width * glyph.height); + byte[] path = new byte[rt.getUserInfo(8)]; + rt.copyin(rt.getUserInfo(7), path, rt.getUserInfo(8)); + glyph.path = new String(path); + glyph.path += " m " + (64 * glyph.advance) + " 0 "; + glyph.isLoaded = true; } catch (Exception e) { // FEATURE: Better error reporting (thow an exception?)