]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
pdf renderer now adds the fonts at the end of all pages rather than after each page
authorKeiron Liddle <keiron@apache.org>
Mon, 13 Aug 2001 07:52:21 +0000 (07:52 +0000)
committerKeiron Liddle <keiron@apache.org>
Mon, 13 Aug 2001 07:52:21 +0000 (07:52 +0000)
lazy font will set loaded to true after first attempt rather than keep trying if it fails

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194413 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/render/pdf/PDFRenderer.java
src/org/apache/fop/render/pdf/fonts/LazyFont.java

index ff59db46ee3a7ddab2bc90a9ce23cb4e73cdfb9e..01dacee24c69dc5358973699210057008d88fa2d 100644 (file)
@@ -153,6 +153,7 @@ public class PDFRenderer extends PrintRenderer {
 
     public void stopRenderer(OutputStream stream)
     throws IOException {
+        FontSetup.addToResources(this.pdfDoc, fontInfo);
         pdfDoc.outputTrailer(stream);
     }
 
@@ -684,7 +685,7 @@ public class PDFRenderer extends PrintRenderer {
         this.pdfDoc.setIDReferences(idReferences);
         this.renderPage(page);
 
-        FontSetup.addToResources(this.pdfDoc, fontInfo);
+        //FontSetup.addToResources(this.pdfDoc, fontInfo);
 
         // TODO: this needs to be implemented
         renderRootExtensions(page);
index 80faae2de02cbcb0e587abfc9d3d1113e2a43abd..e9fc2caee75e45f264eb199acdbdb96e346941ff 100644 (file)
@@ -33,6 +33,7 @@ public class LazyFont extends Font implements FontDescriptor {
     
     private void load(){
         if(! isMetricsLoaded){
+            isMetricsLoaded = true;
             try{
                 FontReader reader = new FontReader(metricsFileName);
                 reader.useKerning(useKerning);
@@ -41,7 +42,6 @@ public class LazyFont extends Font implements FontDescriptor {
                 if(realFont instanceof FontDescriptor){
                     realFontDescriptor = (FontDescriptor) realFont;
                 }
-                isMetricsLoaded = true;
                 // System.out.println("Metrics " + metricsFileName + " loaded.");
             } catch (Exception ex) {
                 MessageHandler.error("Failed to read font metrics file "