throw new IllegalArgumentException(msg);
}
- if (name.length() < MAX_NAME_LEN) {
- this.name = StringUtils.rpad(name, ' ', MAX_NAME_LEN);
- } else {
- this.name = name;
- }
- this.codePage = codePage;
+ // the character set name must be 8 chars long
+ this.name = padName(name);
+ // the code page name must be 8 chars long
+ this.codePage = padName(codePage);
+
this.encoding = encoding;
this.encoder = charsetType.getEncoder(encoding);
this.accessor = accessor;
this.characterSetOrientations = new HashMap<String, CharacterSetOrientation>(4);
}
+ // right pad short names with space
+ private String padName(String name) {
+ return name.length() < MAX_NAME_LEN ? StringUtils.rpad(name, ' ', MAX_NAME_LEN) : name;
+ }
+
/**
* Add character set metric information for the different orientations
*
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Code" dev="CB" type="fix" fixes-bug="48955" due-to="Peter Hancock">
+ Allow AFP font codepage names to be less than 8 chars
+ </action>
<action context="Code" dev="PH" type="fix" fixes-bug="54075">
Fixed a regression
</action>