git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1805622 13f79535-47bb-0310-9956-ffa450edef68tags/fop-2_3
@@ -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; | |||
} | |||
} |
@@ -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) { |