From: Keiron Liddle Date: Tue, 3 Sep 2002 12:48:57 +0000 (+0000) Subject: correctly handles font in pattern X-Git-Tag: Alt-Design-integration-base~420 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=15b175f37b0f39e9a1d16fb35ed386a0959e3103;p=xmlgraphics-fop.git correctly handles font in pattern git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195148 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/pdf/PDFDocument.java b/src/org/apache/fop/pdf/PDFDocument.java index a551dc929..89769adeb 100644 --- a/src/org/apache/fop/pdf/PDFDocument.java +++ b/src/org/apache/fop/pdf/PDFDocument.java @@ -933,8 +933,8 @@ public class PDFDocument { public PDFFont makeFont(String fontname, String basefont, String encoding, FontMetric metrics, FontDescriptor descriptor) { - if(fontMap.containsKey(basefont)) { - return (PDFFont)fontMap.get(basefont); + if(fontMap.containsKey(fontname)) { + return (PDFFont)fontMap.get(fontname); } /* diff --git a/src/org/apache/fop/svg/PDFGraphics2D.java b/src/org/apache/fop/svg/PDFGraphics2D.java index 3093deded..09a6e7c9e 100644 --- a/src/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/org/apache/fop/svg/PDFGraphics2D.java @@ -797,7 +797,7 @@ public class PDFGraphics2D extends AbstractGraphics2D { PDFResourceContext context = new PDFResourceContext(0, pdfDoc, res); PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fi, pdfDoc, context, pageRef, - currentFontName, currentFontSize, + "", 0, currentYPosition, currentXPosition); pattGraphic.gc = (GraphicContext)this.gc.clone(); pattGraphic.gc.validateTransformStack(); @@ -1008,9 +1008,10 @@ public class PDFGraphics2D extends AbstractGraphics2D { FontMetric metrics = fontInfo.getMetricsFor(fname); fontState = new FontState(fname, metrics, siz * 1000); } else { - fontState = ovFontState; + FontMetric metrics = fontInfo.getMetricsFor(ovFontState.getFontName()); + fontState = new FontState(ovFontState.getFontName(), metrics, ovFontState.getFontSize()); ovFontState = null; - } + } String name; float size; name = fontState.getFontName();