aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render/pdf/FontSetup.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/apache/fop/render/pdf/FontSetup.java')
-rw-r--r--src/org/apache/fop/render/pdf/FontSetup.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/org/apache/fop/render/pdf/FontSetup.java b/src/org/apache/fop/render/pdf/FontSetup.java
index 00a415230..33d7ffe7e 100644
--- a/src/org/apache/fop/render/pdf/FontSetup.java
+++ b/src/org/apache/fop/render/pdf/FontSetup.java
@@ -18,9 +18,9 @@ import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.FontTriplet;
// Java
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.ArrayList;
/**
* sets up the PDF fonts.
@@ -143,13 +143,13 @@ public class FontSetup {
String internalName = null;
FontReader reader = null;
- Vector fontInfos = Configuration.getFonts();
+ ArrayList fontInfos = Configuration.getFonts();
if (fontInfos == null)
return;
- for (Enumeration e = fontInfos.elements(); e.hasMoreElements(); ) {
+ for (int count = 0; count < fontInfos.size(); count++) {
org.apache.fop.configuration.FontInfo configFontInfo =
- (org.apache.fop.configuration.FontInfo)e.nextElement();
+ (org.apache.fop.configuration.FontInfo)fontInfos.get(count);
try {
String metricsFile = configFontInfo.getMetricsFile();
@@ -167,10 +167,9 @@ public class FontSetup {
configFontInfo.getKerning());
fontInfo.addMetrics(internalName, font);
- Vector triplets = configFontInfo.getFontTriplets();
- for (Enumeration t = triplets.elements();
- t.hasMoreElements(); ) {
- FontTriplet triplet = (FontTriplet)t.nextElement();
+ ArrayList triplets = configFontInfo.getFontTriplets();
+ for (int c = 0; c < triplets.size(); c++) {
+ FontTriplet triplet = (FontTriplet)triplets.get(c);
fontInfo.addFontProperties(internalName,
triplet.getName(),
@@ -193,11 +192,11 @@ public class FontSetup {
* @param fontInfo font info object to get font information from
*/
public static void addToResources(PDFDocument doc, FontInfo fontInfo) {
- Hashtable fonts = fontInfo.getUsedFonts();
- Enumeration e = fonts.keys();
+ HashMap fonts = fontInfo.getUsedFonts();
+ Iterator e = fonts.keySet().iterator();
PDFResources resources = doc.getResources();
- while (e.hasMoreElements()) {
- String f = (String)e.nextElement();
+ while (e.hasNext()) {
+ String f = (String)e.next();
Font font = (Font)fonts.get(f);
FontDescriptor desc = null;
if (font instanceof FontDescriptor) {