aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop/render/pdf
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 /test/java/org/apache/fop/render/pdf
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 'test/java/org/apache/fop/render/pdf')
-rw-r--r--test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java
index a7ea1a2db..eb34f70b8 100644
--- a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java
+++ b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java
@@ -19,14 +19,16 @@
package org.apache.fop.render.pdf;
-import org.apache.fop.pdf.PDFCMap;
+import java.io.StringWriter;
import junit.framework.TestCase;
+import org.apache.fop.pdf.CMapBuilder;
+
/** Simple sanity test of the PDFCmap class */
public class PDFCMapTestCase extends TestCase {
- public void testPDFCMapFillInPDF() {
+ public void testPDFCMapFillInPDF() throws Exception {
final String EOL = "\n";
final String expected =
"%!PS-Adobe-3.0 Resource-CMap" + EOL
@@ -59,10 +61,10 @@ public class PDFCMapTestCase extends TestCase {
+"%%EOF" + EOL
;
- final PDFCMap m = new PDFCMap("test", null);
- final StringBuffer b = new StringBuffer();
- m.fillInPDF(b);
- final String actual = b.toString();
+ final StringWriter w = new StringWriter();
+ final CMapBuilder builder = new CMapBuilder(w, "test");
+ builder.writeCMap();
+ final String actual = w.getBuffer().toString();
assertEquals("PDFCMap output matches expected PostScript code", expected, actual);
}