projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
freetype curve extraction in Font.java and readback in Box.java
[org.ibex.core.git]
/
src
/
org
/
ibex
/
graphics
/
Font.java
diff --git
a/src/org/ibex/graphics/Font.java
b/src/org/ibex/graphics/Font.java
index
2b8b13c
..
9870aa6
100644
(file)
--- 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
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 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 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;
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.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);
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?)
glyph.isLoaded = true;
} catch (Exception e) {
// FEATURE: Better error reporting (thow an exception?)