Browse Source

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
pull/3/head
Glenn Adams 7 years ago
parent
commit
d2bba83020

+ 4
- 3
fop-core/src/main/java/org/apache/fop/fonts/LazyFont.java View File

@@ -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) {

fop-core/src/main/java/org/apache/fop/fonts/FontReader.java → fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java View File

@@ -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:
* <p>Class for reading a metric.xml file and creating a font object.
* Typical usage:</p>
* <pre>
* FontReader reader = new FontReader(<path til metrics.xml>);
* XMLFontMetricsReader reader = new XMLFontMetricsReader(<path til metrics.xml>);
* reader.setFontEmbedPath(<path to a .ttf or .pfb file or null to diable embedding>);
* reader.useKerning(true);
* Font f = reader.getFont();
* </pre>
* <p><strong>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.</strong></p>
*/
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<CMapSegment> 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);
}

Loading…
Cancel
Save