diff options
author | Glen Mazza <gmazza@apache.org> | 2003-12-12 22:37:39 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-12-12 22:37:39 +0000 |
commit | e7341ee4f08a1784d84eb7b88b6d1f647f530f46 (patch) | |
tree | 3c7ebb8913c0ab9d721ee28228b8160a6f72732b /src/java/org/apache/fop/svg/PDFGraphics2D.java | |
parent | 49cb7713f146e028a55a85014a681e53712d6864 (diff) | |
download | xmlgraphics-fop-e7341ee4f08a1784d84eb7b88b6d1f647f530f46.tar.gz xmlgraphics-fop-e7341ee4f08a1784d84eb7b88b6d1f647f530f46.zip |
Moved FontSetup and two helper classes from render.pdf to fonts package.
FontSetup has the PDF fonts as the default, but this class can be extended
if/when another renderer needs its own font setups. (Cannot do this, however,
for AWT's FontSetup at the moment, because its setup() has a different
signature.)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197031 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg/PDFGraphics2D.java')
-rw-r--r-- | src/java/org/apache/fop/svg/PDFGraphics2D.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index dc4523d17..90e7f91a0 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -66,7 +66,7 @@ import org.apache.fop.pdf.PDFAnnotList; import org.apache.fop.pdf.BitmapImage; import org.apache.fop.apps.Document; import org.apache.fop.fonts.Font; -import org.apache.fop.render.pdf.FontSetup; +import org.apache.fop.fonts.FontSetup; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.fonts.LazyFont; import org.apache.fop.image.JpegImage; @@ -964,12 +964,12 @@ public class PDFGraphics2D extends AbstractGraphics2D { private void createPattern(PatternPaint pp, boolean fill) { Rectangle2D rect = pp.getPatternRect(); - Document fi = new Document(null); - FontSetup.setup(fi, null); + Document fontInfo = new Document(null); + FontSetup.setup(fontInfo, null); PDFResources res = pdfDoc.getFactory().makeResources(); PDFResourceContext context = new PDFResourceContext(res); - PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fi, + PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fontInfo, pdfDoc, context, pageRef, "", 0); pattGraphic.gc = (GraphicContext)this.gc.clone(); @@ -1008,7 +1008,10 @@ public class PDFGraphics2D extends AbstractGraphics2D { translate.add(new Double(flatmatrix[4])); translate.add(new Double(flatmatrix[5])); - FontSetup.addToResources(pdfDoc, res, fi); + /** @todo see if pdfDoc and res can be linked here, + (currently res <> PDFDocument's resources) so addFonts() + can be moved to PDFDocument class */ + res.addFonts(pdfDoc, fontInfo); PDFPattern myPat = pdfDoc.getFactory().makePattern( resourceContext, 1, res, 1, 1, bbox, |