From d6523cbf1c1549232f2c195aa11f93d0082a81cd Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Thu, 1 Sep 2016 16:14:25 +0000 Subject: [PATCH] Rename o.a.f.fonts.FontReader to XMLMetricsFontReader, then deprecate the latter. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1758804 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/fop/fonts/LazyFont.java | 7 ++++--- ...FontReader.java => XMLFontMetricsReader.java} | 16 ++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) rename fop-core/src/main/java/org/apache/fop/fonts/{FontReader.java => XMLFontMetricsReader.java} (94%) diff --git a/fop-core/src/main/java/org/apache/fop/fonts/LazyFont.java b/fop-core/src/main/java/org/apache/fop/fonts/LazyFont.java index 2d32eec57..d99a3675f 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/LazyFont.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/LazyFont.java @@ -101,12 +101,13 @@ public class LazyFont extends Typeface implements FontDescriptor, Substitutable, if (!isMetricsLoaded) { try { if (fontUris.getMetrics() != null) { - /**@todo Possible thread problem here */ - FontReader reader = null; + // Use of XML based font metrics is DEPRECATED! + // @todo Possible thread problem here + XMLFontMetricsReader reader = null; InputStream in = resourceResolver.getResource(fontUris.getMetrics()); InputSource src = new InputSource(in); src.setSystemId(fontUris.getMetrics().toASCIIString()); - reader = new FontReader(src, resourceResolver); + reader = new XMLFontMetricsReader(src, resourceResolver); reader.setKerningEnabled(useKerning); reader.setAdvancedEnabled(useAdvanced); if (this.embedded) { diff --git a/fop-core/src/main/java/org/apache/fop/fonts/FontReader.java b/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java similarity index 94% rename from fop-core/src/main/java/org/apache/fop/fonts/FontReader.java rename to fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java index 9f5d54396..4e6177786 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/FontReader.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java @@ -43,16 +43,20 @@ import org.apache.fop.apps.io.InternalResourceResolver; import org.apache.fop.fonts.apps.TTFReader; /** - * Class for reading a metric.xml file and creating a font object. - * Typical usage: + *

Class for reading a metric.xml file and creating a font object. + * Typical usage:

*
- * FontReader reader = new FontReader();
+ * XMLFontMetricsReader reader = new XMLFontMetricsReader();
  * reader.setFontEmbedPath();
  * reader.useKerning(true);
  * Font f = reader.getFont();
  * 
+ *

N.B. This is deprecated functionality and is expected to be + * removed from a future version of FOP. New applications using FOP should + * not make direct or implied use of this mechanism.

*/ -public class FontReader extends DefaultHandler { +@Deprecated +public class XMLFontMetricsReader extends DefaultHandler { private boolean isCID; private CustomFont returnFont; @@ -69,12 +73,12 @@ public class FontReader extends DefaultHandler { private List bfranges; /** - * Construct a FontReader object from a path to a metric.xml file + * Construct a XMLFontMetricsReader object from a path to a metric.xml file * and read metric data * @param source Source of the font metric file * @throws FOPException if loading the font fails */ - public FontReader(InputSource source, InternalResourceResolver resourceResolver) throws FOPException { + public XMLFontMetricsReader(InputSource source, InternalResourceResolver resourceResolver) throws FOPException { this.resourceResolver = resourceResolver; createFont(source); } -- 2.39.5