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; }
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;
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?)