Index: src/java/org/apache/fop/pdf/PDFTTFStream.java
===================================================================
--- src/java/org/apache/fop/pdf/PDFTTFStream.java	(revision 743024)
+++ src/java/org/apache/fop/pdf/PDFTTFStream.java	Tue Feb 10 19:50:04 CET 2009
@@ -20,12 +20,14 @@
 package org.apache.fop.pdf;
 
 import java.io.IOException;
+import java.io.OutputStream;
 
 /**
  * Special PDFStream for embeddable TrueType fonts.
  */
-public class PDFTTFStream extends PDFStream {
+public class PDFTTFStream extends AbstractPDFFontStream {
 
+    private PDFStream pdfStream;
     private int origLength;
 
     /**
@@ -33,10 +35,20 @@
      * @param len original length
      */
     public PDFTTFStream(int len) {
-        super();
-        origLength = len;
+        this.pdfStream = new PDFStream();
+        this.origLength = len;
     }
 
+    /** {@inheritDoc} */
+    protected int getSizeHint() throws IOException {
+        return this.pdfStream.getSizeHint();
+    }
+
+    /** {@inheritDoc} */
+    protected void outputRawStreamData(OutputStream out) throws IOException {
+        this.pdfStream.outputRawStreamData(out);
+    }
+
     /**
      * Overload the base object method so we don't have to copy
      * byte arrays around so much
@@ -48,15 +60,15 @@
             log.debug("Writing " + origLength + " bytes of TTF font data");
         }
 
-        int length = super.output(stream);
+        int length = this.pdfStream.output(stream);
         log.debug("Embedded TrueType/OpenType font");
         return length;
     }
 
     /** {@inheritDoc} */
     protected void populateStreamDict(Object lengthEntry) {
-        put("Length1", origLength);
-        super.populateStreamDict(lengthEntry);
+        this.pdfStream.put("Length1", origLength);
+        this.pdfStream.populateStreamDict(lengthEntry);
     }
 
     /**
@@ -66,18 +78,7 @@
      * @throws IOException in case of an I/O problem
      */
     public void setData(byte[] data, int size) throws IOException {
-        this.data.clear();
-        getBufferOutputStream().write(data, 0, size);
+        this.pdfStream.data.clear();
+        this.pdfStream.getBufferOutputStream().write(data, 0, size);
     }
-
-    /** {@inheritDoc} */
-    protected void setupFilterList() {
-        if (!getFilterList().isInitialized()) {
-            getFilterList().addDefaultFilters(
-                getDocumentSafely().getFilterMap(),
-                PDFFilterList.FONT_FILTER);
-        }
+}
-        super.setupFilterList();
-    }
-
-}
Index: src/java/org/apache/fop/pdf/AbstractPDFFontStream.java
===================================================================
--- src/java/org/apache/fop/pdf/AbstractPDFFontStream.java	Tue Feb 10 19:44:53 CET 2009
+++ src/java/org/apache/fop/pdf/AbstractPDFFontStream.java	Tue Feb 10 19:44:53 CET 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* $Id$ */
+package org.apache.fop.pdf;
+
+public abstract class AbstractPDFFontStream extends AbstractPDFStream {
+
+    /**
+     * {@inheritDoc}
+     * Add the default {@link PDFFilterList#FONT_FILTER} to the
+     * list of filters.
+     */
+    protected void setupFilterList() {
+        if (!getFilterList().isInitialized()) {
+            getFilterList().addDefaultFilters(
+                getDocumentSafely().getFilterMap(),
+                PDFFilterList.FONT_FILTER);
+        }
+        super.setupFilterList();
+    }
+}
Index: src/java/org/apache/fop/pdf/PDFT1Stream.java
===================================================================
--- src/java/org/apache/fop/pdf/PDFT1Stream.java	(revision 743024)
+++ src/java/org/apache/fop/pdf/PDFT1Stream.java	Tue Feb 10 19:43:03 CET 2009
@@ -28,7 +28,7 @@
 /**
  * Special PDFStream for embedding Type 1 fonts.
  */
-public class PDFT1Stream extends AbstractPDFStream {
+public class PDFT1Stream extends AbstractPDFFontStream {
 
     private PFBData pfb;
 
@@ -86,15 +86,4 @@
     public void setData(PFBData pfb) throws IOException {
         this.pfb = pfb;
     }
-
-    /** {@inheritDoc} */
-    protected void setupFilterList() {
-        if (!getFilterList().isInitialized()) {
-            getFilterList().addDefaultFilters(
-                getDocumentSafely().getFilterMap(),
-                PDFFilterList.FONT_FILTER);
-        }
+}
-        super.setupFilterList();
-    }
-
-}
