diff options
Diffstat (limited to 'src/java/org/apache/fop/fonts/CustomFont.java')
-rw-r--r-- | src/java/org/apache/fop/fonts/CustomFont.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java index 4cf24ae16..c3687a94e 100644 --- a/src/java/org/apache/fop/fonts/CustomFont.java +++ b/src/java/org/apache/fop/fonts/CustomFont.java @@ -59,6 +59,9 @@ public abstract class CustomFont extends Typeface private boolean useKerning = true; + /** the character map, mapping Unicode ranges to glyph indices. */ + protected BFEntry[] cmap; + /** {@inheritDoc} */ public String getFontName() { return fontName; @@ -454,4 +457,25 @@ public abstract class CustomFont extends Typeface } } + /** + * Sets the identity character map for this font. It maps all available Unicode characters + * to their glyph indices inside the font. + * @param cmap the identity character map + */ + public void setCMap(BFEntry[] cmap) { + this.cmap = new BFEntry[cmap.length]; + System.arraycopy(cmap, 0, this.cmap, 0, cmap.length); + } + + /** + * Returns the identity character map for this font. It maps all available Unicode characters + * to their glyph indices inside the font. + * @return the identity character map + */ + public BFEntry[] getCMap() { + BFEntry[] copy = new BFEntry[cmap.length]; + System.arraycopy(this.cmap, 0, copy, 0, this.cmap.length); + return copy; + } + } |