/**
* 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
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;
}
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.");
}
} 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.");
}
// Throw an exception if the size is exceeded
throw new MaximumSizeExceededException();
} else {
- fontList.add(fd);
+ fontList.add(fontDefinition);
}
} catch (UnsupportedEncodingException ex) {