Browse Source

FOP-2733: Reduce dependency on Avalon Framework

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1805622 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_3
Simon Steiner 6 years ago
parent
commit
cdc74a4cea

+ 15
- 8
fop-core/src/main/java/org/apache/fop/fonts/CIDFontType.java View File

@@ -19,32 +19,32 @@

package org.apache.fop.fonts;

import org.apache.avalon.framework.ValuedEnum;

/**
* This class enumerates all supported CID font types.
*/
public class CIDFontType extends ValuedEnum {
public enum CIDFontType {

/**
* CID Font Type 0 (based on Type 1 format)
*/
public static final CIDFontType CIDTYPE0 = new CIDFontType("CIDFontType0", 0);
CIDTYPE0("CIDFontType0", 0),

/**
* CID Font Type 2 (based on TrueType format)
*/
public static final CIDFontType CIDTYPE2 = new CIDFontType("CIDFontType2", 2);
CIDTYPE2("CIDFontType2", 2);

private final String name;
private final int value;

/**
* Construct a CID font type.
* @param name a type name
* @param value a type value
* @see org.apache.avalon.framework.Enum#Enum(String)
*/
protected CIDFontType(String name, int value) {
super(name, value);
CIDFontType(String name, int value) {
this.name = name;
this.value = value;
}


@@ -79,4 +79,11 @@ public class CIDFontType extends ValuedEnum {
}
}

public String getName() {
return name;
}

public int getValue() {
return value;
}
}

+ 3
- 5
fop-core/src/main/java/org/apache/fop/pdf/PDFText.java View File

@@ -21,8 +21,6 @@ package org.apache.fop.pdf;

import java.io.ByteArrayOutputStream;

import org.apache.avalon.framework.CascadingRuntimeException;

/**
* This class represents a simple number object. It also contains contains some
* utility methods for outputting numbers to PDF.
@@ -101,7 +99,7 @@ public class PDFText extends PDFObject {
try {
uniBytes = text.getBytes("UTF-16");
} catch (java.io.UnsupportedEncodingException uee) {
throw new CascadingRuntimeException("Incompatible VM", uee);
throw new RuntimeException("Incompatible VM", uee);
}
return toHex(uniBytes);
} else {
@@ -179,7 +177,7 @@ public class PDFText extends PDFObject {
try {
return text.getBytes("UnicodeBig");
} catch (java.io.UnsupportedEncodingException uee) {
throw new CascadingRuntimeException("Incompatible VM", uee);
throw new RuntimeException("Incompatible VM", uee);
}
}

@@ -195,7 +193,7 @@ public class PDFText extends PDFObject {
final char[] a = {c};
uniBytes = new String(a).getBytes("UTF-16BE");
} catch (java.io.UnsupportedEncodingException uee) {
throw new CascadingRuntimeException("Incompatible VM", uee);
throw new RuntimeException("Incompatible VM", uee);
}

for (byte uniByte : uniBytes) {

Loading…
Cancel
Save