]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
correctly handles font in pattern
authorKeiron Liddle <keiron@apache.org>
Tue, 3 Sep 2002 12:48:57 +0000 (12:48 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 3 Sep 2002 12:48:57 +0000 (12:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195148 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/pdf/PDFDocument.java
src/org/apache/fop/svg/PDFGraphics2D.java

index a551dc92908e051c93197accc02e4da2963bca3d..89769adeba990fd17928ab516d847cd29883e828 100644 (file)
@@ -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);
         }
 
         /*
index 3093dedede9723bf5c41eb366d9b3725770013d6..09a6e7c9edccdfe9779f7363efb4a82da205a3f3 100644 (file)
@@ -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();