diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-10-27 11:46:59 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-10-27 11:46:59 +0000 |
commit | c7d3eb2e5b0748353aca6248d1e9586f3866b85d (patch) | |
tree | dcb4143d596cd96bab946b5600c0bafa9997221f /src | |
parent | 9500bbcde75d9ca1da5b56eeacac84dbeb41a401 (diff) | |
download | xmlgraphics-fop-c7d3eb2e5b0748353aca6248d1e9586f3866b85d.tar.gz xmlgraphics-fop-c7d3eb2e5b0748353aca6248d1e9586f3866b85d.zip |
Minor cleanup.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@708150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/afp/modca/MapCodedFont.java | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/java/org/apache/fop/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/afp/modca/MapCodedFont.java index fb9637678..159aa200a 100644 --- a/src/java/org/apache/fop/afp/modca/MapCodedFont.java +++ b/src/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -46,7 +46,8 @@ public class MapCodedFont extends AbstractStructuredAFPObject { /** * The collection of map coded fonts (maximum of 254) */ - private final List/*<FontDefinition>*/ fontList = new java.util.ArrayList(); + private final List/*<FontDefinition>*/ fontList + = new java.util.ArrayList/*<FontDefinition>*/(); /** * Constructor for the MapCodedFont @@ -151,22 +152,22 @@ public class MapCodedFont extends AbstractStructuredAFPObject { public void addFont(int fontReference, AFPFont font, int size, int orientation) throws MaximumSizeExceededException { - FontDefinition fd = new FontDefinition(); + FontDefinition fontDefinition = new FontDefinition(); - fd.fontReferenceKey = BinaryUtils.convert(fontReference)[0]; + fontDefinition.fontReferenceKey = BinaryUtils.convert(fontReference)[0]; switch (orientation) { case 90: - fd.orientation = 0x2D; + fontDefinition.orientation = 0x2D; break; case 180: - fd.orientation = 0x5A; + fontDefinition.orientation = 0x5A; break; case 270: - fd.orientation = (byte) 0x87; + fontDefinition.orientation = (byte) 0x87; break; default: - fd.orientation = 0x00; + fontDefinition.orientation = 0x00; break; } @@ -181,21 +182,21 @@ public class MapCodedFont extends AbstractStructuredAFPObject { throw new FontRuntimeException(msg); } - fd.characterSet = cs.getNameBytes(); + fontDefinition.characterSet = cs.getNameBytes(); - if (fd.characterSet.length != 8) { + if (fontDefinition.characterSet.length != 8) { throw new IllegalArgumentException("The character set " - + new String(fd.characterSet, + + new String(fontDefinition.characterSet, AFPConstants.EBCIDIC_ENCODING) + " must have a fixed length of 8 characters."); } - fd.codePage = cs.getCodePage().getBytes( + fontDefinition.codePage = cs.getCodePage().getBytes( AFPConstants.EBCIDIC_ENCODING); - if (fd.codePage.length != 8) { + if (fontDefinition.codePage.length != 8) { throw new IllegalArgumentException("The code page " - + new String(fd.codePage, + + new String(fontDefinition.codePage, AFPConstants.EBCIDIC_ENCODING) + " must have a fixed length of 8 characters."); } @@ -203,18 +204,18 @@ public class MapCodedFont extends AbstractStructuredAFPObject { } else if (font instanceof OutlineFont) { OutlineFont outline = (OutlineFont) font; CharacterSet cs = outline.getCharacterSet(); - fd.characterSet = cs.getNameBytes(); + fontDefinition.characterSet = cs.getNameBytes(); // There are approximately 72 points to 1 inch or 20 1440ths per point. - fd.scale = ((size / 1000) * 20); + fontDefinition.scale = ((size / 1000) * 20); - fd.codePage = cs.getCodePage().getBytes( + fontDefinition.codePage = cs.getCodePage().getBytes( AFPConstants.EBCIDIC_ENCODING); - if (fd.codePage.length != 8) { + if (fontDefinition.codePage.length != 8) { throw new IllegalArgumentException("The code page " - + new String(fd.codePage, + + new String(fontDefinition.codePage, AFPConstants.EBCIDIC_ENCODING) + " must have a fixed length of 8 characters."); } @@ -229,7 +230,7 @@ public class MapCodedFont extends AbstractStructuredAFPObject { // Throw an exception if the size is exceeded throw new MaximumSizeExceededException(); } else { - fontList.add(fd); + fontList.add(fontDefinition); } } catch (UnsupportedEncodingException ex) { |