aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/layout/FontInfo.java
diff options
context:
space:
mode:
authorjtauber <jtauber@unknown>1999-11-22 02:32:21 +0000
committerjtauber <jtauber@unknown>1999-11-22 02:32:21 +0000
commit8db42fcc7af041a77223683e11e053ffb82c4847 (patch)
tree81748e94daccc781c60ee1d2bcf5a6105ab3070f /src/org/apache/fop/layout/FontInfo.java
parentabd622447e632998a8c9a5fbf40aec5e0ce73315 (diff)
downloadxmlgraphics-fop-8db42fcc7af041a77223683e11e053ffb82c4847.tar.gz
xmlgraphics-fop-8db42fcc7af041a77223683e11e053ffb82c4847.zip
removed multiple CRs at end of lines
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193230 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layout/FontInfo.java')
-rw-r--r--src/org/apache/fop/layout/FontInfo.java77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/org/apache/fop/layout/FontInfo.java b/src/org/apache/fop/layout/FontInfo.java
index dc6d778fb..e651baa2a 100644
--- a/src/org/apache/fop/layout/FontInfo.java
+++ b/src/org/apache/fop/layout/FontInfo.java
@@ -50,155 +50,78 @@
*/
package org.apache.fop.layout;
-
-
import java.util.Hashtable;
-
import java.util.Enumeration;
-
-
import org.apache.fop.apps.FOPException;
-
-
public class FontInfo {
-
-
Hashtable triplets; // look up a font-triplet to find a font-name
-
Hashtable fonts; // look up a font-name to get a font (that implements FontMetric at least)
-
-
public FontInfo() {
-
this.triplets = new Hashtable();
-
this.fonts = new Hashtable();
-
}
-
-
public void addFontProperties(String name, String family, String style, String weight) {
-
/* add the given family, style and weight as a lookup for the font
-
with the given name */
-
-
String key = family + "," + style + "," + weight;
-
this.triplets.put(key,name);
-
}
-
-
public void addMetrics(String name, FontMetric metrics) {
-
// add the given metrics as a font with the given name
-
-
this.fonts.put(name,metrics);
-
}
-
-
public String fontLookup(String family, String style, String weight) throws FOPException {
-
// given a family, style and weight, return the font name
-
int i;
-
-
try {
-
i = Integer.parseInt(weight);
-
} catch (NumberFormatException e) {
-
i = 0;
-
}
-
-
if (i > 600)
-
weight = "bold";
-
else if (i > 0)
-
weight = "normal";
-
-
String key = family + "," + style + "," + weight;
-
-
String f = (String)this.triplets.get(key);
-
if (f == null) {
-
f = (String)this.triplets.get("any," + style + "," + weight);
-
if (f == null) {
-
f = (String)this.triplets.get("any,normal,normal");
-
if (f == null) {
-
throw new FOPException("no default font defined by OutputConverter");
-
}
-
System.err.println("WARNING: defaulted font to any,normal,normal");
-
}
-
System.err.println("WARNING: unknown font "+family+" so defaulted font to any");
-
}
-
return f;
-
}
-
-
public Hashtable getFonts() {
-
return this.fonts;
-
}
-
-
public FontMetric getMetricsFor(String fontName) throws FOPException {
-
return (FontMetric)fonts.get(fontName);
-
}
-
-
public FontMetric getMetricsFor(String family, String style, String weight) throws FOPException {
-
// given a family, style and weight, return the metric
-
-
return (FontMetric)fonts.get(fontLookup(family,style,weight));
-
}
-
}
-