aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fonts/EmbedFontInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/fonts/EmbedFontInfo.java')
-rw-r--r--src/java/org/apache/fop/fonts/EmbedFontInfo.java39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/fonts/EmbedFontInfo.java b/src/java/org/apache/fop/fonts/EmbedFontInfo.java
index 5af3fc5ba..24b218f8d 100644
--- a/src/java/org/apache/fop/fonts/EmbedFontInfo.java
+++ b/src/java/org/apache/fop/fonts/EmbedFontInfo.java
@@ -34,8 +34,6 @@ public class EmbedFontInfo implements Serializable {
/** Serialization Version UID */
private static final long serialVersionUID = 8755432068669997369L;
- protected final URI metricsURI;
- protected final URI embedURI;
/** false, to disable kerning */
protected final boolean kerning;
/** false, to disable advanced typographic features */
@@ -55,6 +53,8 @@ public class EmbedFontInfo implements Serializable {
private transient boolean embedded = true;
+ private FontUris fontUris;
+
/**
* Main constructor
* @param metricsURI the URI of the XML resource containing font metrics
@@ -65,26 +65,42 @@ public class EmbedFontInfo implements Serializable {
* @param subFontName the sub-fontname used for TrueType Collections (null otherwise)
* @param encodingMode the encoding mode to use for this font
*/
- public EmbedFontInfo(URI metricsURI, boolean kerning, boolean advanced,
- List<FontTriplet> fontTriplets, URI embedURI, String subFontName,
+ public EmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced,
+ List<FontTriplet> fontTriplets, String subFontName,
EncodingMode encodingMode, EmbeddingMode embeddingMode) {
- this.metricsURI = metricsURI;
- this.embedURI = embedURI;
this.kerning = kerning;
this.advanced = advanced;
this.fontTriplets = fontTriplets;
this.subFontName = subFontName;
this.encodingMode = encodingMode;
this.embeddingMode = embeddingMode;
+ this.fontUris = fontUris;
+ }
+
+ /**
+<<<<<<< HEAD
+=======
+ * Main constructor
+ * @param metricsURI the URI of the XML resource containing font metrics
+ * @param kerning True if kerning should be enabled
+ * @param fontTriplets List of font triplets to associate with this font
+ * @param embedURI Path to the embeddable font file (may be null)
+ * @param subFontName the sub-fontname used for TrueType Collections (null otherwise)
+ */
+ public EmbedFontInfo(FontUris fontUris, boolean kerning, boolean advanced,
+ List<FontTriplet> fontTriplets, String subFontName) {
+ this(fontUris, kerning, advanced, fontTriplets, subFontName, EncodingMode.AUTO,
+ EmbeddingMode.AUTO);
}
/**
+>>>>>>> 9c3c942... added uris for afm and pfm font files
* Returns the URI of the metrics XML resource
*
* @return the metrics file path
*/
public URI getMetricsURI() {
- return metricsURI;
+ return fontUris.getMetrics();
}
/**
@@ -93,7 +109,7 @@ public class EmbedFontInfo implements Serializable {
* @return the font resource URI
*/
public URI getEmbedURI() {
- return embedURI;
+ return fontUris.getEmbed();
}
/**
@@ -150,7 +166,7 @@ public class EmbedFontInfo implements Serializable {
* @return true if the font is embedded, false if it is referenced.
*/
public boolean isEmbedded() {
- if (embedURI == null) {
+ if (fontUris.getEmbed() == null) {
return false;
} else {
return this.embedded;
@@ -189,7 +205,7 @@ public class EmbedFontInfo implements Serializable {
/** {@inheritDoc} */
public String toString() {
- return "metrics-uri=" + metricsURI + ", embed-uri=" + embedURI
+ return "metrics-uri=" + fontUris.getMetrics() + ", embed-uri=" + fontUris.getEmbed()
+ ", kerning=" + kerning
+ ", advanced=" + advanced
+ ", enc-mode=" + encodingMode
@@ -198,4 +214,7 @@ public class EmbedFontInfo implements Serializable {
+ (isEmbedded() ? "" : ", NOT embedded");
}
+ public FontUris getFontUris() {
+ return fontUris;
+ }
}