import java.io.UnsupportedEncodingException;
import java.util.HashMap;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* The code page to which the character set relates
*/
- protected String _codePage;
+ protected String codePage;
/**
* The encoding used for the code page
*/
- protected String _encoding;
+ protected String encoding;
/**
* The character set relating to the font
*/
- protected String _name;
+ protected String name;
/**
* The name of the character set as EBCIDIC bytes
*/
- private byte[] _nameBytes;
+ private byte[] nameBytes;
/**
* The path to the installed fonts
*/
- protected String _path;
+ protected String path;
/**
* Indicator as to whether to metrics have been loaded
*/
- private boolean _isMetricsLoaded = false;
+ private boolean isMetricsLoaded = false;
/**
* The current orientation (currently only 0 is suppoted by FOP)
*/
- private String _currentOrientation = "0";
+ private String currentOrientation = "0";
/**
* The collection of objects for each orientation
*/
- private HashMap _characterSetOrientations;
+ private Map characterSetOrientations = null;
/**
* Constructor for the CharacterSetMetric object, the character set is used
}
if (name.length() < 8) {
- _name = StringUtils.rpad(name, ' ', 8);
+ this.name = StringUtils.rpad(name, ' ', 8);
} else {
- _name = name;
+ this.name = name;
}
try {
- _nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
+ this.nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
- _nameBytes = name.getBytes();
+ this.nameBytes = name.getBytes();
log.warn(
"Constructor:: UnsupportedEncodingException translating the name "
+ name);
}
- _codePage = codePage;
- _encoding = encoding;
- _path = path;
- _characterSetOrientations = new HashMap(4);
+ this.codePage = codePage;
+ this.encoding = encoding;
+ this.path = path;
+ this.characterSetOrientations = new HashMap(4);
}
*/
public void addCharacterSetOrientation(CharacterSetOrientation cso) {
- _characterSetOrientations.put(
+ characterSetOrientations.put(
String.valueOf(cso.getOrientation()),
cso);
* @return the path where the font resources are installed
*/
public String getPath() {
- return _path;
+ return path;
}
/**
*/
private void load() {
- if (!_isMetricsLoaded) {
+ if (!isMetricsLoaded) {
AFPFontReader afpFontReader = new AFPFontReader();
afpFontReader.loadCharacterSetMetric(this);
- _isMetricsLoaded = true;
+ isMetricsLoaded = true;
}
* @return String
*/
public String getName() {
- return _name;
+ return name;
}
/**
* @return byte[]
*/
public byte[] getNameBytes() {
- return _nameBytes;
+ return nameBytes;
}
/**
* @return String
*/
public String getCodePage() {
- return _codePage;
+ return codePage;
}
/**
* @return String
*/
public String getEncoding() {
- return _encoding;
+ return encoding;
}
/**
*/
private CharacterSetOrientation getCharacterSetOrientation() {
- CharacterSetOrientation c =
- (CharacterSetOrientation) _characterSetOrientations.get(
- _currentOrientation);
+ CharacterSetOrientation c
+ = (CharacterSetOrientation) characterSetOrientations.get(currentOrientation);
return c;
}