aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fonts/CustomFont.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-02-14 08:12:34 +0000
committerJeremias Maerki <jeremias@apache.org>2008-02-14 08:12:34 +0000
commitc29ce0ae80329a756e17c263c1c4886d50708b3f (patch)
treecfdfc8273d9c85b46f5a3a5f04d02c0c5a729f18 /src/java/org/apache/fop/fonts/CustomFont.java
parent40f03bc5a0233f5081acae13cc55f26e91714790 (diff)
downloadxmlgraphics-fop-c29ce0ae80329a756e17c263c1c4886d50708b3f.tar.gz
xmlgraphics-fop-c29ce0ae80329a756e17c263c1c4886d50708b3f.zip
Added support for Type 1 fonts which don't use the AdobeStandardEncoding for PDF and PS output. Details:
Added an Type 1 AFM parser (only basic ltr script fonts are properly supported). Font loading changed slightly to allow loading an AFM in addition to a PFM. Added some mapping functionality to CodePointMapping. Now we also build custom CodePointMapping instances from AFM files and use it in SingleByteFonts. Changed more PDF object classes to make use of the generic PDFDictionary and PDFArray base classes. Type 1 Fonts with a special encoding now register their encoding in the Encoding value of the font dictionary so the mapping is correct. For PS this isn't necessary as the interpreter just uses the font's default encoding. Refactored CMap building code to it can also be used outside the PDF context. A CMap can now also be built from a single byte encoding. Update of XML Graphics Commons snapshot. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@627679 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fonts/CustomFont.java')
-rw-r--r--src/java/org/apache/fop/fonts/CustomFont.java21
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;
+ }
+ }
}