diff options
Diffstat (limited to 'src/java/org/apache/fop/fonts/CustomFont.java')
-rw-r--r-- | src/java/org/apache/fop/fonts/CustomFont.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java index f165fbd67..0ac3b80bc 100644 --- a/src/java/org/apache/fop/fonts/CustomFont.java +++ b/src/java/org/apache/fop/fonts/CustomFont.java @@ -230,9 +230,7 @@ public abstract class CustomFont extends Typeface * @return the index of the first character */ public int getFirstChar() { - return 0; - // return firstChar; - /**(todo) Why is this hardcoded??? This code was in SingleByteFont.java */ + return firstChar; } /** @@ -408,14 +406,25 @@ public abstract class CustomFont extends Typeface this.resolver = resolver; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void putKerningEntry(Integer key, Map value) { if (kerning == null) { kerning = new java.util.HashMap(); } this.kerning.put(key, value); } + + /** + * Replaces the existing kerning map with a new one. + * @param kerningMap the kerning map (Map<Integer, Map<Integer, Integer>, the integers are + * character codes) + */ + public void replaceKerningMap(Map kerningMap) { + if (kerningMap == null) { + this.kerning = Collections.EMPTY_MAP; + } else { + this.kerning = kerningMap; + } + } } |