[FOray-commit] SF.net SVN: foray: [8048] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-11 01:56:56
|
Revision: 8048
http://svn.sourceforge.net/foray/?rev=8048&view=rev
Author: victormote
Date: 2006-09-10 18:56:21 -0700 (Sun, 10 Sep 2006)
Log Message:
-----------
Enforce "RequireThis" checkstyle check.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayConsumerFont.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
trunk/foray/foray-font/src/java/org/foray/font/FontConfig.java
trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java
trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
trunk/foray/foray-font/src/java/org/foray/font/charset/CharSet.java
trunk/foray/foray-font/src/java/org/foray/font/charset/CharSetParser.java
trunk/foray/foray-font/src/java/org/foray/font/format/FontFile.java
trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java
trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFile.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFilePFM.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileReader.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTCTableHeader.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFFileCollection.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFFont.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFMtxEntry.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFReader.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTable.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableDirEntry.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableDirectory.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableHEAD.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableHHEA.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableHMTX.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableKERN.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableLOCA.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableMAXP.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableNAME.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableOS2.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTablePCLT.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTablePOST.java
trunk/foray/foray-font/src/java/org/foray/font/format/Type1File.java
trunk/foray/foray-font/src/java/org/foray/font/format/Type1PFAFile.java
trunk/foray/foray-font/src/java/org/foray/font/format/Type1PFBFile.java
trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontOutput.java
trunk/foray/foray-font/src/java/org/foray/font/output/FOrayFontPDF.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayConsumerFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayConsumerFont.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayConsumerFont.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -113,7 +113,7 @@
protected void optimize() {
if (this.subset != null) {
- subset.sortUsedGlyphs();
+ this.subset.sortUsedGlyphs();
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -196,7 +196,7 @@
* {@inheritDoc}
*/
public byte getFontComplexity() {
- return fontComplexity;
+ return this.fontComplexity;
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -68,9 +68,9 @@
public static final byte ENCODING_ANY = 3;
private static final byte[] VALID_ENCODING_LATITUDES = {
- ENCODING_INTERNAL_ONLY,
- ENCODING_SPECIFIED_ONLY,
- ENCODING_ANY
+ FOrayFontConsumer.ENCODING_INTERNAL_ONLY,
+ FOrayFontConsumer.ENCODING_SPECIFIED_ONLY,
+ FOrayFontConsumer.ENCODING_ANY
};
/** The server that should be used to by this FontConsumer. */
@@ -103,7 +103,7 @@
*/
private HashMap usedFonts = new HashMap();
- private byte encodingLatitude = ENCODING_ANY;
+ private byte encodingLatitude = FOrayFontConsumer.ENCODING_ANY;
/** The FontSelection instance to be used for font-selection-strategy =
* "character-by-character". */
@@ -393,7 +393,7 @@
final FOrayFont[] usedFontsToReturn =
new FOrayFont[this.usedFonts.size()];
int index = 0;
- final Iterator iterator = usedFonts.keySet().iterator();
+ final Iterator iterator = this.usedFonts.keySet().iterator();
while (iterator.hasNext()) {
final FOrayFont realFont = (FOrayFont) iterator.next();
usedFontsToReturn[index] = realFont;
@@ -443,10 +443,10 @@
*/
protected FOrayConsumerFont registerFontUse(final FOrayFont font) {
FOrayConsumerFont consumerFont =
- (FOrayConsumerFont) usedFonts.get(font);
+ (FOrayConsumerFont) this.usedFonts.get(font);
if (consumerFont == null) {
consumerFont = new FOrayConsumerFont(font, this);
- usedFonts.put(font, consumerFont);
+ this.usedFonts.put(font, consumerFont);
}
return consumerFont;
}
@@ -455,11 +455,11 @@
* {@inheritDoc}
*/
public void optimizeFonts() {
- final Iterator iter = usedFonts.keySet().iterator();
+ final Iterator iter = this.usedFonts.keySet().iterator();
while (iter.hasNext()) {
final Object obj = iter.next();
final FOrayConsumerFont consumerFont = (FOrayConsumerFont)
- usedFonts.get(obj);
+ this.usedFonts.get(obj);
consumerFont.optimize();
}
}
@@ -472,7 +472,7 @@
*/
public FOrayConsumerFont getConsumerFont(final FOrayFont font) {
FOrayConsumerFont consumerFont =
- (FOrayConsumerFont) usedFonts.get(font);
+ (FOrayConsumerFont) this.usedFonts.get(font);
if (consumerFont != null) {
return consumerFont;
}
@@ -487,12 +487,14 @@
* {@link #ENCODING_ANY}.
*/
public byte getEncodingLatitude() {
- return encodingLatitude;
+ return this.encodingLatitude;
}
private boolean validEncodingLatitude(final int encodingLatitude) {
- for (int i = 0; i < VALID_ENCODING_LATITUDES.length; i++) {
- if (encodingLatitude == VALID_ENCODING_LATITUDES[i]) {
+ for (int i = 0; i < FOrayFontConsumer.VALID_ENCODING_LATITUDES.length;
+ i++) {
+ if (encodingLatitude
+ == FOrayFontConsumer.VALID_ENCODING_LATITUDES[i]) {
return true;
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -248,12 +248,12 @@
*/
public void setBaseURL(final URL url) {
/* If not already set, set it */
- if (baseURL == null) {
- baseURL = url;
+ if (this.baseURL == null) {
+ this.baseURL = url;
return;
}
/* If already set, and not changing it here, ignore it */
- if (baseURL == url) {
+ if (this.baseURL == url) {
return;
}
/* Otherwise warn the client that the change has been ignored */
@@ -261,7 +261,7 @@
}
protected URL getBaseURL() {
- return baseURL;
+ return this.baseURL;
}
/**
@@ -270,12 +270,12 @@
*/
public void setBaseFontURL(final URL url) {
/* If not already set, set it */
- if (baseFontURL == null) {
- baseFontURL = url;
+ if (this.baseFontURL == null) {
+ this.baseFontURL = url;
return;
}
/* If already set, and not changing it here, ignore it */
- if (baseFontURL == url) {
+ if (this.baseFontURL == url) {
return;
}
/* Otherwise warn the client that the change has been ignored */
@@ -283,7 +283,7 @@
}
protected URL getBaseFontURL() {
- return baseFontURL;
+ return this.baseFontURL;
}
/**
@@ -304,14 +304,14 @@
*/
public void setup(final URL fontConfigFile, final Map fontConfigOptions)
throws FontException {
- if (setupCompleted) {
+ if (this.setupCompleted) {
return;
}
getLogger().info("Setting up fonts.");
registerBase14Fonts();
registerAWTFonts();
readFontConfig(fontConfigFile);
- setupCompleted = true;
+ this.setupCompleted = true;
}
private void registerBase14Fonts() throws FontException {
@@ -414,7 +414,7 @@
final FontConfigParser parser =
new FontConfigParser(this, source);
parser.start();
- if (hasFatalConfigurationError) {
+ if (this.hasFatalConfigurationError) {
throw new FontException("Font Configuration has fatal error(s).");
}
}
@@ -431,7 +431,7 @@
this.graphic.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
}
- return graphic;
+ return this.graphic;
}
/**
@@ -469,7 +469,7 @@
+ name);
}
rff = new RegisteredFontFamily(this, name);
- fontFamilies.put(name, rff);
+ this.fontFamilies.put(name, rff);
return rff;
}
@@ -483,18 +483,18 @@
final String realFamily)
throws FontException {
final RegisteredFontFamily rff
- = (RegisteredFontFamily) fontFamilies.get(realFamily);
+ = (RegisteredFontFamily) this.fontFamilies.get(realFamily);
if (rff == null) {
throw new FontException("Font family " + realFamily
+ " not found. Can't register alias: " + alias);
}
- if (fontFamilyAliases.containsKey(alias)) {
+ if (this.fontFamilyAliases.containsKey(alias)) {
final RegisteredFontFamily family =
- (RegisteredFontFamily) fontFamilyAliases.get(alias);
+ (RegisteredFontFamily) this.fontFamilyAliases.get(alias);
throw new FontException("Alias " + alias
+ " already registered to family " + family.getName());
}
- fontFamilyAliases.put(alias, rff);
+ this.fontFamilyAliases.put(alias, rff);
}
/**
@@ -517,14 +517,14 @@
* @param using When true, FreeStanding fonts will be configured.
*/
public void setUsingFreeStandingFonts(final boolean using) {
- if (setupCompleted) {
- if (using != usingFreeStandingFonts) {
+ if (this.setupCompleted) {
+ if (using != this.usingFreeStandingFonts) {
getLogger().error("Font setup already completed. " +
"Ignoring setUsingFreeStandingFonts().");
}
return;
}
- usingFreeStandingFonts = using;
+ this.usingFreeStandingFonts = using;
}
/**
@@ -535,19 +535,19 @@
* @param using When true, System fonts will be configured.
*/
public void setUsingSystemFonts(final boolean using) {
- if (setupCompleted) {
- if (using != usingSystemFonts) {
+ if (this.setupCompleted) {
+ if (using != this.usingSystemFonts) {
getLogger().error("Font setup already completed. " +
"Ignoring setUsingFreeStandingFonts().");
}
return;
}
- usingSystemFonts = using;
+ this.usingSystemFonts = using;
}
protected void setFatalConfigurationError(final boolean hasError) {
if (hasError) {
- hasFatalConfigurationError = true;
+ this.hasFatalConfigurationError = true;
}
}
@@ -558,7 +558,7 @@
if (this.systemFontFamilyList == null) {
createSystemFontFamilyList();
}
- return systemFontFamilyList;
+ return this.systemFontFamilyList;
}
/**
@@ -640,7 +640,7 @@
* @return Returns the entityResolver.
*/
public EntityResolver getEntityResolver() {
- return entityResolver;
+ return this.entityResolver;
}
/**
* @param entityResolver The entityResolver to set.
@@ -698,7 +698,7 @@
*/
public String getFontFamilyForAlias(final String alias) {
final RegisteredFontFamily family =
- (RegisteredFontFamily) fontFamilyAliases.get(alias);
+ (RegisteredFontFamily) this.fontFamilyAliases.get(alias);
if (family == null) {
return null;
}
@@ -767,14 +767,14 @@
private boolean isUsableFont(final String systemName, final Object fontFile,
final Object metricsFile) {
- if (! usingFreeStandingFonts) {
+ if (! this.usingFreeStandingFonts) {
/* If not using FreeStandingFonts, then this font should not be
* registered unless it will be able to generate a SystemFont. */
if (systemName == null || systemName.equals("")) {
return false;
}
}
- if (! usingSystemFonts) {
+ if (! this.usingSystemFonts) {
/* If not using SystemFonts, then this font should not be
* registered unless it will be able to generate a FreeStandingFont.
*/
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSTrueTypeFont.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -60,7 +60,7 @@
throws IOException {
final Subset subset = fontUse.getSubset();
if (subset != null) {
- final TTFSubSetFile ttfSubset = new TTFSubSetFile(ttf, subset);
+ final TTFSubSetFile ttfSubset = new TTFSubSetFile(this.ttf, subset);
return ttfSubset.buildEmbeddableSubset();
}
final InputStream instream = getFontInputStream();
@@ -82,30 +82,30 @@
* sure this is right.
*/
fontComplexity = FOrayFont.FONT_COMPOSITE;
- this.postscriptName = stripWhiteSpace(ttf.getPostscriptName());
- this.fontName = ttf.getFontName();
- this.familyName = ttf.getFamilyName();
- capHeight = ttf.getCapHeight();
- xHeight = ttf.getXHeight();
- ascender = ttf.getLowerCaseAscent();
- descender = ttf.getLowerCaseDescent();
- fontBBox = ttf.getFontBBox();
- flags = ttf.getFlags();
- stemV = ttf.getStemV();
- italicAngle = ttf.getItalicAngle();
- numGlyphs = ttf.getNumGlyphs();
- this.internalEncoding = ttf.getCMaps();
- width = ttf.getWidths();
+ this.postscriptName = stripWhiteSpace(this.ttf.getPostscriptName());
+ this.fontName = this.ttf.getFontName();
+ this.familyName = this.ttf.getFamilyName();
+ capHeight = this.ttf.getCapHeight();
+ xHeight = this.ttf.getXHeight();
+ ascender = this.ttf.getLowerCaseAscent();
+ descender = this.ttf.getLowerCaseDescent();
+ this.fontBBox = this.ttf.getFontBBox();
+ flags = this.ttf.getFlags();
+ this.stemV = this.ttf.getStemV();
+ italicAngle = this.ttf.getItalicAngle();
+ numGlyphs = this.ttf.getNumGlyphs();
+ this.internalEncoding = this.ttf.getCMaps();
+ width = this.ttf.getWidths();
/*
* The last entry hMetrics entry in the hmtx table holds the default
* width for the remaining glyphs in the font.
*/
missingWidth = width[width.length - 1];
- kerning = ttf.getKerning();
+ kerning = this.ttf.getKerning();
- fontAllowsEmbedding = ttf.isEmbeddable();
- this.fontFormat = ttf.getFontFormat();
+ fontAllowsEmbedding = this.ttf.isEmbeddable();
+ this.fontFormat = this.ttf.getFontFormat();
}
private String stripWhiteSpace(final String s) {
@@ -123,11 +123,11 @@
}
public int[] getFontBBox() {
- return fontBBox;
+ return this.fontBBox;
}
public int getStemV() {
- return stemV;
+ return this.stemV;
}
public byte getFontFormat() {
Modified: trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FSType1Font.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -89,30 +89,30 @@
public void parseFont() throws FontException {
final MetricsFileReader reader = this.getRegisteredFont()
.getMetricsFileReader();
- metricsFile = reader.metricsFileFactory();
- if (metricsFile == null) {
+ this.metricsFile = reader.metricsFileFactory();
+ if (this.metricsFile == null) {
throw new FontException("Unknown Metric Format: "
+ reader.getDescription());
}
- if (metricsFile.getInternalEncoding() == null) {
+ if (this.metricsFile.getInternalEncoding() == null) {
throw new FontException("Unusable Internal Encoding: "
+ reader.getDescription());
}
fontComplexity = FOrayFont.FONT_SIMPLE;
- this.postscriptName = metricsFile.getPostscriptName();
- this.fontName = metricsFile.getFontName();
- this.familyName = metricsFile.getFontFamilyName();
- capHeight = metricsFile.getCapHeight();
- xHeight = metricsFile.getXHeight();
- ascender = metricsFile.getLowerCaseAscent();
- descender = metricsFile.getLowerCaseDescent();
- flags = metricsFile.getFlags();
- italicAngle = metricsFile.getItalicAngle();
+ this.postscriptName = this.metricsFile.getPostscriptName();
+ this.fontName = this.metricsFile.getFontName();
+ this.familyName = this.metricsFile.getFontFamilyName();
+ capHeight = this.metricsFile.getCapHeight();
+ xHeight = this.metricsFile.getXHeight();
+ ascender = this.metricsFile.getLowerCaseAscent();
+ descender = this.metricsFile.getLowerCaseDescent();
+ flags = this.metricsFile.getFlags();
+ italicAngle = this.metricsFile.getItalicAngle();
- width = metricsFile.getCharWidths();
- this.internalEncoding = metricsFile.getInternalEncoding();
+ width = this.metricsFile.getCharWidths();
+ this.internalEncoding = this.metricsFile.getInternalEncoding();
- kerning = metricsFile.getKerning();
+ kerning = this.metricsFile.getKerning();
/*
* The following logic is per
@@ -125,7 +125,7 @@
/* If not already set, set the Encoding. */
if (this.internalEncoding == null) {
- final String encodingName = metricsFile.getEncoding();
+ final String encodingName = this.metricsFile.getEncoding();
EncodingVector encoding = null;
if (encodingName.equals("StandardEncoding")
|| encodingName.equals("AdobeStandardEncoding")) {
@@ -144,22 +144,22 @@
int[] bbox = null;
/* Check the AFM file first as that is the cleanest and most
* efficient. */
- if (metricsFile instanceof MetricsFileAFM) {
- bbox = metricsFile.getFontBBox();
+ if (this.metricsFile instanceof MetricsFileAFM) {
+ bbox = this.metricsFile.getFontBBox();
}
if (bbox != null) {
return bbox;
}
/* The next best thing is to get it from the Font file itself. */
- if (type1File != null) {
- bbox = type1File.getFontBBox();
+ if (this.type1File != null) {
+ bbox = this.type1File.getFontBBox();
}
if (bbox != null) {
return bbox;
}
/* If all else fails, use the estimate from the PFM. */
- if (metricsFile != null) {
- bbox = metricsFile.getFontBBox();
+ if (this.metricsFile != null) {
+ bbox = this.metricsFile.getFontBBox();
}
return bbox;
}
@@ -168,22 +168,22 @@
int stemV = 0;
/* Check the AFM file first as that is the cleanest and most
* efficient. */
- if (metricsFile instanceof MetricsFileAFM) {
- stemV = metricsFile.getStemV();
+ if (this.metricsFile instanceof MetricsFileAFM) {
+ stemV = this.metricsFile.getStemV();
}
if (stemV != 0) {
return stemV;
}
/* The next best thing is to get it from the Font file itself. */
- if (type1File != null) {
- stemV = type1File.getStemV();
+ if (this.type1File != null) {
+ stemV = this.type1File.getStemV();
}
if (stemV != 0) {
return stemV;
}
/* If all else fails, use the estimate from the PFM. */
- if (metricsFile != null) {
- stemV = metricsFile.getStemV();
+ if (this.metricsFile != null) {
+ stemV = this.metricsFile.getStemV();
}
return stemV;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontConfig.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontConfig.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontConfig.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -315,14 +315,14 @@
* @return Returns the failureCount.
*/
public int getFailureCount() {
- return failureCount;
+ return this.failureCount;
}
/**
* @return Returns the successCount.
*/
public int getSuccessCount() {
- return successCount;
+ return this.successCount;
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontConfigParser.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -153,7 +153,7 @@
* intantiates parser and starts parsing of config file
*/
public void start() throws FontException {
- final XMLReader parser = createParser(fontServer);
+ final XMLReader parser = createParser(this.fontServer);
/* Turn on validation if it is available. */
try {
parser.setFeature("http://xml.org/sax/features/validation", true);
@@ -165,7 +165,7 @@
parser.setContentHandler(this);
try {
- parser.parse(filename);
+ parser.parse(this.filename);
} catch (final SAXException e) {
if (e.getException() instanceof FontException) {
throw (FontException) e.getException();
@@ -277,7 +277,7 @@
logError("font-family-alias entry invalid. " + "Ignored.");
} else {
try {
- fontServer.registerFontFamilyAlias(alias, family);
+ this.fontServer.registerFontFamilyAlias(alias, family);
} catch (final FontException e) {
logError(e.getMessage());
}
@@ -352,12 +352,13 @@
}
try {
this.currentFontFamily
- = fontServer.registerFontFamily2(name);
+ = this.fontServer.registerFontFamily2(name);
} catch (final FontException e) {
/* Log a warning. */
logWarning(e.getMessage());
/* Use the existing font family if you can. */
- this.currentFontFamily = fontServer.getRegisteredFontFamily(name);
+ this.currentFontFamily = this.fontServer.getRegisteredFontFamily(
+ name);
return;
}
this.currentSimulateSmallCaps = attributes.getValue(
@@ -380,7 +381,7 @@
+ " AND " + xmlBase);
}
}
- fontIdCounter = 0;
+ this.fontIdCounter = 0;
}
/**
@@ -389,15 +390,15 @@
private void parseElementServer(final Attributes attributes) {
if (attributes.getValue("setup-free-standing-fonts")
.equalsIgnoreCase("true")) {
- fontServer.setUsingFreeStandingFonts(true);
+ this.fontServer.setUsingFreeStandingFonts(true);
} else {
- fontServer.setUsingFreeStandingFonts(false);
+ this.fontServer.setUsingFreeStandingFonts(false);
}
if (attributes.getValue("setup-system-fonts")
.equalsIgnoreCase("true")) {
- fontServer.setUsingSystemFonts(true);
+ this.fontServer.setUsingSystemFonts(true);
} else {
- fontServer.setUsingSystemFonts(false);
+ this.fontServer.setUsingSystemFonts(false);
}
}
@@ -448,7 +449,7 @@
simulateOblique,
simulateBackslant,
simulateStretch);
- fontIdCounter++;
+ this.fontIdCounter++;
}
/**
@@ -482,7 +483,7 @@
+ " " + fontFile);
/* TODO: Just invalidate this one font and warn the user instead
* of invalidating everything. */
- fontServer.setFatalConfigurationError(true);
+ this.fontServer.setFatalConfigurationError(true);
}
}
@@ -496,7 +497,7 @@
+ " " + metricsFile);
/* TODO: Just invalidate this one font and warn the user instead
* of invalidating everything. */
- fontServer.setFatalConfigurationError(true);
+ this.fontServer.setFatalConfigurationError(true);
}
}
@@ -514,12 +515,12 @@
if (this.currentFontFamilyMember.style != null) {
name.append(this.currentFontFamilyMember.style);
}
- name.append(fontIdCounter);
+ name.append(this.fontIdCounter);
fontID = name.toString();
}
try {
- fontServer.registerFont(fontID, fontFileURL, metricsFileURL,
- collectionID, embed, systemName);
+ this.fontServer.registerFont(fontID, fontFileURL,
+ metricsFileURL, collectionID, embed, systemName);
} catch (final FontException e) {
this.logError(e.getMessage());
return;
@@ -596,10 +597,10 @@
return;
}
if (localName.equals("font-family")) {
- currentSimulateSmallCaps = null;
- currentEncoding = null;
- currentXMLBase = previousXMLBase;
- currentEmbed = previousEmbed;
+ this.currentSimulateSmallCaps = null;
+ this.currentEncoding = null;
+ this.currentXMLBase = this.previousXMLBase;
+ this.currentEmbed = this.previousEmbed;
return;
}
if (localName.equals("font-description")) {
@@ -713,8 +714,8 @@
return;
}
final int radix = Integer.parseInt(radixString);
- final EncodingParser parser = new EncodingParser(fontServer.getLogger(),
- reader, columnNumber, radix,
+ final EncodingParser parser = new EncodingParser(
+ this.fontServer.getLogger(), reader, columnNumber, radix,
attributes.getValue("glyph-lists"));
try {
parser.parseList();
@@ -762,7 +763,7 @@
return;
}
final GlyphListParser parser = new GlyphListParser(
- fontServer.getLogger(), reader);
+ this.fontServer.getLogger(), reader);
try {
parser.parseList();
} catch (final IOException e2) {
@@ -782,7 +783,7 @@
final Iterator iter = this.parameters.keySet().iterator();
while (iter.hasNext()) {
final String key = (String) iter.next();
- final String value = (String) parameters.get(key);
+ final String value = (String) this.parameters.get(key);
boolean anyChanges = true;
while (anyChanges) {
/* Regex would be more fun here, but throws exceptions on some
@@ -814,9 +815,9 @@
if (this.locator == null) {
return null;
}
- return " Context: " + locator.getSystemId() + "\n"
- + " (Line " + locator.getLineNumber() + ", Column "
- + locator.getColumnNumber() + ")";
+ return " Context: " + this.locator.getSystemId() + "\n"
+ + " (Line " + this.locator.getLineNumber() + ", Column "
+ + this.locator.getColumnNumber() + ")";
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -123,8 +123,9 @@
* @return The name of the font.
*/
public String getPostscriptName() {
- if (postscriptName != null && ! postscriptName.equals("")) {
- return postscriptName;
+ if (this.postscriptName != null
+ && ! this.postscriptName.equals("")) {
+ return this.postscriptName;
}
return getRegisteredFont().getConfiguredFontName();
}
@@ -135,7 +136,7 @@
public int getAscender(final int fontSize) {
/* Since both size and ascender are in millipoints, divide by 1000
* to keep result in millipoints */
- final int value = fontSize * ascender / 1000;
+ final int value = fontSize * this.ascender / 1000;
return value;
}
@@ -145,7 +146,7 @@
public int getDescender(final int fontSize) {
/* Since both size and descender are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * descender / 1000;
+ return fontSize * this.descender / 1000;
}
/**
@@ -154,7 +155,7 @@
public int getCapHeight(final int fontSize) {
/* Since both size and capHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * capHeight / 1000;
+ return fontSize * this.capHeight / 1000;
}
/**
@@ -163,20 +164,20 @@
public int getXHeight(final int fontSize) {
/* Since both size and xHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * xHeight / 1000;
+ return fontSize * this.xHeight / 1000;
}
public abstract int[] getFontBBox();
public int getFlags() {
- return flags;
+ return this.flags;
}
/**
* {@inheritDoc}
*/
public float getItalicAngle() {
- return italicAngle;
+ return this.italicAngle;
}
/**
@@ -191,7 +192,7 @@
* a text space unit.
*/
public int getDefaultWidth() {
- return missingWidth;
+ return this.missingWidth;
}
/**
@@ -207,7 +208,7 @@
*/
public boolean isEmbeddable() {
/* Don't allow embedding if the font file itself prohibits it. */
- if (! fontAllowsEmbedding) {
+ if (! this.fontAllowsEmbedding) {
return false;
}
/* Don't try to embed unless we have been told to. */
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFont.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -166,10 +166,10 @@
}
private void createFreeStandingFont() {
- if (fsFontCreationCompleted) {
+ if (this.fsFontCreationCompleted) {
return;
}
- fsFontCreationCompleted = true;
+ this.fsFontCreationCompleted = true;
if (! this.hasFreeStandingFont()) {
/* We do not have what is needed to create a FreeStandingFont. */
@@ -181,19 +181,19 @@
if (this.fsFont == null) {
this.fsFont = getFontServer().getDefaultFreeStandingFont()
.getRegisteredFont().fsFont;
- getLogger().error("Unable to open font " + configuredFontName
- + ".");
+ getLogger().error("Unable to open font "
+ + this.configuredFontName + ".");
getLogger().error("Using a default font instead.");
return;
}
if (this.embedding && ! this.fsFont.fontAllowsEmbedding) {
- getLogger().warn("Font " + configuredFontName
+ getLogger().warn("Font " + this.configuredFontName
+ " does not allow embedding.");
}
} catch (final Exception ex) {
getLogger().error("Failed to create font object "
+ "for: "
- + configuredFontName);
+ + this.configuredFontName);
getLogger().error(ex.getMessage());
}
}
@@ -222,7 +222,7 @@
* font, but not a font file, therefore it is Type 1. */
this.fontFormat = FOrayFont.FORMAT_TYPE1;
} else {
- this.fontFormat = fontFileReader.getFontFormat();
+ this.fontFormat = this.fontFileReader.getFontFormat();
}
switch (this.fontFormat) {
case FOrayFont.FORMAT_TYPE1: {
@@ -234,7 +234,7 @@
return new FSTrueTypeFont(this);
}
}
- throw new FontException("Font " + configuredFontName
+ throw new FontException("Font " + this.configuredFontName
+ " is an unknown format.");
}
@@ -268,11 +268,11 @@
}
protected MetricsFileReader getMetricsFileReader() {
- return metricsFile;
+ return this.metricsFile;
}
protected String getTTCName() {
- return ttcName;
+ return this.ttcName;
}
public FOrayFontServer getFontServer() {
@@ -287,28 +287,28 @@
* @return Returns the configuredFontName.
*/
public String getConfiguredFontName() {
- return configuredFontName;
+ return this.configuredFontName;
}
/**
* @return Returns the embedding.
*/
public boolean isEmbedding() {
- return embedding;
+ return this.embedding;
}
/**
* @return Returns the subsetting.
*/
public boolean isSubsetting() {
- return subsetting;
+ return this.subsetting;
}
/**
* @return Returns the reader.
*/
public FontFileReader getFontFileReader() {
- return fontFileReader;
+ return this.fontFileReader;
}
public boolean hasFreeStandingFont() {
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontDesc.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -96,8 +96,8 @@
*/
private float simulateStretch[] = new float[8];
{
- for (int i = 0; i < simulateStretch.length; i++) {
- simulateStretch[i] = Float.NaN;
+ for (int i = 0; i < this.simulateStretch.length; i++) {
+ this.simulateStretch[i] = Float.NaN;
}
}
@@ -121,13 +121,13 @@
* @return Returns the fontStyle.
*/
public byte getFontStyle() {
- return fontStyle;
+ return this.fontStyle;
}
/**
* @return Returns the fontWeight.
*/
public short getFontWeight() {
- return fontWeight;
+ return this.fontWeight;
}
public byte getFontVariant() {
@@ -159,7 +159,7 @@
}
public float getSimulateBackslant() {
- return simulateBackslant;
+ return this.simulateBackslant;
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/RegisteredFontFamily.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -138,9 +138,9 @@
description.setSimulateOblique(simulatedOblique);
description.setSimulateBackslant(simulatedBackslant);
description.setSimulateStretch(simulatedStretch);
- for (int i = 0; i < fontDescriptions.size(); i++) {
+ for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc registeredDesc
- = (RegisteredFontDesc) fontDescriptions.get(i);
+ = (RegisteredFontDesc) this.fontDescriptions.get(i);
if (description.equivalent(registeredDesc)) {
throw new FontException("Equivalent font-description "
+ "already exists in font-family \""
@@ -152,7 +152,7 @@
.getFontWeight()));
}
}
- fontDescriptions.add(description);
+ this.fontDescriptions.add(description);
}
/**
@@ -170,9 +170,9 @@
final boolean freeStandingFonts, final boolean systemFonts) {
/* First, look for a perfect match without considering simulated
* features. */
- for (int i = 0; i < fontDescriptions.size(); i++) {
+ for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc fd = (RegisteredFontDesc)
- fontDescriptions.get(i);
+ this.fontDescriptions.get(i);
if (fd.matchPerfect(this, false, style, weight, variant, stretch,
freeStandingFonts, systemFonts)) {
return fd;
@@ -180,9 +180,9 @@
}
/* Next, look for a perfect match that does consider the simulated
* features. */
- for (int i = 0; i < fontDescriptions.size(); i++) {
+ for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc fd = (RegisteredFontDesc)
- fontDescriptions.get(i);
+ this.fontDescriptions.get(i);
if (fd.matchPerfect(this, true, style, weight, variant, stretch,
freeStandingFonts, systemFonts)) {
return fd;
@@ -197,9 +197,9 @@
* If there are any, select the one whose weight comes closest to the
* requested value. */
RegisteredFontDesc bestMatch = null;
- for (int i = 0; i < fontDescriptions.size(); i++) {
+ for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc fd = (RegisteredFontDesc)
- fontDescriptions.get(i);
+ this.fontDescriptions.get(i);
if (fd.matchIgnoreWeight(this, false, style, variant, stretch,
freeStandingFonts, systemFonts)) {
if (bestMatch == null) {
@@ -231,7 +231,7 @@
RegisteredFontDesc best = null;
for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc candidate
- = (RegisteredFontDesc) fontDescriptions.get(i);
+ = (RegisteredFontDesc) this.fontDescriptions.get(i);
// Ignore the baseline.
if (candidate == baseline) {
continue;
@@ -262,7 +262,7 @@
RegisteredFontDesc best = null;
for (int i = 0; i < this.fontDescriptions.size(); i++) {
final RegisteredFontDesc candidate
- = (RegisteredFontDesc) fontDescriptions.get(i);
+ = (RegisteredFontDesc) this.fontDescriptions.get(i);
// Ignore the baseline.
if (candidate == baseline) {
continue;
Modified: trunk/foray/foray-font/src/java/org/foray/font/charset/CharSet.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/charset/CharSet.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/charset/CharSet.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -177,7 +177,7 @@
*/
public static CharSet getRegisteredCharSet(final String name) {
// If already instantiated, return it.
- CharSet charSet = (CharSet) registeredCharSets.get(name);
+ CharSet charSet = (CharSet) CharSet.registeredCharSets.get(name);
if (charSet != null) {
return charSet;
}
@@ -190,7 +190,7 @@
if (charSet == null) {
return null;
}
- registeredCharSets.put(name, charSet);
+ CharSet.registeredCharSets.put(name, charSet);
return charSet;
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/charset/CharSetParser.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/charset/CharSetParser.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/charset/CharSetParser.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -85,10 +85,10 @@
private int countLines() throws IOException {
int count = 0;
- reader.seek(0);
+ this.reader.seek(0);
boolean endOfFile = false;
while (! endOfFile) {
- final String currentLine = reader.readLine();
+ final String currentLine = this.reader.readLine();
if (currentLine == null) {
endOfFile = true;
break;
@@ -104,12 +104,12 @@
* @throws IOException
*/
private void parseLines() throws IOException {
- reader.seek(0);
+ this.reader.seek(0);
boolean endOfFile = false;
endOfFile = false;
int arrayIndex = 0;
while (! endOfFile) {
- final String currentLine = reader.readLine();
+ final String currentLine = this.reader.readLine();
this.currentLineNumber++;
if (currentLine == null) {
endOfFile = true;
@@ -142,7 +142,7 @@
final GlyphList gl = GlyphList.getGlyphList("AGL");
final char theChar = gl.mapGlyphNameToCodePoint(line);
if (theChar == 0xFFFF) {
- logger.error("Character not found in Adobe Glyph List, line "
+ this.logger.error("Character not found in Adobe Glyph List, line "
+ this.currentLineNumber + ": " + line);
}
@@ -155,15 +155,15 @@
while (anyChanges) {
anyChanges = false;
for (int i = 0; i < this.characterSet.length - 1; i++) {
- if (characterSet[i] > characterSet[i + 1]) {
+ if (this.characterSet[i] > this.characterSet[i + 1]) {
/* They are out of order. Switch the corresponding elements
* in both arrays. */
- final char storeChar = characterSet[i];
- characterSet[i] = characterSet[i + 1];
- characterSet[i + 1] = storeChar;
- final String storeString = glyphNames[i];
- glyphNames[i] = glyphNames[i + 1];
- glyphNames[i + 1] = storeString;
+ final char storeChar = this.characterSet[i];
+ this.characterSet[i] = this.characterSet[i + 1];
+ this.characterSet[i + 1] = storeChar;
+ final String storeString = this.glyphNames[i];
+ this.glyphNames[i] = this.glyphNames[i + 1];
+ this.glyphNames[i + 1] = storeString;
anyChanges = true;
}
}
@@ -191,17 +191,17 @@
out.write(s.getBytes());
s = " public static final char[] characterSet = {\n";
out.write(s.getBytes());
- for (int i = 0; i < characterSet.length; i++) {
+ for (int i = 0; i < this.characterSet.length; i++) {
s = " 0x";
- s = s + StringUtil.charToHexString(characterSet[i], true, 4);
- if (i < characterSet.length - 1) {
+ s = s + StringUtil.charToHexString(this.characterSet[i], true, 4);
+ if (i < this.characterSet.length - 1) {
s = s + ",";
} else {
s = s + " ";
}
s = s + " // " + EncodingParser.formatArrayIndex(i);
s = EncodingParser.padSpaces(s, 28, 2);
- s = s + glyphNames[i];
+ s = s + this.glyphNames[i];
s = s + "\n";
out.write(s.getBytes());
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/FontFile.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/FontFile.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/FontFile.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -40,7 +40,7 @@
}
protected FontFileReader getReader() {
- return reader;
+ return this.reader;
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/FontFileReader.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -68,7 +68,7 @@
/** Set to one of the Font.FORMAT constants. */
private byte fontFormat = FOrayFont.FORMAT_UNKNOWN;
/** Set to one of the FILEFORMAT constants. */
- private byte fileFormat = FILEFORMAT_UNKNOWN;
+ private byte fileFormat = FontFileReader.FILEFORMAT_UNKNOWN;
private Log logger;
@@ -107,8 +107,8 @@
tag = readString(18, CHAR_ENCODE_US_ASCII);
if (tag.startsWith("%!FontType1-1.0")
|| tag.equals("%!PS-AdobeFont-1.0")) {
- fontFormat = FOrayFont.FORMAT_TYPE1;
- fileFormat = FILEFORMAT_TYPE1_PFA;
+ this.fontFormat = FOrayFont.FORMAT_TYPE1;
+ this.fileFormat = FontFileReader.FILEFORMAT_TYPE1_PFA;
return;
}
// Type1 Font (PC or PFB Format)
@@ -119,8 +119,8 @@
tag = readString(18, CHAR_ENCODE_US_ASCII);
if (tag.startsWith("%!FontType1-1.0")
|| tag.equals("%!PS-AdobeFont-1.0")) {
- fontFormat = FOrayFont.FORMAT_TYPE1;
- fileFormat = FILEFORMAT_TYPE1_PFB;
+ this.fontFormat = FOrayFont.FORMAT_TYPE1;
+ this.fileFormat = FontFileReader.FILEFORMAT_TYPE1_PFB;
return;
}
}
@@ -128,35 +128,35 @@
seek(0);
sfntVersion = readInt();
if (sfntVersion == 0x00010000) {
- fontFormat = FOrayFont.FORMAT_TRUETYPE;
- fileFormat = FILEFORMAT_TTF_SINGLEFONT;
+ this.fontFormat = FOrayFont.FORMAT_TRUETYPE;
+ this.fileFormat = FontFileReader.FILEFORMAT_TTF_SINGLEFONT;
return;
}
// TrueType Collection (multiple fonts)
seek(0);
tag = readString(4, CHAR_ENCODE_US_ASCII);
if (tag.equals("ttcf")) {
- fontFormat = FOrayFont.FORMAT_TRUETYPE;
- fileFormat = FILEFORMAT_TTF_COLLECTION;
+ this.fontFormat = FOrayFont.FORMAT_TRUETYPE;
+ this.fileFormat = FontFileReader.FILEFORMAT_TTF_COLLECTION;
return;
}
// OpenType Font with CFF data
seek(0);
tag = readString(4, CHAR_ENCODE_US_ASCII);
if (tag.equals("OTTO")) {
- fontFormat = FOrayFont.FORMAT_OTF_CFF;
- fileFormat = FILEFORMAT_OTF_CFF;
+ this.fontFormat = FOrayFont.FORMAT_OTF_CFF;
+ this.fileFormat = FontFileReader.FILEFORMAT_OTF_CFF;
return;
}
throw new IOException("Unsupported Font File Format.");
}
public byte getFontFormat() {
- return fontFormat;
+ return this.fontFormat;
}
public byte getFileFormat() {
- return fileFormat;
+ return this.fileFormat;
}
/**
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/Kerning.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -146,7 +146,7 @@
}
this.lastIndex++;
if (this.lastIndex >= this.firstChars32.length) {
- addCapacity(ARRAY_SIZE_INCREMENT);
+ addCapacity(Kerning.ARRAY_SIZE_INCREMENT);
}
this.firstChars32[this.lastIndex] = char1;
this.secondChars32[this.lastIndex] = char2;
@@ -182,8 +182,8 @@
return 0;
}
int index = 0;
- if (char1 > MAX_16_BIT_CHAR
- || char2 > MAX_16_BIT_CHAR) {
+ if (char1 > Kerning.MAX_16_BIT_CHAR
+ || char2 > Kerning.MAX_16_BIT_CHAR) {
/* Look in the 32-bit pairs. */
index = indexOfKerningPair32(char1, char2);
if (index < 0) {
@@ -200,7 +200,7 @@
}
public boolean isEmpty() {
- return lastIndex < 0;
+ return this.lastIndex < 0;
}
private void sortKerning() {
@@ -210,24 +210,24 @@
boolean anyChanges = true;
while (anyChanges) {
anyChanges = false;
- for (int i = 0; i < firstChars32.length - 1; i++) {
+ for (int i = 0; i < this.firstChars32.length - 1; i++) {
boolean switchNeeded = false;
- if (firstChars32[i] > firstChars32[i + 1]) {
+ if (this.firstChars32[i] > this.firstChars32[i + 1]) {
switchNeeded = true;
- } else if (firstChars32[i] == firstChars32[i + 1]) {
- if (secondChars32[i] > secondChars32[i + 1]) {
+ } else if (this.firstChars32[i] == this.firstChars32[i + 1]) {
+ if (this.secondChars32[i] > this.secondChars32[i + 1]) {
switchNeeded = true;
}
}
if (switchNeeded) {
/* They are out of order. Reverse these two elements in
* all three arrays. Start with firstChars. */
- int saveChar = firstChars32[i];
- firstChars32[i] = firstChars32[i + 1];
- firstChars32[i + 1] = saveChar;
+ int saveChar = this.firstChars32[i];
+ this.firstChars32[i] = this.firstChars32[i + 1];
+ this.firstChars32[i + 1] = saveChar;
/* Now reverse secondChars. */
- saveChar = secondChars32[i];
- secondChars32[i] = this.secondChars32[i + 1];
+ saveChar = this.secondChars32[i];
+ this.secondChars32[i] = this.secondChars32[i + 1];
this.secondChars32[i + 1] = saveChar;
/* Now reverse the kerning amounts. */
final short saveShort = this.kernAmount32[i];
@@ -244,8 +244,8 @@
/* Count the 32-bit items. */
int index32bits = 0;
for (int i = 0; i < this.lastIndex; i++) {
- if (this.firstChars32[i] > MAX_16_BIT_CHAR
- || this.secondChars32[i] > MAX_16_BIT_CHAR) {
+ if (this.firstChars32[i] > Kerning.MAX_16_BIT_CHAR
+ || this.secondChars32[i] > Kerning.MAX_16_BIT_CHAR) {
index32bits ++;
}
}
@@ -272,8 +272,8 @@
index16bits = 0;
index32bits = 0;
for (int i = 0; i < this.lastIndex; i++) {
- if (tempFirstChars32[i] > MAX_16_BIT_CHAR
- || tempSecondChars32[i] > MAX_16_BIT_CHAR) {
+ if (tempFirstChars32[i] > Kerning.MAX_16_BIT_CHAR
+ || tempSecondChars32[i] > Kerning.MAX_16_BIT_CHAR) {
this.firstChars32[index32bits] = tempFirstChars32[i];
this.secondChars32[index32bits] = tempSecondChars32[i];
this.kernAmount32[index32bits] = tempKernAmount32[i];
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFile.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFile.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFile.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -119,7 +119,7 @@
* Return the kerning table.
*/
public Kerning getKerning() {
- return kerningTab;
+ return this.kerningTab;
}
/**
@@ -128,7 +128,7 @@
* @return The Postscript name.
*/
public String getPostscriptName() {
- return postscriptName;
+ return this.postscriptName;
}
/**
@@ -143,7 +143,7 @@
* @return The CapHeight parameter.
*/
public int getCapHeight() {
- return etmCapHeight;
+ return this.etmCapHeight;
}
/**
@@ -152,7 +152,7 @@
* @return The CapHeight parameter.
*/
public int getXHeight() {
- return etmXHeight;
+ return this.etmXHeight;
}
/**
@@ -162,7 +162,7 @@
* @return The LowerCaseAscent parameter.
*/
public int getLowerCaseAscent() {
- return etmLowerCaseAscent;
+ return this.etmLowerCaseAscent;
}
/**
@@ -191,13 +191,13 @@
final int[] bbox = new int[4];
// Just guessing....
- if (!getIsProportional() && (dfAvgWidth == dfMaxWidth)) {
+ if (!getIsProportional() && (this.dfAvgWidth == this.dfMaxWidth)) {
bbox[0] = -20;
} else {
bbox[0] = -100;
}
bbox[1] = -(getLowerCaseDescent() + 5);
- bbox[2] = dfMaxWidth + 10;
+ bbox[2] = this.dfMaxWidth + 10;
bbox[3] = getLowerCaseAscent() + 5;
return bbox;
}
@@ -213,19 +213,19 @@
if (!getIsProportional()) {
flags = setBit(flags, 1);
}
- if ((dfPitchAndFamily & 16) == 16) {
+ if ((this.dfPitchAndFamily & 16) == 16) {
flags = setBit(flags, 2);
}
if (isPDFSymbolic()) {
flags = setBit(flags, 3);
}
- if ((dfPitchAndFamily & 64) == 64) {
+ if ((this.dfPitchAndFamily & 64) == 64) {
flags = setBit(flags, 4);
}
if (! isPDFSymbolic()) {
flags = setBit(flags, 6);
}
- if (dfItalic != 0) {
+ if (this.dfItalic != 0) {
flags = setBit(flags, 7);
}
return flags;
@@ -262,11 +262,11 @@
* upright.
*/
public float getItalicAngle() {
- return etmSlant;
+ return this.etmSlant;
}
public Log getLogger() {
- return reader.getLogger();
+ return this.reader.getLogger();
}
public short[] getCharWidths() {
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2006-09-11 01:55:14 UTC (rev 8047)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2006-09-11 01:56:21 UTC (rev 8048)
@@ -348,29 +348,29 @@
*/
public void load() throws IOException {
reader.seek(0);
- while (! endOfFile) {
- currentLine = reader.readLine();
- if (currentLine == null) {
- endOfFile = true;
+ while (! this.endOfFile) {
+ this.currentLine = reader.readLine();
+ if (this.currentLine == null) {
+ this.endOfFile = true;
return;
}
this.currentLineNumber++;
- currentTokenizer = new StringTokenizer(currentLine);
+ this.currentTokenizer = new StringTokenizer(this.currentLine);
processCurrentLine();
}
}
private void processCurrentLine() {
- if (! currentTokenizer.hasMoreTokens()) {
+ if (! this.currentTokenizer.hasMoreTokens()) {
// Blank line
return;
}
- doneWithLine = false;
- while (! doneWithLine) {
+ this.doneWithLine = false;
+ while (! this.doneWithLine) {
processNextToken();
}
- if (inCharMetrics
- && this.currentKey != KW_START_CHAR_METRICS) {
+ if (this.inCharMetrics
+ && this.currentKey != MetricsFileAFM.KW_START_CHAR_METRICS) {
/* Individual character metrics are one per line (Section 8). */
addIndividualChar();
resetIndividualChar();
@@ -378,330 +378,331 @@
}
private void processNextToken() {
- if (! currentTokenizer.hasMoreTokens()) {
- doneWithLine = true;
+ if (! this.currentTokenizer.hasMoreTokens()) {
+ this.doneWithLine = true;
return;
}
- currentKeyWord = currentTokenizer.nextToken();
- currentKey = (byte) Arrays.binarySearch(KEYWORDS, ...
[truncated message content] |