From 9b7fb63672f4a8ecc9088f8bbad504924851ba2e Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Mon, 13 Aug 2001 07:52:21 +0000 Subject: [PATCH] pdf renderer now adds the fonts at the end of all pages rather than after each page 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 | 3 ++- src/org/apache/fop/render/pdf/fonts/LazyFont.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java index ff59db46e..01dacee24 100644 --- a/src/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/org/apache/fop/render/pdf/PDFRenderer.java @@ -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); diff --git a/src/org/apache/fop/render/pdf/fonts/LazyFont.java b/src/org/apache/fop/render/pdf/fonts/LazyFont.java index 80faae2de..e9fc2caee 100644 --- a/src/org/apache/fop/render/pdf/fonts/LazyFont.java +++ b/src/org/apache/fop/render/pdf/fonts/LazyFont.java @@ -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 " -- 2.39.5