diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-02-14 08:12:34 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-02-14 08:12:34 +0000 |
commit | c29ce0ae80329a756e17c263c1c4886d50708b3f (patch) | |
tree | cfdfc8273d9c85b46f5a3a5f04d02c0c5a729f18 /src/java/org/apache/fop/pdf/PDFRectangle.java | |
parent | 40f03bc5a0233f5081acae13cc55f26e91714790 (diff) | |
download | xmlgraphics-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/pdf/PDFRectangle.java')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFRectangle.java | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFRectangle.java b/src/java/org/apache/fop/pdf/PDFRectangle.java index e84227adf..ca97c2474 100644 --- a/src/java/org/apache/fop/pdf/PDFRectangle.java +++ b/src/java/org/apache/fop/pdf/PDFRectangle.java @@ -19,12 +19,16 @@ package org.apache.fop.pdf; +import java.io.IOException; +import java.io.OutputStream; +import java.io.Writer; + /** * class representing a rectangle * * Rectangles are specified on page 183 of the PDF 1.3 spec. */ -public class PDFRectangle { +public class PDFRectangle implements PDFWritable { /** * lower left x coordinate @@ -73,23 +77,17 @@ public class PDFRectangle { this.ury = array[3]; } - /** - * produce the PDF representation for the object - * - * @return the PDF - */ - public byte[] toPDF() { - return PDFDocument.encode(toPDFString()); + private String format() { + return "[" + llx + " " + lly + " " + urx + " " + ury + "]"; } - /** - * Create a PDF string for this rectangle. - * - * @return the pdf string - */ - public String toPDFString() { - return new String(" [" + llx + " " + lly + " " + urx + " " + ury - + "] "); + /** {@inheritDoc} */ + public String toString() { + return "PDFRectangle" + format(); } + /** {@inheritDoc} */ + public void outputInline(OutputStream out, Writer writer) throws IOException { + writer.write(format()); + } } |