summaryrefslogtreecommitdiff
path: root/gnu/java/awt/font/opentype
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/awt/font/opentype')
-rw-r--r--gnu/java/awt/font/opentype/CharGlyphMap.java2
-rw-r--r--gnu/java/awt/font/opentype/OpenTypeFont.java17
-rw-r--r--gnu/java/awt/font/opentype/Scaler.java12
-rw-r--r--gnu/java/awt/font/opentype/truetype/GlyphLoader.java5
-rw-r--r--gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java6
-rw-r--r--gnu/java/awt/font/opentype/truetype/Zone.java2
6 files changed, 41 insertions, 3 deletions
diff --git a/gnu/java/awt/font/opentype/CharGlyphMap.java b/gnu/java/awt/font/opentype/CharGlyphMap.java
index 6ada3b147..184075094 100644
--- a/gnu/java/awt/font/opentype/CharGlyphMap.java
+++ b/gnu/java/awt/font/opentype/CharGlyphMap.java
@@ -61,7 +61,7 @@ import java.nio.IntBuffer;
*
* @author Sascha Brawer (brawer@dandelis.ch)
*/
-abstract class CharGlyphMap
+public abstract class CharGlyphMap
{
private static final int PLATFORM_UNICODE = 0;
private static final int PLATFORM_MACINTOSH = 1;
diff --git a/gnu/java/awt/font/opentype/OpenTypeFont.java b/gnu/java/awt/font/opentype/OpenTypeFont.java
index 9ee28d76b..efc30811f 100644
--- a/gnu/java/awt/font/opentype/OpenTypeFont.java
+++ b/gnu/java/awt/font/opentype/OpenTypeFont.java
@@ -52,6 +52,7 @@ import java.util.Locale;
import gnu.java.awt.font.FontDelegate;
import gnu.java.awt.font.GNUGlyphVector;
import gnu.java.awt.font.opentype.truetype.TrueTypeScaler;
+import gnu.java.awt.font.opentype.truetype.Zone;
/**
@@ -117,7 +118,7 @@ public final class OpenTypeFont
* OpenType fonts with PostScript outlines, other values are
* acceptable (such as 1000).
*/
- private int unitsPerEm;
+ public int unitsPerEm;
/**
@@ -697,6 +698,20 @@ public final class OpenTypeFont
antialias, fractionalMetrics);
}
+ /**
+ * Fetches the raw glyph outline for the specified glyph index. This is used
+ * for the autofitter only ATM and is otherwise not usable for outside code.
+ *
+ * @param glyph the glyph index to fetch
+ * @param transform the transform to apply
+ *
+ * @return the raw outline of that glyph
+ */
+ public synchronized Zone getRawGlyphOutline(int glyph,
+ AffineTransform transform)
+ {
+ return scaler.getRawOutline(glyph, transform);
+ }
/**
* Returns a name for the specified glyph. This is useful for
diff --git a/gnu/java/awt/font/opentype/Scaler.java b/gnu/java/awt/font/opentype/Scaler.java
index 499c3ea52..83a31c576 100644
--- a/gnu/java/awt/font/opentype/Scaler.java
+++ b/gnu/java/awt/font/opentype/Scaler.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package gnu.java.awt.font.opentype;
+import gnu.java.awt.font.opentype.truetype.Zone;
+
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
@@ -189,4 +191,14 @@ public abstract class Scaler
boolean antialiased,
boolean fractionalMetrics,
boolean horizontal);
+
+ /**
+ * Returns the raw outline data. This is used for the autofitter atm.
+ *
+ * @param glyph the glyph index
+ * @param transform the transform to apply
+ *
+ * @return the raw glyph outline
+ */
+ public abstract Zone getRawOutline(int glyph, AffineTransform transform);
}
diff --git a/gnu/java/awt/font/opentype/truetype/GlyphLoader.java b/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
index b12d7782b..3733afe92 100644
--- a/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
+++ b/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
@@ -119,6 +119,11 @@ final class GlyphLoader
0, 0);
}
+ public void loadGlyph(int glyphIndex, AffineTransform transform,
+ Zone glyphZone)
+ {
+ loadGlyph(glyphIndex, unitsPerEm, transform, false, glyphZone);
+ }
private void loadSubGlyph(int glyphIndex,
double pointSize,
diff --git a/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java b/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
index e4d7309cb..8dfdeff07 100644
--- a/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
+++ b/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
@@ -198,6 +198,12 @@ public final class TrueTypeScaler
return glyphZone.getPath();
}
+ public Zone getRawOutline(int glyphIndex, AffineTransform transform)
+ {
+ Zone zone = new Zone(glyphZone.getCapacity());
+ glyphLoader.loadGlyph(glyphIndex, transform, zone);
+ return zone;
+ }
/**
* Determines the advance width and height for a glyph.
diff --git a/gnu/java/awt/font/opentype/truetype/Zone.java b/gnu/java/awt/font/opentype/truetype/Zone.java
index c0a3947f6..ff5bb6316 100644
--- a/gnu/java/awt/font/opentype/truetype/Zone.java
+++ b/gnu/java/awt/font/opentype/truetype/Zone.java
@@ -45,7 +45,7 @@ import java.awt.geom.PathIterator;
/**
* A collection of points with some additional information.
*/
-final class Zone
+public final class Zone
{
private final int[] pos;
private final int[] origPos;