[FOray-commit] SF.net SVN: foray: [7922] trunk/foray/foray-font/src/java/org/foray/font
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-05 23:49:50
|
Revision: 7922
http://svn.sourceforge.net/foray/?rev=7922&view=rev
Author: victormote
Date: 2006-09-05 16:49:41 -0700 (Tue, 05 Sep 2006)
Log Message:
-----------
Conform to standard class-ordering scheme, as reported by checkstyle.
Modified Paths:
--------------
trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java
trunk/foray/foray-font/src/java/org/foray/font/Subset.java
trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.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/TTFSubSetFile.java
trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableNAME.java
trunk/foray/foray-font/src/java/org/foray/font/format/Type1File.java
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-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -89,9 +89,9 @@
private boolean setupCompleted = false;
- protected boolean usingFreeStandingFonts = true;
+ private boolean usingFreeStandingFonts = true;
- protected boolean usingSystemFonts = false;
+ private boolean usingSystemFonts = false;
private boolean hasFatalConfigurationError = false;
Modified: trunk/foray/foray-font/src/java/org/foray/font/Subset.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/Subset.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/Subset.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -78,7 +78,7 @@
* The number of subset glyphs used so far. It should be incremented after
* creating new subset glyphs.
*/
- int qtyGlyphs = 0;
+ private int qtyGlyphs = 0;
/**
* Constructor.
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-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/MetricsFileAFM.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -279,7 +279,7 @@
private String charSetString;
/** The "UniqueID" field parsed from a Comment line, if any. */
- protected String uniqueID;
+ private String uniqueID;
/* End Items Parsed from the AFM File */
@@ -310,16 +310,16 @@
* This array is created as the metrics file is parsed, and is then used
* later to create {@link #internalEncoding}.</p>
*/
- protected char[] internalCodePoints;
+ private char[] internalCodePoints;
/**
* Array parallel to {@link #internalCodePoints} and containing the
* encoded indexes that correspond to the elements therein.
*/
- protected char[] internalCodePointIndexes;
+ private char[] internalCodePointIndexes;
/** The number of internalCodePoint elements parsed so far. */
- protected int internalCodePointCount = 0;
+ private int internalCodePointCount = 0;
/**
* This font's internalEncoding, as parsed from its metrics file.
@@ -329,9 +329,9 @@
* first character is at index 5, an index that is not included in the
* EncodingScheme listed, "AdobeStandardEncoding".</p>
*/
- protected EncodingVector internalEncoding;
+ private EncodingVector internalEncoding;
- protected CharSet charSet;
+ private CharSet charSet;
public MetricsFileAFM(final MetricsFileReader reader) {
super(reader);
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFFileCollection.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFFileCollection.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFFileCollection.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -40,7 +40,7 @@
/** Collection of TTFTableDirectory entries. There should be one entry for
* each logical font in the TTC file. */
- TTFTableDirectory[] tableDirectories;
+ private TTFTableDirectory[] tableDirectories;
public TTFFileCollection(final FontFileReader reader) {
super(reader);
@@ -68,7 +68,7 @@
final TTFTableDirEntry tableDirEntry
= tableDir.getTableDirectoryEntry("name");
final TTFTableNAME nameTable = new TTFTableNAME(tableDirEntry);
- fontNames[i] = nameTable.fullName;
+ fontNames[i] = nameTable.getFullName();
}
return fontNames;
}
@@ -84,7 +84,7 @@
= tableDir.getTableDirectoryEntry("name");
reader.seek(tableDirEntry.getOffset());
final TTFTableNAME nameTable = new TTFTableNAME(tableDirEntry);
- if (nameTable.fullName.equals(fontName)) {
+ if (nameTable.getFullName().equals(fontName)) {
return tableDir.getTTFFont();
}
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFFont.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFFont.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFFont.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -80,6 +80,13 @@
}
/**
+ * Constructor suitable for creating an Font that is in the process of being
+ * built.
+ */
+ protected TTFFont() {
+ }
+
+ /**
* This method should never need to be used by anything except
* {@link TTFTableDirectory#getTTFFont()}, which ensures that there is a
* one-to-one relationship between TTFFont and TTFTableDirectory.
@@ -96,13 +103,6 @@
}
/**
- * Constructor suitable for creating an Font that is in the process of being
- * built.
- */
- protected TTFFont() {
- }
-
- /**
* Position inputstream to position indicated
* in the dirtab offset
*/
@@ -169,11 +169,11 @@
}
public void printStuff(final Log logger) {
- logger.info("Font name: " + nameTable.postscriptName);
- logger.info("Full name: " + nameTable.fullName);
- logger.info("Family name: " + nameTable.familyName);
- logger.info("Subfamily name: " + nameTable.subFamilyName);
- logger.info("Notice: " + nameTable.copyrightNotice);
+ logger.info("Font name: " + nameTable.getPostscriptName());
+ logger.info("Full name: " + nameTable.getFullName());
+ logger.info("Family name: " + nameTable.getFamilyName());
+ logger.info("Subfamily name: " + nameTable.getSubFamilyName());
+ logger.info("Notice: " + nameTable.getCopyrightNotice());
logger.info("xHeight: " + getXHeight());
logger.info("capheight: " + getCapHeight());
@@ -188,25 +188,25 @@
}
public String getPostscriptName() {
- if (nameTable.postscriptName != null) {
- return nameTable.postscriptName;
+ if (nameTable.getPostscriptName() != null) {
+ return nameTable.getPostscriptName();
}
// Note that the PostScript name usually is something like
// "Perpetua-Bold", but the TrueType spec says that in the ttf file
// it should be "Perpetua,Bold".
- if ("Regular".equals(nameTable.subFamilyName)
- || "Roman".equals(nameTable.subFamilyName)) {
- return nameTable.familyName;
+ if ("Regular".equals(nameTable.getSubFamilyName())
+ || "Roman".equals(nameTable.getSubFamilyName())) {
+ return nameTable.getFamilyName();
}
- return nameTable.familyName + "," + nameTable.subFamilyName;
+ return nameTable.getFamilyName() + "," + nameTable.getSubFamilyName();
}
public String getFamilyName() {
- return nameTable.familyName;
+ return nameTable.getFamilyName();
}
public String getFontName() {
- return nameTable.fullName;
+ return nameTable.getFullName();
}
public int getCapHeight() {
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFSubSetFile.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -46,6 +46,8 @@
*/
public class TTFSubSetFile {
+ private static final String ttfMessage = "TrueType warning: ";
+
/** The TTFFont that is being subsetted. */
private TTFFont ttfFont = null;
@@ -57,8 +59,6 @@
/** For convenience only. */
private FontFileReader in = null;
- private static final String ttfMessage = "TrueType warning: ";
-
/**
* List of the String names of each table in the font subset ("head",
* "hhea", etc.), stored in the order in which it should appear in the
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableNAME.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableNAME.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/TTFTableNAME.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -68,9 +68,15 @@
public static final String EMPTY_STRING = "";
- int offsetToStrings;
- int numNameRecords;
+ private int offsetToStrings;
+ private int numNameRecords;
+ private String copyrightNotice = "";
+ private String familyName = "";
+ private String subFamilyName = "";
+ private String fullName = "";
+ private String postscriptName = "";
+
/*
* The following 4 arrays are intended to be parallel and the represent the
* 4 components of the "key" to the name table.
@@ -80,12 +86,6 @@
private int[] languageArray;
private int[] nameArray;
- String copyrightNotice = "";
- String familyName = "";
- String subFamilyName = "";
- String fullName = "";
- String postscriptName = "";
-
TTFTableNAME (final TTFFont ttfFile) throws IOException {
super(ttfFile);
parseTable();
@@ -343,4 +343,39 @@
return "name";
}
+ /**
+ * @return Returns the postscriptName.
+ */
+ public String getPostscriptName() {
+ return this.postscriptName;
+ }
+
+ /**
+ * @return Returns the copyrightNotice.
+ */
+ public String getCopyrightNotice() {
+ return this.copyrightNotice;
+ }
+
+ /**
+ * @return Returns the familyName.
+ */
+ public String getFamilyName() {
+ return this.familyName;
+ }
+
+ /**
+ * @return Returns the fullName.
+ */
+ public String getFullName() {
+ return this.fullName;
+ }
+
+ /**
+ * @return Returns the subFamilyName.
+ */
+ public String getSubFamilyName() {
+ return this.subFamilyName;
+ }
+
}
Modified: trunk/foray/foray-font/src/java/org/foray/font/format/Type1File.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/format/Type1File.java 2006-09-05 23:37:00 UTC (rev 7921)
+++ trunk/foray/foray-font/src/java/org/foray/font/format/Type1File.java 2006-09-05 23:49:41 UTC (rev 7922)
@@ -52,6 +52,9 @@
protected static final byte NUM_DATA_SEGMENTS = 3;
+ /** The size of byte array that should be read from the file at one time. */
+ static final int chunkSize = 1024;
+
/**
* Stores the offsets in the data file to each of the segments. Note that
* the value stored here is the offset to the data portion of the segment,
@@ -72,21 +75,18 @@
private boolean detailParsed = false;
/** Tracks which of the three segments (0-2) is currently being parsed. */
- byte segmentBeingParsed = -1;
+ private byte segmentBeingParsed = -1;
- /** The size of byte array that should be read from the file at one time. */
- static final int chunkSize = 1024;
-
/** The offset to the last byte of the last chunk that was read. */
- long chunkEndOffset;
+ private long chunkEndOffset;
- protected PSDictionary fontDictionary = null;
- protected int[] fontBBox = null;
- protected int stemV = 0;
+ private PSDictionary fontDictionary = null;
+ private int[] fontBBox = null;
+ private int stemV = 0;
- PSInterpreter interpreter;
+ private PSInterpreter interpreter;
- EncryptFilter encryptFilter = new EncryptFilter(
+ private EncryptFilter encryptFilter = new EncryptFilter(
EncryptFilter.EEXEC_INITIAL_KEY,
EncryptFilter.EEXEC_RANDOM_BYTES);
@@ -362,4 +362,11 @@
return psObject.toString();
}
+ /**
+ * @return Returns the encryptFilter.
+ */
+ public EncryptFilter getEncryptFilter() {
+ return this.encryptFilter;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|