foray-commit Mailing List for FOray (Page 35)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2023-01-07 02:25:12
|
Revision: 13025
http://sourceforge.net/p/foray/code/13025
Author: victormote
Date: 2023-01-07 02:25:08 +0000 (Sat, 07 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Standardize spelling of "code point" and "codePoint".
Modified Paths:
--------------
trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
trunk/foray/foray-00-master/doc/javadoc/overview.html
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/XmlCharacterUtils.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NatLangParser.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NaturalLanguage.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/NumberUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04TtfEntry4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap12TtfEntry4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl3.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl4.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListParser.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListZapfDingbats.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/Block.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java
Modified: trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
===================================================================
--- trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2023-01-07 02:25:08 UTC (rev 13025)
@@ -362,6 +362,12 @@
<property name="message" value="Use "if and only if" instead of "iff"."/>
</module>
+ <module name="RegexpSinglelineJava">
+ <property name="ignoreComments" value="false"/>
+ <property name="format" value="[Cc]odepoint"/>
+ <property name="message" value="For consistency, use 'codePoint' or 'code point' instead of 'codepoint'."/>
+ </module>
+
<module name="MissingOverride"/>
</module>
Modified: trunk/foray/foray-00-master/doc/javadoc/overview.html
===================================================================
--- trunk/foray/foray-00-master/doc/javadoc/overview.html 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-00-master/doc/javadoc/overview.html 2023-01-07 02:25:08 UTC (rev 13025)
@@ -11,6 +11,20 @@
<p>In general, developers using FOray should write their code against the aXSL API instead of the FOray API.
See <a href="http://www.axsl.org" target="_new">The aXSL website</a> for more information.</p>
+<h3>Spelling Standards</h3>
+<p>Spelling standards should be documented in foray-00-master/config/checkstyle/checkstyle-config.xml.</p>
+<table>
+ <thead>
+ <th>Correct</th>
+ <th>Incorrect</th>
+ <th>Reason</th>
+ </thead>
+ <tr>
+ <td>codePoint</td>
+ <td>codepoint</td>
+ <td>Unicode Standard 14.0 and ISO-10646 consistently treat "code point" as two words.</td>
+</table>
+
</body>
</html>
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -480,8 +480,8 @@
/**
* Computes the width of a character, in millipoints.
- * @param c The Unicode codepoint whose width should be computed.
- * @return The width of the codepoint, in millipoints.
+ * @param c The Unicode code point whose width should be computed.
+ * @return The width of the code point, in millipoints.
*/
public int getCharWidth(final int c) {
final FontUse fontUse = traitNominalFont();
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -71,7 +71,7 @@
private static final int INITIAL_CAPACITY = 150;
/**
- * The default hyphenation character, Unicode codepoint 0x2010.
+ * The default hyphenation character, Unicode code point 0x2010.
* @see "XSL Recommendation 1.1, Section 1.2.1."
* @see "XSL Recommendation 1.1, Section 7.10.5."
*/
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -278,7 +278,7 @@
}
/**
- * Converts a CharSequence to a sequence of Unicode codepoints.
+ * Converts a CharSequence to a sequence of Unicode code points.
* @param chars The chars to be converted.
* @param offset The offset to the first char to be converted.
* @param length The number of chars to be converted, starting at {@code offset}.
@@ -286,9 +286,9 @@
* when it is created.
* This is useful in cases where the array may grow after this method completes, and we wish to reduce the number
* of array copies.
- * @return The Unicode codepoints.
+ * @return The Unicode code points.
*/
- public static IntArrayBuilder toCodepoints(final CharSequence chars, final int offset, final int length,
+ public static IntArrayBuilder toCodePoints(final CharSequence chars, final int offset, final int length,
final int extraCapacity) {
final int codePointCount = Character.codePointCount(chars, offset, offset + length);
final IntArrayBuilder builder = new IntArrayBuilder(codePointCount + extraCapacity);
@@ -301,14 +301,14 @@
}
/**
- * Converts a CharSequence to a sequence of Unicode codepoints.
+ * Converts a CharSequence to a sequence of Unicode code points.
* @param chars The chars to be converted.
* @param offset The offset to the first char to be converted.
* @param length The number of chars to be converted, starting at {@code offset}.
- * @return The Unicode codepoints.
+ * @return The Unicode code points.
*/
- public static IntArrayBuilder toCodepoints(final CharSequence chars, final int offset, final int length) {
- return toCodepoints(chars, offset, length, 0);
+ public static IntArrayBuilder toCodePoints(final CharSequence chars, final int offset, final int length) {
+ return toCodePoints(chars, offset, length, 0);
}
/**
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -184,10 +184,9 @@
}
/**
- * Parses a Unicode codepoint from a given String.
- * @param unparsed The unparsed String, which must be in the form of
- * "U+nnnn", where "nnnn" is from 1 to 4 hex digits representing the
- * codepoint.
+ * Parses a Unicode code point from a given String.
+ * @param unparsed The unparsed String, which must be in the form of "U+nnnn", where "nnnn" is from 1 to 4 hex
+ * digits representing the code point.
* If not in the propert form, throws an IllegalArgumentException.
* Use {@link #isValidUnparsedCodePoint(String)} to test for this condition
* first.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/XmlCharacterUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/XmlCharacterUtils.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/XmlCharacterUtils.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -549,11 +549,11 @@
/**
* Tests a character for inclusion in XML whitespace.
* The definition of XML whitespace is obtained from the XML 1.0 Recommendation, Section 2.3.
- * @param codepoint The Unicode codepoint to be tested.
- * @return True if and only if {@code codepoint} is XML whitespace.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is XML whitespace.
*/
- public static boolean isXMLWhitespace(final int codepoint) {
- switch (codepoint) {
+ public static boolean isXMLWhitespace(final int codePoint) {
+ switch (codePoint) {
case ' ':
case '\t':
case '\r':
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -103,10 +103,10 @@
}
/**
- * Test of {@link CharSequenceUtils#toCodepoints(CharSequence, int, int)}.
+ * Test of {@link CharSequenceUtils#toCodePoints(CharSequence, int, int)}.
*/
@Test
- public void toCodepointsTest01() {
+ public void toCodePointsTest01() {
final StringBuilder testSequence = new StringBuilder();
testSequence.append("Latin abc = ");
/* Add the Ugaritic characters alpa, beta, gamla, chosen because they are in the Secondary Multilingual
@@ -124,7 +124,7 @@
0x10380, 0x10381, 0x10382, 0x20,
0x55, 0x67, 0x61, 0x72, 0x69, 0x74, 0x69, 0x63
};
- final IntArrayBuilder builder = CharSequenceUtils.toCodepoints(testSequence, 0, testSequence.length());
+ final IntArrayBuilder builder = CharSequenceUtils.toCodePoints(testSequence, 0, testSequence.length());
final int[] actual = builder.toArray();
assertArrayEquals(expected, actual);
@@ -133,7 +133,7 @@
0x3d, 0x20,
0x10380, 0x10381
};
- final IntArrayBuilder builder2 = CharSequenceUtils.toCodepoints(testSequence, 10, 6);
+ final IntArrayBuilder builder2 = CharSequenceUtils.toCodePoints(testSequence, 10, 6);
final int[] actual2 = builder2.toArray();
assertArrayEquals(expected2, actual2);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -251,10 +251,10 @@
}
/**
- * For a given RegisteredFontDesc instance known to be able to encode a given Unicode codepoint, return a FontUse
+ * For a given RegisteredFontDesc instance known to be able to encode a given Unicode code point, return a FontUse
* that will do exactly that.
- * @param fontDescSelected The font description which is known to be able to encode {@code codepoint}.
- * @param codePoint The codepoint to be encoded.
+ * @param fontDescSelected The font description which is known to be able to encode {@code codePoint}.
+ * @param codePoint The code point to be encoded.
* @return The FontUse that should be used.
* @throws FontException For errors in font selection.
*/
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -150,7 +150,7 @@
final FontContext fontContext, final Orthography orthography) {
/* Convert the chars to code points. */
/* Some substitutions add glyphs, so make the output a bit bigger than the input to avoid array copying. */
- final IntArrayBuilder codePoints = CharSequenceUtils.toCodepoints(chars, offset, length, 2);
+ final IntArrayBuilder codePoints = CharSequenceUtils.toCodePoints(chars, offset, length, 2);
/* Rename "codePoints" to "glyphIndexes" and do the conversion from code points to glyph indexes, in place. */
final IntArrayBuilder glyphIndexes = codePoints;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -162,7 +162,7 @@
}
/**
- * <p>Sorts the subset by underlying Unicode codepoint.
+ * <p>Sorts the subset by underlying Unicode code point.
* This may make some output formats more compact.
* For example, the PDF ToUnicodeCMap can be written more compactly if glyph indexes are in Unicode order.</p>
*
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -258,9 +258,9 @@
@Test
public void ligatureReplacementTest001() {
final String testString = "affinity";
- final IntArrayBuilder codePoints = CharSequenceUtils.toCodepoints(testString, 0, testString.length(), 2);
- final int[] expectedCodepoints = new int[] {97, 102, 102, 105, 110, 105, 116, 121};
- assertArrayEquals(expectedCodepoints, codePoints.toArray());
+ final IntArrayBuilder codePoints = CharSequenceUtils.toCodePoints(testString, 0, testString.length(), 2);
+ final int[] expectedCodePoints = new int[] {97, 102, 102, 105, 110, 105, 116, 121};
+ assertArrayEquals(expectedCodePoints, codePoints.toArray());
final IntArrayBuilder glyphIndexes = encode(codePoints);
final int[] expectedInitialGlyphIndexes = new int[] {68, 73, 73, 76, 81, 76, 87, 92};
@@ -279,9 +279,9 @@
public void ligatureReplacementTest002() {
/* Not a real word, but that is not the point of the test. */
final String testString = "affi";
- final IntArrayBuilder codePoints = CharSequenceUtils.toCodepoints(testString, 0, testString.length(), 2);
- final int[] expectedCodepoints = new int[] {97, 102, 102, 105};
- assertArrayEquals(expectedCodepoints, codePoints.toArray());
+ final IntArrayBuilder codePoints = CharSequenceUtils.toCodePoints(testString, 0, testString.length(), 2);
+ final int[] expectedCodePoints = new int[] {97, 102, 102, 105};
+ assertArrayEquals(expectedCodePoints, codePoints.toArray());
final IntArrayBuilder glyphIndexes = encode(codePoints);
final int[] expectedInitialGlyphIndexes = new int[] {68, 73, 73, 76};
@@ -299,8 +299,8 @@
@Test
public void ligatureReplacementTest003() {
final String testString = "Affleck affinity fluids fjords affected.";
- final IntArrayBuilder codePoints = CharSequenceUtils.toCodepoints(testString, 0, testString.length(), 2);
- final int[] expectedCodepoints = new int[] {
+ final IntArrayBuilder codePoints = CharSequenceUtils.toCodePoints(testString, 0, testString.length(), 2);
+ final int[] expectedCodePoints = new int[] {
65, 102, 102, 108, 101, 99, 107, 32, // "Affleck "
97, 102, 102, 105, 110, 105, 116, 121, 32, // "affinity "
102, 108, 117, 105, 100, 115, 32, // "fluids "
@@ -307,7 +307,7 @@
102, 106, 111, 114, 100, 115, 32, // "fjords "
97, 102, 102, 101, 99, 116, 101, 100, 46 // "affected."
};
- assertArrayEquals(expectedCodepoints, codePoints.toArray());
+ assertArrayEquals(expectedCodePoints, codePoints.toArray());
final IntArrayBuilder glyphIndexes = encode(codePoints);
final int[] expectedInitialGlyphIndexes = new int[] {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -48,8 +48,8 @@
/** The text-transform. */
private TextTransform textTransform;
- /** The codepoint immediately before {@link #wrapped}. */
- private int codepointBefore;
+ /** The code point immediately before {@link #wrapped}. */
+ private int codePointBefore;
/** The sorted list of indexes that are deleted. */
private IntSequencePlus deleted;
@@ -66,15 +66,15 @@
* @param linefeedTreatment The linefeed-treatment.
* @param textTransform The text-transform.
* @param whiteSpaceCollapse The white-space-collapse.
- * @param codepointBefore The codepoint immediately before {@link #wrapped}.
- * @param codepointAfter The codepoint immediately after {@link #wrapped}.
+ * @param codePointBefore The code point immediately before {@link #wrapped}.
+ * @param codePointAfter The code point immediately after {@link #wrapped}.
*/
public FoRefinedText4a(final CharSequence wrapped, final LinefeedTreatment linefeedTreatment,
- final TextTransform textTransform, final boolean whiteSpaceCollapse, final int codepointBefore,
- final int codepointAfter) {
+ final TextTransform textTransform, final boolean whiteSpaceCollapse, final int codePointBefore,
+ final int codePointAfter) {
this.wrapped = wrapped;
this.textTransform = textTransform;
- this.codepointBefore = codepointBefore;
+ this.codePointBefore = codePointBefore;
final IntArrayBuilder deleted = new IntArrayBuilder();
final IntArrayBuilder changed = new IntArrayBuilder();
final StringBuilder deltas = new StringBuilder();
@@ -104,8 +104,8 @@
final int deltaIndex = changed.indexOf(index);
final char raw = deltaIndex > -1 ? deltas.charAt(deltaIndex) : wrapped.charAt(index);
- final int charBefore = index == 0 ? codepointBefore : wrapped.charAt(index - 1);
- final int charAfter = index == wrapped.length() - 1 ? codepointAfter : wrapped.charAt(index + 1);
+ final int charBefore = index == 0 ? codePointBefore : wrapped.charAt(index - 1);
+ final int charAfter = index == wrapped.length() - 1 ? codePointAfter : wrapped.charAt(index + 1);
final char filtered = FoText4a.applyWhiteSpaceCollapse(charBefore, raw, charAfter);
if (filtered == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
deleted.insertSortedUnique(index);
@@ -146,8 +146,8 @@
/* Apply text-transform. */
if (this.textTransform == TextTransform.CAPITALIZE) {
- final int codepointBefore = index == 0 ? this.codepointBefore : charAt(index - 1);
- final boolean isFirstCharInWord = XmlCharacterUtils.isXMLWhitespace(codepointBefore);
+ final int codePointBefore = index == 0 ? this.codePointBefore : charAt(index - 1);
+ final boolean isFirstCharInWord = XmlCharacterUtils.isXMLWhitespace(codePointBefore);
return FoText4a.applyTextTransform(this.textTransform, isFirstCharInWord, filteredChar);
} else {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -161,7 +161,7 @@
* @param whiteSpaceTreatment The value of the whitespace-treatment trait.
* @return The character to which the charArray[index] should be converted for white-space-treatment purposes.
* Returns {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if charArray[index] should be discarded.
- * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
+ * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode code point, and should
* therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final CharSequence charArray, final int index,
@@ -196,7 +196,7 @@
* @param whiteSpaceTreatment The value of the whitespace-treatment trait.
* @return The char at this index, or {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if this char should be
* discarded.
- * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
+ * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode code point, and should
* therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final char charBefore, final char c, final char charAfter,
@@ -482,14 +482,14 @@
/**
* Applies white-space-collapse to one char.
- * @param codepointBefore The codepoint before c, or -1 if there is none.
+ * @param codePointBefore The code point before c, or -1 if there is none.
* @param c The character being considered for conversion.
- * @param codepointAfter The codepoint after c, or if there is none.
+ * @param codePointAfter The code point after c, or if there is none.
* @return {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if the previous character is whitespace or if the
* next character is a line-feed.
* If neither of these is true, returns the original character.
*/
- public static char applyWhiteSpaceCollapse(final int codepointBefore, final char c, final int codepointAfter) {
+ public static char applyWhiteSpaceCollapse(final int codePointBefore, final char c, final int codePointAfter) {
if (! XmlCharacterUtils.isXMLWhitespace(c)) {
/* If it is not whitespace, nothing should change. */
return c;
@@ -498,11 +498,11 @@
/* If it is a linefeed, nothing should change. */
return c;
}
- if (codepointBefore != UnicodeCharUtils.INVALID_UNICODE_CHARACTER
- && XmlCharacterUtils.isXMLWhitespace(codepointBefore)) {
+ if (codePointBefore != UnicodeCharUtils.INVALID_UNICODE_CHARACTER
+ && XmlCharacterUtils.isXMLWhitespace(codePointBefore)) {
return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
- if (codepointAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
+ if (codePointAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
return c;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtCharacter.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -33,7 +33,7 @@
*/
public class DtCharacter extends Datatype {
- /** The character value, stored as a Unicode codepoint. */
+ /** The character value, stored as a Unicode code point. */
private int value = 0;
/**
@@ -46,7 +46,7 @@
/**
* Returns the value.
- * @return The value, a Unicode codepoint.
+ * @return The value, a Unicode code point.
*/
public int getValue() {
return this.value;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -233,7 +233,7 @@
}
@Override
- public int qtyRefinedChars(final TextModifiers textModifiers, final int codepointBefore, final int codepointAfter) {
+ public int qtyRefinedChars(final TextModifiers textModifiers, final int codePointBefore, final int codePointAfter) {
/* The linefeed-treatment trait does not affect punctuation. */
/* The text-transform trait does not affect punctuation. */
/* The white-space-collapse trait does not affect punctuation. */
@@ -241,8 +241,8 @@
}
@Override
- public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codepointBefore,
- final int codepointAfter) {
+ public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codePointBefore,
+ final int codePointAfter) {
/* The linefeed-treatment trait does not affect punctuation. */
/* The text-transform trait does not affect punctuation. */
/* The white-space-collapse trait does not affect punctuation. */
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -170,16 +170,16 @@
final MutableTokenFlowLocation currentLocation = new MutableTokenFlowLocation(startLocation);
while (currentLocation.isLessThan(endLocation)) {
final FoTextToken token = tokenAt(currentLocation.getTokenIndex());
- final int codepointBefore = relevantWhitespaceBefore(currentLocation.getTokenIndex());
- final int codepointAfter = relevantWhitespaceAfter(currentLocation.getTokenIndex());
+ final int codePointBefore = relevantWhitespaceBefore(currentLocation.getTokenIndex());
+ final int codePointAfter = relevantWhitespaceAfter(currentLocation.getTokenIndex());
if (token instanceof FoWord) {
final FoWord word = (FoWord) token;
extractWord(builder, word, textModifiers, currentLocation, endLocation);
} else {
- final int qtyRefinedChars = token.qtyRefinedChars(textModifiers, codepointBefore, codepointAfter);
+ final int qtyRefinedChars = token.qtyRefinedChars(textModifiers, codePointBefore, codePointAfter);
for (int charIndex = 0; charIndex < qtyRefinedChars; charIndex ++) {
- final char refinedChar = token.refinedCharAt(charIndex, textModifiers, codepointBefore,
- codepointAfter);
+ final char refinedChar = token.refinedCharAt(charIndex, textModifiers, codePointBefore,
+ codePointAfter);
builder.append(refinedChar);
}
}
@@ -245,12 +245,12 @@
}
/**
- * For tokens where it matters, computes the whitespace Unicode codepoint, if any, immediately before that token.
+ * For tokens where it matters, computes the whitespace Unicode code point, if any, immediately before that token.
* This computation is only relevant for contiguous whitespace tokens, so that white-space-collapse can be properly
* computed.
- * @param tokenIndex The index to the token for which the prior codepoint is being computed.
+ * @param tokenIndex The index to the token for which the prior code point is being computed.
* @return If the token at {@code tokenIndex} is whitespace, and the previous token is also whitespace, returns the
- * raw Unicode codepoint of that subsequent whitespace token.
+ * raw Unicode code point of that subsequent whitespace token.
* For all other tokens, returns -1, as this computation is not relevant.
*/
private int relevantWhitespaceBefore(final int tokenIndex) {
@@ -271,12 +271,12 @@
}
/**
- * For tokens where it matters, computes the whitespace Unicode codepoint, if any, immediately after a given token.
+ * For tokens where it matters, computes the whitespace Unicode code point, if any, immediately after a given token.
* This computation is only relevant for contiguous whitespace tokens, so that white-space-collapse can be properly
* computed.
- * @param tokenIndex The index to the token for which the subsequent codepoint is being computed.
+ * @param tokenIndex The index to the token for which the subsequent code point is being computed.
* @return If the token at {@code tokenIndex} is whitespace, and the next token is also whitespace, returns the
- * raw Unicode codepoint of that subsequent whitespace token.
+ * raw Unicode code point of that subsequent whitespace token.
* For all other tokens, returns -1, as this computation is not relevant.
*/
private int relevantWhitespaceAfter(final int tokenIndex) {
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -174,7 +174,7 @@
}
@Override
- public int qtyRefinedChars(final TextModifiers textModifiers, final int codepointBefore, final int codepointAfter) {
+ public int qtyRefinedChars(final TextModifiers textModifiers, final int codePointBefore, final int codePointAfter) {
char returnValue = this.nativeChar;
/* Apply linefeed-treatment. */
@@ -186,8 +186,8 @@
/* The text-transform trait does not affect whitespace. */
/* Apply white-space-collapse. */
- if (whiteSpaceCollapseApplies(returnValue, textModifiers.traitWhiteSpaceCollapse(), codepointBefore,
- codepointAfter)) {
+ if (whiteSpaceCollapseApplies(returnValue, textModifiers.traitWhiteSpaceCollapse(), codePointBefore,
+ codePointAfter)) {
/* This "character flow object ... shall not generate an area." */
return 0;
}
@@ -196,13 +196,13 @@
}
@Override
- public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codepointBefore,
- final int codepointAfter) {
+ public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codePointBefore,
+ final int codePointAfter) {
char returnValue = this.nativeChar;
returnValue = applyLinefeedTreatment(returnValue, textModifiers.traitLinefeedTreatment());
if (returnValue == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
- final int size = qtyRefinedChars(textModifiers, codepointBefore, codepointAfter);
+ final int size = qtyRefinedChars(textModifiers, codePointBefore, codePointAfter);
throw new MarkedIndexOutOfBoundsException(index, size);
}
@@ -209,11 +209,11 @@
/* The text-transform trait does not affect whitespace. */
/* Apply white-space-collapse. */
- if (whiteSpaceCollapseApplies(returnValue, textModifiers.traitWhiteSpaceCollapse(), codepointBefore,
- codepointAfter)) {
+ if (whiteSpaceCollapseApplies(returnValue, textModifiers.traitWhiteSpaceCollapse(), codePointBefore,
+ codePointAfter)) {
/* This "character flow object ... shall not generate an area." */
- final int size = qtyRefinedChars(textModifiers, codepointBefore, codepointAfter);
+ final int size = qtyRefinedChars(textModifiers, codePointBefore, codePointAfter);
throw new MarkedIndexOutOfBoundsException(index, size);
}
@@ -244,19 +244,19 @@
* Indicates whether white-space-collapse applies to a given character.
* @param rawChar The character being tested.
* @param whiteSpaceCollapse The value of the white-space-collapse trait.
- * @param codepointBefore The Unicode codepoint, if any, immediately before this text in the paragraph.
- * Setting this to -1 indicates that there is no such codepoint.
- * @param codepointAfter The Unicode codepoint, if any, immediately after this text in the paragraph.
+ * @param codePointBefore The Unicode code point, if any, immediately before this text in the paragraph.
+ * Setting this to -1 indicates that there is no such code point.
+ * @param codePointAfter The Unicode code point, if any, immediately after this text in the paragraph.
* This is needed to properly handle white-space-collapse.
* @return True if and only if this whitespace should be collapsed.
*/
private boolean whiteSpaceCollapseApplies(final char rawChar, final boolean whiteSpaceCollapse,
- final int codepointBefore, final int codepointAfter) {
+ final int codePointBefore, final int codePointAfter) {
if (whiteSpaceCollapse
&& XmlCharacterUtils.isXMLWhitespace(rawChar)
&& rawChar != '\n') {
- if (XmlCharacterUtils.isXMLWhitespace(codepointBefore)
- || codepointAfter == '\n') {
+ if (XmlCharacterUtils.isXMLWhitespace(codePointBefore)
+ || codePointAfter == '\n') {
return true;
}
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -276,7 +276,7 @@
}
@Override
- public int qtyRefinedChars(final TextModifiers textModifiers, final int codepointBefore, final int codepointAfter) {
+ public int qtyRefinedChars(final TextModifiers textModifiers, final int codePointBefore, final int codePointAfter) {
/* The linefeed-treatment trait does not affect words. */
/* The text-transform trait DOES affect words. However, it does not affect the count of chars. */
/* The white-space-collapse trait does not affect words. */
@@ -289,8 +289,8 @@
}
@Override
- public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codepointBefore,
- final int codepointAfter) {
+ public char refinedCharAt(final int index, final TextModifiers textModifiers, final int codePointBefore,
+ final int codePointAfter) {
int count = 0;
for (int segmentIndex = 0; segmentIndex < this.qtyWordSegments(); segmentIndex ++) {
final FoWordSegment segment = wordSegmentAt(segmentIndex);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NatLangParser.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NatLangParser.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NatLangParser.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -86,7 +86,7 @@
/* Example: value="U+0041 U+0304" */
final String value = attrs.getValue("value");
final StringTokenizer tokenizer = new StringTokenizer(value);
- final int[] codepoints = new int[tokenizer.countTokens()];
+ final int[] codePoints = new int[tokenizer.countTokens()];
int index = 0;
while (tokenizer.hasMoreTokens()) {
final String token = tokenizer.nextToken();
@@ -94,10 +94,10 @@
throw new SAXException("Invalid value: " + token);
}
final int parsedValue = UnicodeCharUtils.parseCodePoint(token);
- codepoints[index] = parsedValue;
+ codePoints[index] = parsedValue;
index ++;
}
- this.nl.addCluster(codepoints);
+ this.nl.addCluster(codePoints);
}
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NaturalLanguage.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NaturalLanguage.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NaturalLanguage.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -55,43 +55,40 @@
*/
/**
- * Inner class for storing one grapheme cluster. A grapheme cluster is a
- * sequence of Unicode codepoints that define a logical character, for
- * example an "e" with a combining diacritical acute accent.
+ * Inner class for storing one grapheme cluster.
+ * A grapheme cluster is a sequence of Unicode code points that define a logical character, for example an "e" with
+ * a combining diacritical acute accent.
*/
private final class GraphemeCluster {
- /** The Unicode codepoints describing the grapheme cluster. These are
- * maintained in canonical decomposed order. */
- private int[] codepoints;
+ /** The Unicode code points describing the grapheme cluster.
+ * These are maintained in canonical decomposed order. */
+ private int[] codePoints;
/**
* Constructor.
- * @param codepoints The codepoints that comprise the grapheme cluster.
+ * @param codePoints The code points that comprise the grapheme cluster.
*/
- private GraphemeCluster(final int[] codepoints) {
+ private GraphemeCluster(final int[] codePoints) {
/* TODO: Ensure validity, canonical order. */
- this.codepoints = codepoints;
+ this.codePoints = codePoints;
}
/**
- * Indicates whether a given sequence of characters matches this
- * Grapheme Cluster.
- * @param testCodepoints The sequence of codepoints to be tested. This
- * sequence must be already normalized to the canonical decomposed
- * sequence and order.
+ * Indicates whether a given sequence of characters matches this Grapheme Cluster.
+ * @param testCodePoints The sequence of code points to be tested.
+ * This sequence must be already normalized to the canonical decomposed sequence and order.
* @param start The index to the first character that is being tested.
* @param end The index to the last character that is being tested.
* @return True if and only if the sequence of characters matches this Grapheme
* Cluster.
*/
- public boolean isIncluded(final int[] testCodepoints, final int start,
- final int end) {
- if ((end - start + 1) != this.codepoints.length) {
+ public boolean isIncluded(final int[] testCodePoints, final int start, final int end) {
+ if ((end - start + 1) != this.codePoints.length) {
return false;
}
- for (int i = 0; i < this.codepoints.length; i++) {
- if (this.codepoints[i] != testCodepoints[i + start]) {
+ for (int i = 0; i < this.codePoints.length; i++) {
+ if (this.codePoints[i] != testCodePoints[i + start]) {
return false;
}
}
@@ -100,11 +97,11 @@
}
/**
- * Inner class for storing one code point range. A code point range is
- * a range of Unicode code points that are valid in this language.
- * This class is suitable only for graphemes that can be described with
- * a single codepoint when canonically decomposed. Graphemes that require
- * more than one codepoint should use {@link GraphemeCluster}.
+ * Inner class for storing one code point range.
+ * A code point range is a range of Unicode code points that are valid in this language.
+ * This class is suitable only for graphemes that can be described with a single code point when canonically
+ * decomposed.
+ * Graphemes that require more than one code point should use {@link GraphemeCluster}.
*/
private final class CodePointRange {
@@ -125,13 +122,13 @@
}
/**
- * Indicates whether a given codepoint is in this range.
- * @param codepoint The Unicode codepoint being tested.
- * @return True if and only if {@code codepoint} is included in this range.
+ * Indicates whether a given code point is in this range.
+ * @param codePoint The Unicode code point being tested.
+ * @return True if and only if {@code codePoint} is included in this range.
*/
- public boolean isIncluded(final int codepoint) {
- if (codepoint < this.start
- || codepoint > this.end) {
+ public boolean isIncluded(final int codePoint) {
+ if (codePoint < this.start
+ || codePoint > this.end) {
return false;
}
return true;
@@ -145,7 +142,7 @@
/** Temporary data structure for storing the code point ranges as the
* instance is being created. */
- private transient List<NaturalLanguage.CodePointRange> codepointRanges =
+ private transient List<NaturalLanguage.CodePointRange> codePointRanges =
new ArrayList<NaturalLanguage.CodePointRange>();
/**
@@ -155,34 +152,32 @@
}
/**
- * Add a range of Unicode codepoints to this language.
- * @param start The first codepoint in the range to be added.
- * @param end The last codepoint in the range to be added.
+ * Add a range of Unicode code points to this language.
+ * @param start The first code point in the range to be added.
+ * @param end The last code point in the range to be added.
*/
public void addRange(final int start, final int end) {
final CodePointRange newRange = new CodePointRange(start, end);
- this.codepointRanges.add(newRange);
+ this.codePointRanges.add(newRange);
}
/**
* Add a new Grapheme Cluster to this language.
- * @param codepoints The sequence of Unicode codepoint that define the
- * Grapheme Cluster.
+ * @param codePoints The sequence of Unicode code point that define the Grapheme Cluster.
*/
- public void addCluster(final int[] codepoints) {
- final GraphemeCluster newCluster = new GraphemeCluster(codepoints);
+ public void addCluster(final int[] codePoints) {
+ final GraphemeCluster newCluster = new GraphemeCluster(codePoints);
this.clusters.add(newCluster);
}
/**
- * Indicates whether a specific Unicode codepoint is valid as a grapheme in
- * this language.
- * @param codepoint The Unicode codepoint to be tested.
- * @return True if and only if {@code codepoint} is valid in this language.
+ * Indicates whether a specific Unicode code point is valid as a grapheme in this language.
+ * @param codePoint The Unicode code point to be tested.
+ * @return True if and only if {@code codePoint} is valid in this language.
*/
- public boolean isIncluded(final int codepoint) {
+ public boolean isIncluded(final int codePoint) {
/* Start with some exceptions to the general rules below. */
- switch(codepoint) {
+ switch(codePoint) {
/* The linefeed character. */
case '\n': return true;
/* The tab character. */
@@ -191,7 +186,7 @@
/* For now, assume that all digits, spaces, symbols, and punctuation
* are valid in all languages. */
- final int type = Character.getType(codepoint);
+ final int type = Character.getType(codePoint);
switch(type) {
case Character.UNASSIGNED: return false;
case Character.UPPERCASE_LETTER: break;
@@ -226,9 +221,9 @@
default: break;
}
- for (int i = 0; i < this.codepointRanges.size(); i++) {
- final CodePointRange range = this.codepointRanges.get(i);
- if (range.isIncluded(codepoint)) {
+ for (int i = 0; i < this.codePointRanges.size(); i++) {
+ final CodePointRange range = this.codePointRanges.get(i);
+ if (range.isIncluded(codePoint)) {
return true;
}
}
@@ -236,24 +231,22 @@
}
/**
- * Indicates whether a given sequence of characters is a valid grapheme
- * cluster in this language.
- * @param codepoints The sequence of codepoints to be tested. This
- * sequence must be already normalized to the canonical decomposed
- * sequence and order.
+ * Indicates whether a given sequence of characters is a valid grapheme cluster in this language.
+ * @param codePoints The sequence of code points to be tested.
+ * This sequence must be already normalized to the canonical decomposed sequence and order.
* @param start The index to the first character that is being tested.
* @param end The index to the last character that is being tested.
* @return True if and only if the sequence of characters matches a valid Grapheme
* Cluster in this language.
*/
- public boolean isIncluded(final int[] codepoints, final int start,
+ public boolean isIncluded(final int[] codePoints, final int start,
final int end) {
if (end - start == 0) {
- final int codepoint = codepoints[start];
- return this.isIncluded(codepoint);
+ final int codePoint = codePoints[start];
+ return this.isIncluded(codePoint);
}
for (GraphemeCluster cluster : this.clusters) {
- if (cluster.isIncluded(codepoints, start, end)) {
+ if (cluster.isIncluded(codePoints, start, end)) {
return true;
}
}
@@ -261,44 +254,40 @@
}
/**
- * Validates the content of a sequence of chars to determine whether they
- * are valid in this language. By "valid" is meant that the grapheme
- * clusters contained in the text are valid grapheme clusters in this
+ * Validates the content of a sequence of chars to determine whether they are valid in this language.
+ * By "valid" is meant that the grapheme clusters contained in the text are valid grapheme clusters in this
* language.
- * @param theChars The String or other CharSequence that contains the text
- * to be validated. This text does not need to already be normalized.
- * @return The index to the first codepoint of the first grapheme cluster in
- * {@code theChars} that is <em>not</em> valid in this language, or -1
- * if all clusters are valid.
+ * @param theChars The String or other CharSequence that contains the text to be validated.
+ * This text does not need to already be normalized.
+ * @return The index to the first code point of the first grapheme cluster in {@code theChars} that is <em>not</em>
+ * valid in this language, or -1 if all clusters are valid.
*/
public int validateText(final CharSequence theChars) {
/* Normalize the input. */
final String normalized = Normalizer.normalize(theChars.toString(), Normalizer.Form.NFD);
- /* Convert to codepoints. */
+ /* Convert to code points. */
/* Note: We are after programming simplicity here for now. There are
* probably more efficient ways to do this. */
- final int[] codepoints = StringUtils.toCodePoints(normalized);
+ final int[] codePoints = StringUtils.toCodePoints(normalized);
int clusterStart = 0;
- while (clusterStart < codepoints.length) {
- final int codepoint = codepoints[clusterStart];
- if (UCharacter.getCombiningClass(codepoint) != 0) {
- /* The start of each grapheme cluster should start with a
- * codepoint whose combining class is equal to zero. */
- throw new IllegalStateException("Grapheme Cluster must start" +
- "with a codepoint whose combining class is zero.");
+ while (clusterStart < codePoints.length) {
+ final int codePoint = codePoints[clusterStart];
+ if (UCharacter.getCombiningClass(codePoint) != 0) {
+ throw new IllegalStateException("Grapheme Cluster must start with a code point whose combining class "
+ + "is zero.");
}
/* Start out with the cluster end equal to the cluster start. */
int clusterEnd = clusterStart;
- /* Increment it until the combining class of the codepoint is 0,
- * which signals the beginning of the next grapheme cluster. */
+ /* Increment it until the combining class of the code point is 0, which signals the beginning of the next
+ * grapheme cluster. */
boolean done = false;
while (! done) {
- if (clusterEnd >= codepoints.length - 1) {
+ if (clusterEnd >= codePoints.length - 1) {
done = true;
} else {
- final int nextCodepoint = codepoints[clusterEnd + 1];
- if (UCharacter.getCombiningClass(nextCodepoint) == 0) {
+ final int nextCodePoint = codePoints[clusterEnd + 1];
+ if (UCharacter.getCombiningClass(nextCodePoint) == 0) {
done = true;
} else {
clusterEnd ++;
@@ -307,7 +296,7 @@
}
/* Test the cluster. */
- final boolean included = this.isIncluded(codepoints, clusterStart,
+ final boolean included = this.isIncluded(codePoints, clusterStart,
clusterEnd);
if (! included) {
return clusterStart;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -130,11 +130,11 @@
*/
public int getHyphenWidth(final CharContent lineText) {
final CharSequence hyphenChar = lineText.inlineHyphenationCharacter();
- final int codepointCount = Character.codePointCount(hyphenChar, 0, hyphenChar.length());
+ final int codePointCount = Character.codePointCount(hyphenChar, 0, hyphenChar.length());
int width = 0;
- for (int codepointIndex = 0; codepointIndex < codepointCount; codepointIndex ++) {
- final int codepoint = Character.codePointAt(hyphenChar, codepointIndex);
- width += getCharWidth(lineText, codepoint);
+ for (int codePointIndex = 0; codePointIndex < codePointCount; codePointIndex ++) {
+ final int codePoint = Character.codePointAt(hyphenChar, codePointIndex);
+ width += getCharWidth(lineText, codePoint);
}
return width;
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -108,7 +108,8 @@
Basic_Latin_Block.DIGIT_NINE,
});
- /** The set of characters that could be included with {@link #ARABIC_DIGIT} codepoints to form an Arabic Numeral. */
+ /** The set of characters that could be included with {@link #ARABIC_DIGIT} code points to form an Arabic
+ * Numeral. */
private static final String ARABIC_NUMERAL_ADDITIONAL = new String(new char[] {
Basic_Latin_Block.FULL_STOP,
Basic_Latin_Block.COMMA,
@@ -177,11 +178,11 @@
}
/**
- * Indicates whether a given codepoint is possibly intraword punctuation. i.e. punctuation that is legitimately
+ * Indicates whether a given code point is possibly intraword punctuation. i.e. punctuation that is legitimately
* part of a word.
* For example, in English, the apostrophe and typographical closing quote can be used to mark contractions or
* possessives.
- * @param c The codepoint to be tested.
+ * @param c The code point to be tested.
* @return True if {@code c} is possible intraword punctuation.
*/
public static boolean isPossibleIntrawordPunctuation(final int c) {
@@ -333,8 +334,8 @@
}
/**
- * Indicates whether a given codepoint is an Arabic digit, i.e. "0" through "9".
- * @param c The codepoint to be tested.
+ * Indicates whether a given code point is an Arabic digit, i.e. "0" through "9".
+ * @param c The code point to be tested.
* @return True if and only if {@code c} is an Arabic digit.
*/
public static boolean isArabicDigit(final int c) {
@@ -342,8 +343,8 @@
}
/**
- * Indicates whether a given codepoint, while not being an Arabic digit, is valid as part of an Arabic numeral.
- * @param c The codepoint to be tested.
+ * Indicates whether a given code point, while not being an Arabic digit, is valid as part of an Arabic numeral.
+ * @param c The code point to be tested.
* @return True if and only if {@code c} is not an Arabic digit, but is valid as part of an Arabic numeral.
*/
public static boolean isArabicNumeralAdditional(final int c) {
@@ -351,8 +352,8 @@
}
/**
- * Indicates whether a given codepoint is an Arabic numeral character.
- * @param c The codepoint to be tested.
+ * Indicates whether a given code point is an Arabic numeral character.
+ * @param c The code point to be tested.
* @return True if and only if {@code c} is an Arabic numeral character.
*/
public static boolean isArabicNumeral(final int c) {
@@ -362,7 +363,7 @@
/**
* Indicates whether a given character is a letter.
- * @param c The codepoint to be tested.
+ * @param c The code point to be tested.
* @return True if and only if {@code c} is a letter.
*/
public static boolean isLetter(final int c) {
@@ -383,7 +384,7 @@
/**
* Indicates whether a given Unicode code point is a word break character.
- * @param c The codepoint to be tested.
+ * @param c The code point to be tested.
* @return True if and only if {@code c} is a word break character.
*/
public static boolean isWordBreakChar(final int c) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/NumberUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/NumberUtils.java 2023-01-06 22:17:08 UTC (rev 13024)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/NumberUtils.java 2023-01-07 02:25:08 UTC (rev 13025)
@@ -57,7 +57,7 @@
/**
* Indicates whether a given sequence of characters could be parsed as an Arabic number, for example "1234" or
* "3.14159" or "-28".
- * @param sequence The sequence containing the codepoints to be tested.
+ * @param sequence The sequence containing the code points to be tested.
* @param start The first index to be tested.
*...
[truncated message content] |
|
From: <vic...@us...> - 2023-01-06 22:17:11
|
Revision: 13024
http://sourceforge.net/p/foray/code/13024
Author: victormote
Date: 2023-01-06 22:17:08 +0000 (Fri, 06 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Move width-related convenience method from FontUse to Font.
Modified Paths:
--------------
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2023-01-06 22:01:05 UTC (rev 13023)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2023-01-06 22:17:08 UTC (rev 13024)
@@ -120,7 +120,7 @@
final Orthography orthography = this.content.getOrthography();
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return getFontUse().width(chars, fontSize, FontContext.DEFAULT, orthography);
+ return getFontUse().getFont().width(chars, fontSize, FontContext.DEFAULT, orthography);
}
return 0;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-06 22:01:05 UTC (rev 13023)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-06 22:17:08 UTC (rev 13024)
@@ -200,12 +200,6 @@
}
@Override
- public int width(final CharSequence chars, final int fontSize, final FontContext fontContext,
- final Orthography orthography) {
- return getFont().width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
- }
-
- @Override
public Font.Weight nextBolderWeight() {
final RegisteredFont desc =
this.registeredFontDesc.nextBolderFont();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-06 22:01:08
|
Revision: 13023
http://sourceforge.net/p/foray/code/13023
Author: victormote
Date: 2023-01-06 22:01:05 +0000 (Fri, 06 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Remove FontUse method width() that was a pass-thru to Font.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -272,7 +272,7 @@
final FontUse fontUse = getHelveticaFont();
/* The following computation is tested in {@link TestFont4a#testWidth()}. */
final String testString = "Test of Centering";
- final int textWidth = fontUse.width(
+ final int textWidth = fontUse.getFont().width(
testString, 0, testString.length(), 12000, 0, 0, this.fontOptionsWithKerning, null);
assertEquals(textWidth, textArea.crIpd());
@@ -335,7 +335,7 @@
/* The following computation is tested in {@link TestFont4a#testWidth()}.
* The extra word spacing is .3em = .3 * 12000 = 3600. */
final String testString = "Centered with Word Spacing";
- final int textWidth = fontUse.width(testString, 0, testString.length(), 12000, 0, 3600,
+ final int textWidth = fontUse.getFont().width(testString, 0, testString.length(), 12000, 0, 3600,
this.fontOptionsWithKerning, null);
assertEquals(textWidth, textArea.crIpd());
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -228,8 +228,9 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
- traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
+ return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
+ fontContext(), getOrthography());
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -249,8 +249,9 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
- traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
+ return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
+ fontContext(), getOrthography());
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -249,8 +249,9 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
- traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
+ return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
+ fontContext(), getOrthography());
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -234,8 +234,9 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.width(word, 0, word.length(), traitFontSize(), traitGeneratedBy().traitLetterSpacingOpt(this),
- traitGeneratedBy().traitWordSpacingOpt(this), fontContext(), getOrthography());
+ return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
+ fontContext(), getOrthography());
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -384,8 +384,8 @@
*/
int recomputeProgressionDimension() {
final CharSequence text = getText();
- final int pd = traitNominalFont().width(text, 0, text.length(), traitFontSize(), traitLetterSpacingOpt(),
- traitWordSpacingOpt(), fontContext(), getOrthography());
+ final int pd = traitNominalFont().getFont().width(text, 0, text.length(), traitFontSize(),
+ traitLetterSpacingOpt(), traitWordSpacingOpt(), fontContext(), getOrthography());
return pd;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -202,7 +202,7 @@
@Override
public int width(final CharSequence chars, final int fontSize, final FontContext fontContext,
final Orthography orthography) {
- return width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
+ return getFont().width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
}
@Override
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -90,11 +90,7 @@
assertNotNull(rf);
final FreeStandingFont fsf = rf.getFreeStandingFont();
assertNotNull(fsf);
-
- final FontConsumer4a fontConsumer = server.createFontConsumer(null);
final Font4a font = rf.getBestFont();
- final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
- final FontUse4a fontUse = new FontUse4a(consumerFont, null, font.getInternalEncoding());
final String testString = "Test of Centering";
@@ -110,7 +106,7 @@
* = 7,565.
* If these are scaled to 12 points, the millipoints used are 7565 * 12
* = 90,780. */
- assertEquals(90780, fontUse.width(
+ assertEquals(90780, font.width(
testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithKerning, null));
/* Test without kerning.
@@ -117,7 +113,7 @@
* Total kerning = -105.
* Adjusted text space units = 7,565 + 105 = 7,670.
* When scaled to 12 points, the millipoints used are 7670 * 12 = 92,040. */
- assertEquals(92040, fontUse.width(
+ assertEquals(92040, font.width(
testString, 0, testString.length(), 12000, 0, 0, fontOptionsWithoutKerning, null));
/* Test with word spacing.
@@ -125,7 +121,7 @@
* Number of word spaces = 2.
* Total word spacing = 600.
* Total space (kerning on) = 90,780 + 600 = 91,380. */
- assertEquals(91380, fontUse.width(
+ assertEquals(91380, font.width(
testString, 0, testString.length(), 12000, 0, 300, fontOptionsWithKerning, null));
/* Test with letter spacing.
@@ -133,12 +129,12 @@
* Number of word spaces = 16.
* Total word spacing = 80.
* Total space (kerning on) = 90,780 + 80 = 90,860. */
- assertEquals(90860, fontUse.width(
+ assertEquals(90860, font.width(
testString, 0, testString.length(), 12000, 5, 0, fontOptionsWithKerning, null));
/* Test with both word spacing and letter spacing, using same parameters as above.
* Total space (kerning on) = 90,780 + 600 + 80 = 91,460. */
- assertEquals(91460, fontUse.width(
+ assertEquals(91460, font.width(
testString, 0, testString.length(), 12000, 5, 300, fontOptionsWithKerning, null));
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -278,7 +278,7 @@
/* TODO: If letter-spacing is used, it needs to come from the SVG. */
final int letterSpacing = 0;
/* TODO: Pass the font options below instead of hard-coding them. */
- final int width = fontToUse.width(txt, 0, txt.length(),
+ final int width = fontToUse.getFont().width(txt, 0, txt.length(),
awtFontSize * TypographicConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
this.orthography);
final float advance = width / (float) TypographicConstants.MILLIPOINTS_PER_POINT;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -81,7 +81,7 @@
public int getIdealWidth(final KpLeaf leaf) {
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return this.fontUse.width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
+ return this.fontUse.getFont().width(chars, 0, chars.length(), fontSize, 0, 0, fontContext, orthography);
}
return 0;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2023-01-06 21:33:12 UTC (rev 13022)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2023-01-06 22:01:05 UTC (rev 13023)
@@ -323,8 +323,8 @@
public int getWordWidth(final CharContent lineText, final CharSequence word, final int offset, final int length) {
final FontUse fontUse = lineText.inlinePrimaryFont();
fontUse.registerCharsUsed(word);
- return fontUse.width(word, offset, length, lineText.inlineFontSize(), lineText.inlineLetterSpacingOptimum(), 0,
- lineText.inlineFontContext(), lineText.inlineOrthography());
+ return fontUse.getFont().width(word, offset, length, lineText.inlineFontSize(),
+ lineText.inlineLetterSpacingOptimum(), 0, lineText.inlineFontContext(), lineText.inlineOrthography());
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-06 21:33:14
|
Revision: 13022
http://sourceforge.net/p/foray/code/13022
Author: victormote
Date: 2023-01-06 21:33:12 +0000 (Fri, 06 Jan 2023)
Log Message:
-----------
Convert non-font constants to use the parsed Unicode values.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2023-01-05 21:16:33 UTC (rev 13021)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2023-01-06 21:33:12 UTC (rev 13022)
@@ -33,6 +33,10 @@
import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
import org.axsl.ps.CharSet;
+import org.axsl.unicode.block.Basic_Latin_Block;
+import org.axsl.unicode.block.CJK_Symbols_and_Punctuation_Block;
+import org.axsl.unicode.block.General_Punctuation_Block;
+import org.axsl.unicode.block.Latin_1_Supplement_Block;
/**
* An implementation of the aXSL {@link Font4a} interface.
@@ -129,40 +133,38 @@
@Override
public int widthEstimate(final int c, final int fontSize) {
switch (c) {
- case '\u0009': // horizontal tab
- case '\n': // linefeed
- case '\r': // carriage-return
- case '\u00A0': // non-breaking space
+ case Basic_Latin_Block.CONTROL_CHARACTER_TABULATION: // horizontal tab
+ case Basic_Latin_Block.CONTROL_LINE_FEED:
+ case Basic_Latin_Block.CONTROL_CARRIAGE_RETURN:
+ case Latin_1_Supplement_Block.NO_BREAK_SPACE:
return width(' ', fontSize);
- case '\u2000': //en quad
+ case General_Punctuation_Block.EN_QUAD:
return getEnWidth(fontSize);
- case '\u2001': //em quad
+ case General_Punctuation_Block.EM_QUAD:
return getEmWidth(fontSize);
- case '\u2002': //en space
+ case General_Punctuation_Block.EN_SPACE:
return getEnWidth(fontSize);
- case '\u2003': //em space
+ case General_Punctuation_Block.EM_SPACE:
return getEmWidth(fontSize);
- case '\u2004': //3-per-em space
+ case General_Punctuation_Block.THREE_PER_EM_SPACE:
return Math.round(getEmWidth(fontSize) / Font4a.FACTOR_3_PER_EM);
- case '\u2005': //4-per-em space
+ case General_Punctuation_Block.FOUR_PER_EM_SPACE:
return Math.round(getEmWidth(fontSize) / Font4a.FACTOR_4_PER_EM);
- case '\u2006': //6-per-em space
+ case General_Punctuation_Block.SIX_PER_EM_SPACE:
return Math.round(getEmWidth(fontSize) / Font4a.FACTOR_6_PER_EM);
- case '\u2007': //figure space
+ case General_Punctuation_Block.FIGURE_SPACE:
return width(' ', fontSize);
- case '\u2008': //punctuation space
+ case General_Punctuation_Block.PUNCTUATION_SPACE:
return width('.', fontSize);
- case '\u2009': //thin space (1/5 em)
- return Math.round(getEmWidth(fontSize)
- / Font4a.FACTOR_THIN_SPACE);
- case '\u200A': //hair space
- return Math.round(getEmWidth(fontSize)
- / Font4a.FACTOR_HAIR_SPACE);
- case '\u200B': //zero width space
+ case General_Punctuation_Block.THIN_SPACE: //thin space (1/5 em)
+ return Math.round(getEmWidth(fontSize) / Font4a.FACTOR_THIN_SPACE);
+ case General_Punctuation_Block.HAIR_SPACE:
+ return Math.round(getEmWidth(fontSize) / Font4a.FACTOR_HAIR_SPACE);
+ case General_Punctuation_Block.ZERO_WIDTH_SPACE:
return 0;
- case '\u202F': //narrow no-break space
+ case General_Punctuation_Block.NARROW_NO_BREAK_SPACE:
return Math.round(width(' ', fontSize) / 2);
- case '\u3000': //ideographic space
+ case CJK_Symbols_and_Punctuation_Block.IDEOGRAPHIC_SPACE:
return width(' ', fontSize) * 2;
default:
return Integer.MIN_VALUE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-05 21:16:35
|
Revision: 13021
http://sourceforge.net/p/foray/code/13021
Author: victormote
Date: 2023-01-05 21:16:33 +0000 (Thu, 05 Jan 2023)
Log Message:
-----------
Complete building the extent table before pushing it to the metrics instance.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2023-01-05 20:27:28 UTC (rev 13020)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2023-01-05 21:16:33 UTC (rev 13021)
@@ -32,7 +32,6 @@
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
import org.foray.primitive.BitUtils;
-import org.foray.primitive.sequence.ShortArrayBuilder;
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.BoundingBox;
@@ -158,8 +157,7 @@
private float etmSlant;
/** The parsed extent table. */
- private ShortArrayBuilder extentTable;
- /* TODO: Change this type to ShortSequence after cleaning up parsing. */
+ private ShortSequence extentTable;
/** The parsed bounding boxes. */
private BoundingBox[] glyphBoundingBoxes;
@@ -662,7 +660,7 @@
* Sets the extent table.
* @param extentTable The extent table to set.
*/
- public void setExtentTable(final ShortArrayBuilder extentTable) {
+ public void setExtentTable(final ShortSequence extentTable) {
this.extentTable = extentTable;
}
@@ -670,7 +668,7 @@
* Returns the extent table.
* @return The extent table.
*/
- public ShortArrayBuilder getExtentTable() {
+ public ShortSequence getExtentTable() {
return this.extentTable;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2023-01-05 20:27:28 UTC (rev 13020)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2023-01-05 21:16:33 UTC (rev 13021)
@@ -550,6 +550,10 @@
/** The raw metric content bytes. */
private RandomAccessInput input;
+ /** The parsed extent table. Accumulate, sort, etc. in this class before sending immutable version to the metrics
+ * instance. */
+ private ShortArrayBuilder extentTable;
+
/** The metric file being parsed. */
private Type1Metrics metrics;
@@ -1042,9 +1046,8 @@
if (this.metrics.getCharSet() == null) {
this.codePoints = new int[this.qtyCharMetricsExpected];
}
- final ShortArrayBuilder extentTable = new ShortArrayBuilder(this.qtyCharMetricsExpected);
+ this.extentTable = new ShortArrayBuilder(this.qtyCharMetricsExpected);
extentTable.setLength(this.qtyCharMetricsExpected);
- this.metrics.setExtentTable(extentTable);
final BoundingBox[] glyphBoundingBoxes = new BoundingBox [this.qtyCharMetricsExpected];
this.metrics.setGlyphBoundingBoxes(glyphBoundingBoxes);
// 256 is the maximum size needed. The actual encoding may be less.
@@ -1068,6 +1071,7 @@
createCharSet(psServer);
}
this.metrics.setInternalEncoding(findInternalEncoding(psServer));
+ this.metrics.setExtentTable(this.extentTable);
}
/**
@@ -1075,7 +1079,6 @@
* @param psServer The PostScript server.
*/
private void createCharSet(final PsServer psServer) {
- final ShortArrayBuilder extentTable = this.metrics.getExtentTable();
// Sort the char array and any related arrays
boolean anyChanges = true;
while (anyChanges) {
@@ -1087,7 +1090,7 @@
this.codePoints[i] = this.codePoints[i + 1];
this.codePoints[i + 1] = saveInt;
/* Also switch the same elements in the width array. */
- extentTable.swap(i, i + 1);
+ this.extentTable.swap(i, i + 1);
anyChanges = true;
}
}
@@ -1458,13 +1461,12 @@
} else {
charIndex = this.metrics.getCharSet().getIndex(theChar);
}
- final ShortArrayBuilder extentTable = this.metrics.getExtentTable();
if (charIndex < 0
- || charIndex > extentTable.length()) {
+ || charIndex > this.extentTable.length()) {
throw new FontException("Cannot encode glyph name: " + this.glyphName + " at line: "
+ this.currentLineNumber);
}
- extentTable.setShortAt(charIndex, this.charWidth);
+ this.extentTable.setShortAt(charIndex, this.charWidth);
this.metrics.getGlyphBoundingBoxes()[charIndex] = this.glyphBoundingBox;
if (this.glyphIndex > -1) {
/* Accumulate the information needed to create the internal
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-05 20:27:31
|
Revision: 13020
http://sourceforge.net/p/foray/code/13020
Author: victormote
Date: 2023-01-05 20:27:28 +0000 (Thu, 05 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Eliminate dependency on PsServer to get standard PS encodings.
Modified Paths:
--------------
trunk/foray/foray-font/build.gradle
trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
+++ trunk/foray/foray-font/build.gradle 2023-01-05 20:27:28 UTC (rev 13020)
@@ -21,6 +21,7 @@
api (project(':foray-common'))
implementation (project(':foray-primitive'))
api (project(':foray-xml'))
+ api (project(':foray-ps-data'))
// FIX THIS!
// testRuntimeOnly (project(':foray-ps'))
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2023-01-05 01:42:09 UTC (rev 13019)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2023-01-05 20:27:28 UTC (rev 13020)
@@ -36,6 +36,9 @@
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.config.RegisteredFontFamily;
import org.foray.font.format.FontParserClient;
+import org.foray.ps.encode.EncodingSymbol;
+import org.foray.ps.encode.EncodingWinAnsi;
+import org.foray.ps.encode.EncodingZapfDingbats;
import org.axsl.font.FontException;
import org.axsl.font.FontFeatureSimulation;
@@ -572,12 +575,12 @@
private void registerBase14Description(final String fontFamily,
final String fontName, final org.axsl.font.Font.Style style,
final org.axsl.font.Font.Weight weight) throws FontException {
- Encoding encoding = this.psServer.getPredefinedEncoding("WinAnsiEncoding");
+ Encoding encoding = EncodingWinAnsi.getInstance();
if (fontFamily.equals("Base14-Symbol")) {
- encoding = this.psServer.getPredefinedEncoding("SymbolEncoding");
+ encoding = EncodingSymbol.getInstance();
}
if (fontFamily.equals("Base14-ZapfDingbats")) {
- encoding = this.psServer.getPredefinedEncoding("ZapfDingbatsEncoding");
+ encoding = EncodingZapfDingbats.getInstance();
}
final FontFeatureSimulation4a simulation = new FontFeatureSimulation4a();
simulation.setSimulateSmallCaps(FontServer4a.DEFAULT_SMALL_CAPS_SIZE);
@@ -838,11 +841,6 @@
}
@Override
- public Encoding getEncoding(final String name) {
- return this.psServer.getPredefinedEncoding(name);
- }
-
- @Override
public List<Font4a> getAllFonts(final boolean freeStandingFonts, final boolean systemFonts) {
final List<Font4a> fontList = new ArrayList<Font4a>();
for (RegisteredFontFamily family : this.fontFamilies.values()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-05 01:42:17
|
Revision: 13019
http://sourceforge.net/p/foray/code/13019
Author: victormote
Date: 2023-01-05 01:42:09 +0000 (Thu, 05 Jan 2023)
Log Message:
-----------
Move PostScript data classes to new project for that purpose.
Modified Paths:
--------------
trunk/foray/foray-font/build.gradle
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps-data/build.gradle
Added Paths:
-----------
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EncodingVectorInputStream.java
trunk/foray/foray-ps-data/src/main/java/org/
trunk/foray/foray-ps-data/src/main/java/org/foray/
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetParser.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap00Ttf4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04Ttf4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04TtfEntry4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap12Ttf4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap12TtfEntry4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingCustom.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphList4a.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl1.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl2.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl3.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListAgl4.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListParser.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/GlyphListZapfDingbats.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/package-info.java
Removed Paths:
-------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
+++ trunk/foray/foray-font/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
@@ -22,7 +22,9 @@
implementation (project(':foray-primitive'))
api (project(':foray-xml'))
- testRuntimeOnly (project(':foray-ps'))
+// FIX THIS!
+// testRuntimeOnly (project(':foray-ps'))
+ api (project(':foray-ps'))
}
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
+++ trunk/foray/foray-linebreak/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
@@ -17,7 +17,7 @@
testImplementation (group: "org.axsl", name: "axsl-font", version: versions.axsl)
testImplementation (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
testImplementation (group: "org.axsl", name: "axsl-ps", version: versions.axsl)
- testImplementation (project(":foray-ps"))
+ testImplementation (project(":foray-ps-data"))
testImplementation (testFixtures(group: "org.axsl", name: "axsl-font", version: versions.axsl))
testImplementation (testFixtures(group: "org.axsl", name: "axsl-kp-model", version: versions.axsl))
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
+++ trunk/foray/foray-pdf/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
@@ -22,7 +22,7 @@
implementation (project(':foray-primitive'))
testImplementation (project(':foray-font'))
- testImplementation (project(":foray-ps"))
+ testImplementation (project(":foray-ps-data"))
}
javadoc {
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
+++ trunk/foray/foray-ps/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
@@ -15,6 +15,7 @@
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
+ implementation (project(':foray-ps-data'))
testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
}
Added: trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EncodingVectorInputStream.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EncodingVectorInputStream.java (rev 0)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EncodingVectorInputStream.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2010 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.filter;
+
+import org.foray.common.primitive.UnicodeCharUtils;
+import org.foray.ps.PsServer4a;
+
+import org.axsl.ps.PsEncoding;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.nio.charset.Charset;
+
+/**
+ * A filter that can decode content from a given {@link PsEncoding} to Unicode.
+ * The input is assumed to be single-byte characters, but the filtered value can be multi-byte.
+ * A "main" method is provided, which writes the output to a UTF-8 file.
+ */
+public class EncodingVectorInputStream extends FilterInputStream {
+
+ /** The encoding which should be used to decode the underlying input stream. */
+ private PsEncoding encoding;
+
+ /**
+ * Constructor.
+ * @param inputStream The underlying input stream from which the encoded data should be read.
+ * This stream is assumed to contain single-byte characters, encoded with {@code encoding}.
+ * @param encoding The encoding in which {@code inputStream} is assumed to be encoded.
+ */
+ public EncodingVectorInputStream(final InputStream inputStream, final PsEncoding encoding) {
+ super(inputStream);
+ this.encoding = encoding;
+ }
+
+ @Override
+ public int read() throws IOException {
+ final int input = super.read();
+ final int output;
+ if (input >= this.encoding.getFirstIndex()
+ && input <= this.encoding.getLastIndex()) {
+ output = this.encoding.decode(input);
+ } else {
+ output = input;
+ }
+ return output;
+ }
+
+ /**
+ * Returns the command-line options for the {@link #main(String[])} method.
+ * @return Command-line options.
+ */
+ private static Options getCommandLineOptions() {
+ final Options clOptions = new Options();
+ final Option input = new Option("i", "input", true, "Path to the input file");
+ input.setRequired(true);
+ final Option output = new Option("o", "output", true, "Path to the output file");
+ output.setRequired(true);
+ final Option catalog = new Option("e", "encoding", true, "PostScript name of the encoding of the input");
+ output.setRequired(true);
+ clOptions.addOption(input);
+ clOptions.addOption(output);
+ clOptions.addOption(catalog);
+ return clOptions;
+ }
+
+ /**
+ * Command-line interface.
+ * Reads a specified input file in a specified encoding, and writes the output to a specified file in UTF-8
+ * encoding.
+ * @param args The command-line arguments:
+ * <ul>
+ * <li>i, input, The path to the input file.</li>
+ * <li>o, output, The path to the ouput file.</li>
+ * <li>e, encoding, The PostScript name of the encoding of the input.</li>
+ * </ul>
+ */
+ public static void main(final String[] args) {
+ final Logger logger = LoggerFactory.getLogger(EncodingVectorInputStream.class);
+ final Options commandLineOptions = EncodingVectorInputStream.getCommandLineOptions();
+ final CommandLineParser commandLineParser = new DefaultParser();
+ CommandLine parsedCommandLine = null;
+ try {
+ parsedCommandLine = commandLineParser.parse(commandLineOptions, args);
+ } catch (final ParseException e) {
+ logger.error(e.getMessage(), e);
+ final HelpFormatter helpFormatter = new HelpFormatter();
+ helpFormatter.printHelp("java -cp $FORAY_CLASSPATH " + EncodingVectorInputStream.class.getName(),
+ commandLineOptions, true);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+
+ final String input = parsedCommandLine.getOptionValue("input");
+ final String output = parsedCommandLine.getOptionValue("output");
+ final String encodingString = parsedCommandLine.getOptionValue("encoding");
+
+ InputStream inputStream = null;
+ try {
+ FileInputStream fis = null;
+ fis = new FileInputStream(input);
+ inputStream = new BufferedInputStream(fis);
+ } catch (final FileNotFoundException e) {
+ logger.error("File cannot be opened for input: " + input, e);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+
+ Writer writer = null;
+ try {
+ final FileOutputStream fos = new FileOutputStream(output);
+ final Charset charset = Charset.forName("UTF-8");
+ writer = new OutputStreamWriter(fos, charset);
+ } catch (final FileNotFoundException e) {
+ logger.error("File cannot be opened for output: " + output, e);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+
+ final PsServer4a psServer = new PsServer4a();
+ final PsEncoding encoding = psServer.getPredefinedEncoding(encodingString);
+ final EncodingVectorInputStream inputFilter = new EncodingVectorInputStream(inputStream, encoding);
+
+ try {
+ while (true) {
+ final int inputByte = inputFilter.read();
+ if (inputByte >= 0
+ && inputByte != UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
+ writer.write(inputByte);
+ } else {
+ break;
+ }
+ }
+ writer.close();
+ } catch (final IOException e) {
+ logger.error(e.getMessage(), e);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ } finally {
+ try {
+ inputFilter.close();
+ } catch (final IOException e) {
+ logger.error(e.getMessage(), e);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EncodingVectorInputStream.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-ps-data/build.gradle
===================================================================
--- trunk/foray/foray-ps-data/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
+++ trunk/foray/foray-ps-data/build.gradle 2023-01-05 01:42:09 UTC (rev 13019)
@@ -1,20 +1,17 @@
plugins {
id 'foray.library-conventions'
+ id 'foray.logging-conventions'
}
description = 'foray-ps-data'
dependencies {
-// implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
-// api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
-// api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
-// implementation (project(':foray-common'))
-// implementation (project(':foray-primitive'))
-
-// testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation (project(':foray-common'))
+ implementation (project(':foray-primitive'))
}
javadoc {
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2005 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.foray.primitive.sequence.CharArray;
+import org.foray.primitive.sequence.IntArray;
+
+import org.axsl.primitive.sequence.IntSequenceMutable;
+import org.axsl.ps.CharSet;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The FOray implementation of {@link org.axsl.ps.CharSet}.
+ */
+public class CharSet4a implements org.axsl.ps.CharSet, Serializable {
+
+ /** Constant needed for serialization. */
+ public static final long serialVersionUID = -194139196582956914L;
+
+ /**
+ * A map of all registered CharSet instances.
+ * The key to the map is a String containing the name of the charset.
+ * The value is the CharSet instance.
+ */
+ private static Map<String, CharSet4a> registeredCharSets
+ = new HashMap<String, CharSet4a>();
+
+ /** The name of this character set. */
+ private transient String name;
+
+ /** The 16-bit Unicode codepoints. */
+ private transient CharArray characterSet16;
+
+ /** The 32-bit Unicode codepoints. These are conceptually appended to the
+ * end of {@link #characterSet16} as if they were all in one array. */
+ private transient IntArray characterSet32;
+
+ /**
+ * Constructor.
+ * @param name The name of this character set.
+ * @param characterSet The array containing the code points in this character set.
+ */
+ public CharSet4a(final String name, final IntSequenceMutable characterSet) {
+ this.name = name;
+ if (characterSet == null) {
+ return;
+ }
+
+ /* Make sure the input array is sorted. */
+ characterSet.sort();
+
+ /* Count the values needing 32 bits. */
+ int count32 = 0;
+ for (int i = characterSet.length() - 1; i > -1; i--) {
+ if (characterSet.intAt(i) > Character.MAX_VALUE) {
+ count32 ++;
+ } else {
+ break;
+ }
+ }
+
+ if (count32 == 0) {
+ this.characterSet16 = new CharArray(characterSet);
+ this.characterSet32 = IntArray.EMPTY;
+ } else {
+ this.characterSet16 = new CharArray(characterSet.subSequence(0, count32));
+ this.characterSet32 = new IntArray(characterSet.subSequence(count32, characterSet.length()));
+ }
+ }
+
+ /**
+ * Returns the name of this character set.
+ * @return The name of this character set.
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public int getIndex(final int codePoint) {
+ if (codePoint > Character.MAX_VALUE) {
+ final int index = this.characterSet32.binarySearch(codePoint);
+ return index < 0 ? -1 : index + this.characterSet16.length();
+ } else {
+ final int index = this.characterSet16.binarySearch((char) codePoint);
+ return index < 0 ? -1 : index;
+ }
+ }
+
+ /**
+ * This is a factory method that either finds or creates the known
+ * predefined CharSet instances.
+ * @param name The name of the predefined charset to be returned.
+ * @return The CharSet instance for {@code name}, or null if
+ * {@code name} does not describe a predefined character set.
+ */
+ public static CharSet4a getRegisteredCharSet(final String name) {
+ // If already instantiated, return it.
+ CharSet4a charSet = CharSet4a.registeredCharSets.get(name);
+ if (charSet != null) {
+ return charSet;
+ }
+ // Otherwise, try to instantiate it.
+ final CharSet.Predefined predefined = CharSet.Predefined.findByName(name);
+ charSet = CharSet4a.getRegisteredCharSet(predefined);
+ if (charSet == null) {
+ return null;
+ }
+ CharSet4a.registeredCharSets.put(name, charSet);
+ return charSet;
+ }
+
+ /**
+ * Returns a predefined character set from its enumeration.
+ * @param predefined The enumeration of the predefined character sets.
+ * @return The character set for {@code predefined}.
+ */
+ public static CharSet4a getRegisteredCharSet(final CharSet.Predefined predefined) {
+ if (predefined == null) {
+ return null;
+ }
+ switch (predefined) {
+ case WINDOWS_ANSI: {
+ return CharSetWindowsAnsi.getInstance();
+ }
+ case EXTENDED_ROMAN: {
+ return CharSetExtendedRoman.getInstance();
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns the size, in characters, of this character set.
+ * @return The size of this character set.
+ */
+ public int size() {
+ return this.characterSet16.length() + this.characterSet32.length();
+ }
+
+ /**
+ * Indicates whether the data in this character set is static, that is,
+ * tied entirely to the class itself and not built dynamically.
+ * This is used primarily to determine whether the instance should actually
+ * be serialized.
+ * Static subclasses should override this method.
+ * @return True if and only if all data in this glyph list is static and does not
+ * need to be serialized.
+ */
+ public boolean isStatic() {
+ return false;
+ }
+
+ /**
+ * Serialize this {@link CharSet4a} instance.
+ * @param stream The output stream to which the serialized data is written.
+ * @throws IOException For I/O errors.
+ * @serialData
+ * <ol>
+ * <li>The name of the character set (String).</li>
+ * <li>The The 16-bit Unicode codepoints (char[]).</li>
+ * <li>The The 32-bit Unicode codepoints (int[]).</li>
+ * </ol>
+ */
+ private void writeObject(final ObjectOutputStream stream)
+ throws IOException {
+ if (this.isStatic()) {
+ /* The static instances do not need to be serialized as they are
+ * derived entirely from static data. */
+ return;
+ }
+ stream.defaultWriteObject();
+ stream.writeObject(this.name);
+ stream.writeObject(this.characterSet16);
+ stream.writeObject(this.characterSet32);
+ }
+
+ /**
+ * Deserialize this {@link CharSet4a} instance.
+ * @param stream The input stream from which the serialized data is read.
+ * @throws IOException For I/O errors reading the input.
+ * @throws ClassNotFoundException For classes in the input that cannot be
+ * found.
+ */
+ private void readObject(final ObjectInputStream stream)
+ throws IOException, ClassNotFoundException {
+ if (this.isStatic()) {
+ /* The static instances do not need to be serialized as they are
+ * derived entirely from static data. */
+ return;
+ }
+ stream.defaultReadObject();
+ this.name = (String) stream.readObject();
+ this.characterSet16 = (CharArray) stream.readObject();
+ this.characterSet32 = (IntArray) stream.readObject();
+ }
+
+}
Property changes on: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSet4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.foray.primitive.sequence.IntArrayBuilder;
+
+/**
+ * Class containing hard-coded values that represent the ExtendedRoman
+ * character set.
+ * We cannot find an official list for this character set.
+ * It is inferred from the AFM files for the Base-14 fonts.
+ *
+ * <p>The hard-coded values in this class were derived by running
+ * {@link CharSetParser#main(String[])}.
+ * The input file was created by extracting all of the glyph names from the
+ * "C" entries in the following AFM file:
+ * foray/foray-font/resource/base-14/Helvetica.afm</p>
+ */
+public final class CharSetExtendedRoman extends CharSet4a {
+
+ /** Constant needed for serialization. */
+ public static final long serialVersionUID = -78856854976712859L;
+
+ /** The array of characters in this character set. This array is sorted
+ * so that it can be used in binary searches. */
+ private static final char[] CHARACTER_SET = {
+ 0x0020, // [0] space
+ 0x0021, // [1] exclam
+ 0x0022, // [2] quotedbl
+ 0x0023, // [3] numbersign
+ 0x0024, // [4] dollar
+ 0x0025, // [5] percent
+ 0x0026, // [6] ampersand
+ 0x0027, // [7] quotesingle
+ 0x0028, // [8] parenleft
+ 0x0029, // [9] parenright
+ 0x002a, // [10] asterisk
+ 0x002b, // [11] plus
+ 0x002c, // [12] comma
+ 0x002d, // [13] hyphen
+ 0x002e, // [14] period
+ 0x002f, // [15] slash
+ 0x0030, // [16] zero
+ 0x0031, // [17] one
+ 0x0032, // [18] two
+ 0x0033, // [19] three
+ 0x0034, // [20] four
+ 0x0035, // [21] five
+ 0x0036, // [22] six
+ 0x0037, // [23] seven
+ 0x0038, // [24] eight
+ 0x0039, // [25] nine
+ 0x003a, // [26] colon
+ 0x003b, // [27] semicolon
+ 0x003c, // [28] less
+ 0x003d, // [29] equal
+ 0x003e, // [30] greater
+ 0x003f, // [31] question
+ 0x0040, // [32] at
+ 0x0041, // [33] A
+ 0x0042, // [34] B
+ 0x0043, // [35] C
+ 0x0044, // [36] D
+ 0x0045, // [37] E
+ 0x0046, // [38] F
+ 0x0047, // [39] G
+ 0x0048, // [40] H
+ 0x0049, // [41] I
+ 0x004a, // [42] J
+ 0x004b, // [43] K
+ 0x004c, // [44] L
+ 0x004d, // [45] M
+ 0x004e, // [46] N
+ 0x004f, // [47] O
+ 0x0050, // [48] P
+ 0x0051, // [49] Q
+ 0x0052, // [50] R
+ 0x0053, // [51] S
+ 0x0054, // [52] T
+ 0x0055, // [53] U
+ 0x0056, // [54] V
+ 0x0057, // [55] W
+ 0x0058, // [56] X
+ 0x0059, // [57] Y
+ 0x005a, // [58] Z
+ 0x005b, // [59] bracketleft
+ 0x005c, // [60] backslash
+ 0x005d, // [61] bracketright
+ 0x005e, // [62] asciicircum
+ 0x005f, // [63] underscore
+ 0x0060, // [64] grave
+ 0x0061, // [65] a
+ 0x0062, // [66] b
+ 0x0063, // [67] c
+ 0x0064, // [68] d
+ 0x0065, // [69] e
+ 0x0066, // [70] f
+ 0x0067, // [71] g
+ 0x0068, // [72] h
+ 0x0069, // [73] i
+ 0x006a, // [74] j
+ 0x006b, // [75] k
+ 0x006c, // [76] l
+ 0x006d, // [77] m
+ 0x006e, // [78] n
+ 0x006f, // [79] o
+ 0x0070, // [80] p
+ 0x0071, // [81] q
+ 0x0072, // [82] r
+ 0x0073, // [83] s
+ 0x0074, // [84] t
+ 0x0075, // [85] u
+ 0x0076, // [86] v
+ 0x0077, // [87] w
+ 0x0078, // [88] x
+ 0x0079, // [89] y
+ 0x007a, // [90] z
+ 0x007b, // [91] braceleft
+ 0x007c, // [92] bar
+ 0x007d, // [93] braceright
+ 0x007e, // [94] asciitilde
+ 0x00a1, // [95] exclamdown
+ 0x00a2, // [96] cent
+ 0x00a3, // [97] sterling
+ 0x00a4, // [98] currency
+ 0x00a5, // [99] yen
+ 0x00a6, // [100] brokenbar
+ 0x00a7, // [101] section
+ 0x00a8, // [102] dieresis
+ 0x00a9, // [103] copyright
+ 0x00aa, // [104] ordfeminine
+ 0x00ab, // [105] guillemotleft
+ 0x00ac, // [106] logicalnot
+ 0x00ae, // [107] registered
+ 0x00af, // [108] macron
+ 0x00b0, // [109] degree
+ 0x00b1, // [110] plusminus
+ 0x00b2, // [111] twosuperior
+ 0x00b3, // [112] threesuperior
+ 0x00b4, // [113] acute
+ 0x00b5, // [114] mu
+ 0x00b6, // [115] paragraph
+ 0x00b7, // [116] periodcentered
+ 0x00b8, // [117] cedilla
+ 0x00b9, // [118] onesuperior
+ 0x00ba, // [119] ordmasculine
+ 0x00bb, // [120] guillemotright
+ 0x00bc, // [121] onequarter
+ 0x00bd, // [122] onehalf
+ 0x00be, // [123] threequarters
+ 0x00bf, // [124] questiondown
+ 0x00c0, // [125] Agrave
+ 0x00c1, // [126] Aacute
+ 0x00c2, // [127] Acircumflex
+ 0x00c3, // [128] Atilde
+ 0x00c4, // [129] Adieresis
+ 0x00c5, // [130] Aring
+ 0x00c6, // [131] AE
+ 0x00c7, // [132] Ccedilla
+ 0x00c8, // [133] Egrave
+ 0x00c9, // [134] Eacute
+ 0x00ca, // [135] Ecircumflex
+ 0x00cb, // [136] Edieresis
+ 0x00cc, // [137] Igrave
+ 0x00cd, // [138] Iacute
+ 0x00ce, // [139] Icircumflex
+ 0x00cf, // [140] Idieresis
+ 0x00d0, // [141] Eth
+ 0x00d1, // [142] Ntilde
+ 0x00d2, // [143] Ograve
+ 0x00d3, // [144] Oacute
+ 0x00d4, // [145] Ocircumflex
+ 0x00d5, // [146] Otilde
+ 0x00d6, // [147] Odieresis
+ 0x00d7, // [148] multiply
+ 0x00d8, // [149] Oslash
+ 0x00d9, // [150] Ugrave
+ 0x00da, // [151] Uacute
+ 0x00db, // [152] Ucircumflex
+ 0x00dc, // [153] Udieresis
+ 0x00dd, // [154] Yacute
+ 0x00de, // [155] Thorn
+ 0x00df, // [156] germandbls
+ 0x00e0, // [157] agrave
+ 0x00e1, // [158] aacute
+ 0x00e2, // [159] acircumflex
+ 0x00e3, // [160] atilde
+ 0x00e4, // [161] adieresis
+ 0x00e5, // [162] aring
+ 0x00e6, // [163] ae
+ 0x00e7, // [164] ccedilla
+ 0x00e8, // [165] egrave
+ 0x00e9, // [166] eacute
+ 0x00ea, // [167] ecircumflex
+ 0x00eb, // [168] edieresis
+ 0x00ec, // [169] igrave
+ 0x00ed, // [170] iacute
+ 0x00ee, // [171] icircumflex
+ 0x00ef, // [172] idieresis
+ 0x00f0, // [173] eth
+ 0x00f1, // [174] ntilde
+ 0x00f2, // [175] ograve
+ 0x00f3, // [176] oacute
+ 0x00f4, // [177] ocircumflex
+ 0x00f5, // [178] otilde
+ 0x00f6, // [179] odieresis
+ 0x00f7, // [180] divide
+ 0x00f8, // [181] oslash
+ 0x00f9, // [182] ugrave
+ 0x00fa, // [183] uacute
+ 0x00fb, // [184] ucircumflex
+ 0x00fc, // [185] udieresis
+ 0x00fd, // [186] yacute
+ 0x00fe, // [187] thorn
+ 0x00ff, // [188] ydieresis
+ 0x0100, // [189] Amacron
+ 0x0101, // [190] amacron
+ 0x0102, // [191] Abreve
+ 0x0103, // [192] abreve
+ 0x0104, // [193] Aogonek
+ 0x0105, // [194] aogonek
+ 0x0106, // [195] Cacute
+ 0x0107, // [196] cacute
+ 0x010c, // [197] Ccaron
+ 0x010d, // [198] ccaron
+ 0x010e, // [199] Dcaron
+ 0x010f, // [200] dcaron
+ 0x0110, // [201] Dcroat
+ 0x0111, // [202] dcroat
+ 0x0112, // [203] Emacron
+ 0x0113, // [204] emacron
+ 0x0116, // [205] Edotaccent
+ 0x0117, // [206] edotaccent
+ 0x0118, // [207] Eogonek
+ 0x0119, // [208] eogonek
+ 0x011a, // [209] Ecaron
+ 0x011b, // [210] ecaron
+ 0x011e, // [211] Gbreve
+ 0x011f, // [212] gbreve
+ 0x0122, // [213] Gcommaaccent
+ 0x0123, // [214] gcommaaccent
+ 0x012a, // [215] Imacron
+ 0x012b, // [216] imacron
+ 0x012e, // [217] Iogonek
+ 0x012f, // [218] iogonek
+ 0x0130, // [219] Idotaccent
+ 0x0131, // [220] dotlessi
+ 0x0136, // [221] Kcommaaccent
+ 0x0137, // [222] kcommaaccent
+ 0x0139, // [223] Lacute
+ 0x013a, // [224] lacute
+ 0x013b, // [225] Lcommaaccent
+ 0x013c, // [226] lcommaaccent
+ 0x013d, // [227] Lcaron
+ 0x013e, // [228] lcaron
+ 0x0141, // [229] Lslash
+ 0x0142, // [230] lslash
+ 0x0143, // [231] Nacute
+ 0x0144, // [232] nacute
+ 0x0145, // [233] Ncommaaccent
+ 0x0146, // [234] ncommaaccent
+ 0x0147, // [235] Ncaron
+ 0x0148, // [236] ncaron
+ 0x014c, // [237] Omacron
+ 0x014d, // [238] omacron
+ 0x0150, // [239] Ohungarumlaut
+ 0x0151, // [240] ohungarumlaut
+ 0x0152, // [241] OE
+ 0x0153, // [242] oe
+ 0x0154, // [243] Racute
+ 0x0155, // [244] racute
+ 0x0156, // [245] Rcommaaccent
+ 0x0157, // [246] rcommaaccent
+ 0x0158, // [247] Rcaron
+ 0x0159, // [248] rcaron
+ 0x015a, // [249] Sacute
+ 0x015b, // [250] sacute
+ 0x015e, // [251] Scedilla
+ 0x015f, // [252] scedilla
+ 0x0160, // [253] Scaron
+ 0x0161, // [254] scaron
+ 0x0162, // [255] Tcommaaccent
+ 0x0163, // [256] tcommaaccent
+ 0x0164, // [257] Tcaron
+ 0x0165, // [258] tcaron
+ 0x016a, // [259] Umacron
+ 0x016b, // [260] umacron
+ 0x016e, // [261] Uring
+ 0x016f, // [262] uring
+ 0x0170, // [263] Uhungarumlaut
+ 0x0171, // [264] uhungarumlaut
+ 0x0172, // [265] Uogonek
+ 0x0173, // [266] uogonek
+ 0x0178, // [267] Ydieresis
+ 0x0179, // [268] Zacute
+ 0x017a, // [269] zacute
+ 0x017b, // [270] Zdotaccent
+ 0x017c, // [271] zdotaccent
+ 0x017d, // [272] Zcaron
+ 0x017e, // [273] zcaron
+ 0x0192, // [274] florin
+ 0x0218, // [275] Scommaaccent
+ 0x0219, // [276] scommaaccent
+ 0x02c6, // [277] circumflex
+ 0x02c7, // [278] caron
+ 0x02d8, // [279] breve
+ 0x02d9, // [280] dotaccent
+ 0x02da, // [281] ring
+ 0x02db, // [282] ogonek
+ 0x02dc, // [283] tilde
+ 0x02dd, // [284] hungarumlaut
+ 0x2013, // [285] endash
+ 0x2014, // [286] emdash
+ 0x2018, // [287] quoteleft
+ 0x2019, // [288] quoteright
+ 0x201a, // [289] quotesinglbase
+ 0x201c, // [290] quotedblleft
+ 0x201d, // [291] quotedblright
+ 0x201e, // [292] quotedblbase
+ 0x2020, // [293] dagger
+ 0x2021, // [294] daggerdbl
+ 0x2022, // [295] bullet
+ 0x2026, // [296] ellipsis
+ 0x2030, // [297] perthousand
+ 0x2039, // [298] guilsinglleft
+ 0x203a, // [299] guilsinglright
+ 0x2044, // [300] fraction
+ 0x20ac, // [301] Euro
+ 0x2122, // [302] trademark
+ 0x2202, // [303] partialdiff
+ 0x2206, // [304] Delta
+ 0x2211, // [305] summation
+ 0x2212, // [306] minus
+ 0x221a, // [307] radical
+ 0x2260, // [308] notequal
+ 0x2264, // [309] lessequal
+ 0x2265, // [310] greaterequal
+ 0x25ca, // [311] lozenge
+ 0xf6c3, // [312] commaaccent
+ 0xfb01, // [313] fi
+ 0xfb02 // [314] fl
+ };
+
+ /** The singleton instance. */
+ private static CharSetExtendedRoman theInstance;
+
+ /**
+ * Constructor.
+ */
+ private CharSetExtendedRoman() {
+ super("ExtendedRoman", new IntArrayBuilder().append(CharSetExtendedRoman.CHARACTER_SET));
+ }
+
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton isntance of this class.
+ */
+ public static CharSetExtendedRoman getInstance() {
+ if (CharSetExtendedRoman.theInstance == null) {
+ CharSetExtendedRoman.theInstance = new CharSetExtendedRoman();
+ }
+ return CharSetExtendedRoman.theInstance;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isStatic() {
+ return true;
+ }
+
+ /**
+ * Method ensuring that the singleton nature of this class is not broken by
+ * deserialization.
+ * @return The singleton instance, ignoring any object stream input.
+ */
+ private Object readResolve() {
+ return CharSetExtendedRoman.getInstance();
+ }
+
+}
Property changes on: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetParser.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetParser.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetParser.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,308 @@
+/*
+ * Copyright 2005 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.foray.common.url.UrlFactory;
+import org.foray.primitive.StringUtils;
+import org.foray.primitive.sequence.CharArrayBuilder;
+
+import org.axsl.ps.GlyphList;
+import org.axsl.ps.PsException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A GlyphListParser instance parses a glyph list, arranging its data for
+ * efficient use during processing.
+ */
+public class CharSetParser {
+
+ /** Constant indicating the minimum padding size. */
+ private static final int MINIMUM_PADDING_SIZE = 2;
+
+ /** Constant indicating the minimum number of bytes that should be used
+ * to reprsent a character in the output. */
+ private static final int MINIMUM_CHAR_SIZE = 4;
+
+ /** Constant indicating the desired column in which comments should be
+ * written. */
+ private static final int DESIRED_COLUMN = 28;
+
+ /** The reader for the file. */
+ private BufferedReader reader = null;
+
+ /** The current line number. */
+ private transient int currentLineNumber = 0;
+
+ /** The array of characters in the character set. */
+ private CharArrayBuilder characterSet = new CharArrayBuilder();
+
+ /** The array of glyph names in the character set. */
+ private List<String> glyphNames = new ArrayList<String>();
+
+ /**
+ * Create a new CharSetParser instance.
+ * @param input The reader encapsulating the file to be read.
+ */
+ public CharSetParser(final InputStream input) {
+ final InputStreamReader isr = new InputStreamReader(input);
+ this.reader = new BufferedReader(isr);
+ }
+
+ /**
+ * Parses a glyph list.
+ * @throws IOException For I/O error.
+ * @throws PsException For errors parsing the input.
+ */
+ public void parseList() throws IOException, PsException {
+ parseLines();
+ sortCharacterSet();
+ }
+
+ /**
+ * Parses the lines of the character set input file.
+ * @throws IOException For I/O error.
+ * @throws PsException For errors parsing the input.
+ */
+ private void parseLines() throws IOException, PsException {
+ boolean endOfFile = false;
+ endOfFile = false;
+ int arrayIndex = 0;
+ while (! endOfFile) {
+ final String currentLine = this.reader.readLine();
+ this.currentLineNumber++;
+ if (currentLine == null) {
+ endOfFile = true;
+ return;
+ }
+ if (lineHasContent(currentLine)) {
+ processCurrentLine(currentLine, arrayIndex);
+ arrayIndex++;
+ }
+ }
+ }
+
+ /**
+ * Indicates whether a given line contains content.
+ * @param line The text on the line.
+ * @return True if the line has content, false if it is blank or is a
+ * comment.
+ */
+ private boolean lineHasContent(final String line) {
+ final char[] charArray = line.toCharArray();
+ for (int i = 0; i < charArray.length; i++) {
+ if (charArray[i] == '#') {
+ // This is a comment.
+ return false;
+ }
+ if (charArray[i] != ' ') {
+ // This line has content.
+ return true;
+ }
+ // Otherwise, look at next character
+ }
+ return false;
+ }
+
+ /**
+ * Process a content line.
+ * @param line The text from the line.
+ * @param arrayIndex The current glyph index being processed.
+ * @throws PsException For errors parsing the line.
+ */
+ private void processCurrentLine(final String line, final int arrayIndex) throws PsException {
+ this.characterSet.append(Character.MIN_VALUE);
+ this.glyphNames.add(StringUtils.EMPTY_STRING);
+ final GlyphList gl = GlyphListAgl.getInstance();
+ final int theChar = gl.mapGlyphNameToCodePoint(line);
+ if (theChar == Character.MAX_VALUE) {
+ throw new PsException("Character not found in Adobe Glyph List, line "
+ + this.currentLineNumber + ": " + line);
+
+ }
+ this.characterSet.setCharAt(arrayIndex, (char) theChar);
+ this.glyphNames.set(arrayIndex, line);
+ }
+
+ /**
+ * Sorts the parallel char and String arrays that describe this character
+ * set by the character itself.
+ */
+ private void sortCharacterSet() {
+ boolean anyChanges = true;
+ while (anyChanges) {
+ anyChanges = false;
+ for (int i = 0; i < this.characterSet.length() - 1; i++) {
+ if (this.characterSet.charAt(i) > this.characterSet.charAt(i + 1)) {
+ /* They are out of order. Switch the corresponding elements
+ * in both arrays. */
+ final char storeChar = this.characterSet.charAt(i);
+ this.characterSet.setCharAt(i, this.characterSet.charAt(i + 1));
+ this.characterSet.setCharAt(i + 1, storeChar);
+ final String storeString = this.glyphNames.get(i);
+ this.glyphNames.set(i, this.glyphNames.get(i + 1));
+ this.glyphNames.set(i + 1, storeString);
+ anyChanges = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * Writes out the array that has been parsed into java source code.
+ * This is useful in cases where you wish to permanently encapsulate a
+ * character set.
+ * @param out The OutputStream to which the data structures should be
+ * written.
+ * @throws IOException For errors when writing to out.
+ */
+ public void writeAsJavaStatics(final OutputStream out) throws IOException {
+ if (out == null) {
+ return;
+ }
+ if (this.characterSet == null) {
+ return;
+ }
+ // Write the character set.
+ String s = " // Note: This array must be sorted "
+ + "(used in binary search).\n";
+ out.write(s.getBytes());
+ s = " public static final char[] characterSet = {\n";
+ out.write(s.getBytes());
+ for (int i = 0; i < this.characterSet.length(); i++) {
+ final StringBuilder builder = new StringBuilder();
+ builder.append(" 0x");
+ builder.append(StringUtils.charToHexString(this.characterSet.charAt(i), true,
+ CharSetParser.MINIMUM_CHAR_SIZE));
+ if (i < this.characterSet.length() - 1) {
+ builder.append(",");
+ } else {
+ builder.append(" ");
+ }
+ builder.append(" // ");
+ builder.append(EncodingParser.formatArrayIndex(i));
+ StringUtils.padSpaces(builder, CharSetParser.DESIRED_COLUMN, CharSetParser.MINIMUM_PADDING_SIZE);
+ builder.append(this.glyphNames.get(i));
+ builder.append("\n");
+ out.write(s.getBytes());
+ }
+ s = " };\n";
+ out.write(s.getBytes());
+ }
+
+ /**
+ * Returns the parsed Unicode code points in this character set.
+ * @return The Unicode code points in this character set.
+ */
+ public char[] getCharacterSet() {
+ return this.characterSet.toArray();
+ }
+
+ /**
+ * Main method useful for parsing a glyph list file from the command-line
+ * and generating the java code that encapsulates that glyph list.
+ * @param args Element 0 is the URL of the glyph list to be parsed.
+ * Element 1 is the URL of the file to which the java source code should be
+ * written.
+ */
+ public static void main(final String[] args) {
+ final Logger logger = LoggerFactory.getLogger(CharSetParser.class);
+ final String usage = "Usage: CharSetParser <input-file> "
+ + "<output-file>\n";
+ if (args.length != 2) {
+ logger.error("Wrong number of arguments.\n" + usage);
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ URL url = null;
+ try {
+ url = UrlFactory.createURL(args[0]);
+ } catch (final MalformedURLException e) {
+ logger.error("Unable to create URL for: " + args[0] + "\n");
+ logger.error(" " + e.getMessage());
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ InputStream input = null;
+ try {
+ input = url.openStream();
+ } catch (final IOException e1) {
+ logger.error("Unable to create Reader for: " + args[0] + "\n");
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ FileOutputStream output = null;
+ try {
+ output = new FileOutputStream(args[1]);
+ } catch (final FileNotFoundException e2) {
+ logger.error("Unable to create FileOutputStream for: "
+ + args[1] + "\n");
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ final CharSetParser parser = new CharSetParser(input);
+ try {
+ parser.parseList();
+ } catch (final IOException e3) {
+ logger.error("Error parsing: " + args[0] + "\n");
+ logger.error(" " + e3.getMessage());
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ } catch (final PsException e3) {
+ logger.error("Error parsing: " + args[0] + "\n");
+ logger.error(" " + e3.getMessage());
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ try {
+ parser.writeAsJavaStatics(output);
+ } catch (final IOException e4) {
+ logger.error("Error writing to: " + args[1] + "\n");
+ logger.error(" " + e4.getMessage());
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(1);
+ }
+ /* CheckStyle: Allow System.exit() in main method. */
+ System.exit(0);
+ }
+
+}
Property changes on: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetParser.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.foray.primitive.sequence.IntArrayBuilder;
+
+/**
+ * Class containing hard-coded values that represent the "Windows ANSI"
+ * character set, also known as Windows Code Page 1252. Its members are the
+ * same as for the WinAnsiEncoding.
+ */
+public final class CharSetWindowsAnsi extends CharSet4a {
+
+ /** Constant needed for serialization. */
+ public static final long serialVersionUID = -639431722920767103L;
+
+ /** The singleton instance. */
+ private static CharSetWindowsAnsi theInstance;
+
+ /**
+ * Constructor.
+ */
+ private CharSetWindowsAnsi() {
+ super("WindowsANSI", new IntArrayBuilder().append(EncodingWinAnsi.getCodePoints()));
+ }
+
+ /**
+ * Returns the singleton instance of this class.
+ * @return The singleton isntance of this class.
+ */
+ public static CharSetWindowsAnsi getInstance() {
+ if (CharSetWindowsAnsi.theInstance == null) {
+ CharSetWindowsAnsi.theInstance = new CharSetWindowsAnsi();
+ }
+ return CharSetWindowsAnsi.theInstance;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isStatic() {
+ return true;
+ }
+
+ /**
+ * Method ensuring that the singleton nature of this class is not broken by
+ * deserialization.
+ * @return The singleton instance, ignoring any object stream input.
+ */
+ private Object readResolve() {
+ return CharSetWindowsAnsi.getInstance();
+ }
+
+}
Property changes on: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap00Ttf4a.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap00Ttf4a.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap00Ttf4a.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2006 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.axsl.ps.Cmap;
+
+/**
+ * Abstract superclass for all Cmap4a Tables.
+ */
+public abstract class Cmap00Ttf4a implements Cmap {
+
+ /** Constant needed for serialization. */
+ public static final long serialVersionUID = -6516855352094857929L;
+
+ @Override
+ public boolean canEncode(final int codePoint) {
+ return this.encode(codePoint) > -1;
+ }
+
+}
Property changes on: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap00Ttf4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04Ttf4a.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04Ttf4a.java (rev 0)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/Cmap04Ttf4a.java 2023-01-05 01:42:09 UTC (rev 13019)
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps.encode;
+
+import org.axsl.ps.Cmap04Ttf;
+
+/**
+ * Class containing a set of 16-bit Unicode ranges that sequentially map to the same-sized range of glyph indexes.
+ * The contents are analogous to a Format 4 TrueType Font cmap table (from which this class derives its name).
+ */
+public class Cmap04Ttf4a extends Cmap00Ttf4a implements Cmap04Ttf {
+
+ /** Constant needed for serialization. */
+ public static final long serialVersionUID = 985957847129472354L;
+
+ /** The name of this encoding. */
+ private String name;
+
+ /** The array of entries. */
+ private Cmap04TtfEntry4a[] entries;
+
+ /** Counter to the last entry added. */
+ private int lastEntryAdded = -1;
+
+ /**
+ * Constructor.
+ * @param name The name of this encoding.
+ * @param expectedEntries The number of expected entries in this encoding.
+ * Setting this to the correct value will result in more efficient
+ * processing.
+ */
+ public Cmap04Ttf4a(final String name, final int expectedEntries) {
+ this.name = name;
+ this.entries = new Cmap04TtfEntry4a[expectedEntries];
+ }
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Add a new entry to this map.
+ * @param entry The entry to be added.
+ */
+ public void addEntry(final Cmap04TtfEntry4a entry) {
+ this.lastEntryAdded++;
+ if (this.lastEntryAdded >= this.entries.length) {
+ // Fails silently.
+ return;
+ }
+ this.entries[this.lastEntryAdded] = entry;
+ }
+
+ @Override
+ public void addEntry(final int unicodeStart, final int unicodeEnd, final char glyphStartIndex) {
+ final Cmap04TtfEntry4a newEntry = new Cmap04TtfEntry4a(unicodeStart, unicodeEnd,
+ glyphStartIndex);
+ addEntry(newEntry);
+ }
+
+ @Override
+ public void addEntry(final int unicodeStart, final int unicodeEnd, final CharSequence glyphIndexes) {
+ final Cmap04TtfEntry4a newEntry = new Cmap04TtfEntry4a(unicodeStart, unicodeEnd, glyphIndexes);
+ addEntry(newEntry);
+ }
+
+ @Override
+ public int encode(final int c) {
+ final Cmap04TtfEntry4a entry = entryForChar((char) c);
+ if (entry == null) {
+ return -1;
+ }
+ return entry.encodeCharacter((char) c);
+ }
+
+ /**
+ * Find the entry for a given character.
+ * @param c The character for which an entry is sought.
+ * @return The entry, or null if none is defined for {@code c}.
+ */
+ private Cmap04TtfEntry4a entryForChar(final char c) {
+ for (int i = 0; i < this.entries.length; i++) {
+ if (this.entries[i].containsChar(c)) {
+ return this.entries[i];
+ }
+ }
+ return null;
+ }
+
+ ...
[truncated message content] |
|
From: <vic...@us...> - 2023-01-05 00:44:21
|
Revision: 13018
http://sourceforge.net/p/foray/code/13018
Author: victormote
Date: 2023-01-05 00:44:20 +0000 (Thu, 05 Jan 2023)
Log Message:
-----------
Bootstrap new foray-ps-data project.
Modified Paths:
--------------
trunk/foray/settings.gradle
Added Paths:
-----------
trunk/foray/foray-ps-data/
trunk/foray/foray-ps-data/build.gradle
trunk/foray/foray-ps-data/src/
trunk/foray/foray-ps-data/src/main/
trunk/foray/foray-ps-data/src/main/java/
Added: trunk/foray/foray-ps-data/build.gradle
===================================================================
--- trunk/foray/foray-ps-data/build.gradle (rev 0)
+++ trunk/foray/foray-ps-data/build.gradle 2023-01-05 00:44:20 UTC (rev 13018)
@@ -0,0 +1,26 @@
+plugins {
+ id 'foray.library-conventions'
+}
+
+description = 'foray-ps-data'
+
+dependencies {
+// implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+
+// api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+// api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+
+// implementation (project(':foray-common'))
+// implementation (project(':foray-primitive'))
+
+// testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+}
+
+javadoc {
+ options.windowTitle = "FOray PostScript(tm) Data API"
+ options.docTitle = "FOray PostScript(tm) Data API"
+ options.header = "FOray PostScript(tm) Data API ${version}"
+}
+
+/* Last line of script. */
Property changes on: trunk/foray/foray-ps-data/build.gradle
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/settings.gradle
===================================================================
--- trunk/foray/settings.gradle 2023-01-04 04:07:57 UTC (rev 13017)
+++ trunk/foray/settings.gradle 2023-01-05 00:44:20 UTC (rev 13018)
@@ -18,6 +18,7 @@
include 'foray-pioneer'
include 'foray-primitive'
include 'foray-ps'
+include 'foray-ps-data'
include 'foray-render'
include 'foray-speech'
include 'foray-unicode'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-04 04:08:00
|
Revision: 13017
http://sourceforge.net/p/foray/code/13017
Author: victormote
Date: 2023-01-04 04:07:57 +0000 (Wed, 04 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert use of short[] to ShortSequence.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/eng.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/fin.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/hun.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/ita.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/mah.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/pol.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/por.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/rus.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/spa.jbso
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -36,6 +36,7 @@
import org.foray.font.format.type1.Type1Font;
import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.foray.primitive.sequence.ShortArrayBuilder;
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
@@ -50,6 +51,7 @@
import org.axsl.orthography.Orthography;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.IntSequence;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.CharSet;
import org.axsl.ps.Encoding;
import org.axsl.unicode.block.Basic_Latin_Block;
@@ -440,7 +442,7 @@
}
@Override
- public short[] getWidths() {
+ public ShortSequence getWidths() {
final FreeStandingFont fsf = this.getFreeStandingFont();
if (fsf == null) {
return null;
@@ -457,7 +459,7 @@
final int firstIndex = encoding.getFirstIndex();
final int lastIndex = encoding.getLastIndex();
final int size = lastIndex - firstIndex + 1;
- final short[] widthsByFontIndex = new short[size];
+ final ShortArrayBuilder widthsByFontIndex = new ShortArrayBuilder(size);
for (int i = firstIndex; i <= lastIndex; i++) {
// Decode the character for this index
final int codePoint = encoding.decode(i);
@@ -467,11 +469,11 @@
continue;
}
// Find the width for that charSet index.
- final short width = fsf.getWidths()[charSetIndex];
+ final short width = fsf.getWidths().shortAt(charSetIndex);
// Set the current array element to that width
- widthsByFontIndex[i - firstIndex] = width;
+ widthsByFontIndex.setShortAt(i - firstIndex, width);
}
- return widthsByFontIndex;
+ return widthsByFontIndex.toImmutable();
}
/**
@@ -478,15 +480,15 @@
* Returns the width array for reencoded glyphs in a subsetted font.
* @return The width array for the reencoded glyphs.
*/
- private short[] getSubsetWidths() {
+ private ShortSequence getSubsetWidths() {
final Subset subset = getSubset();
- final short[] originalWidths = getFreeStandingFont().getWidths();
- final short[] tmpWidth = new short[subset.numGlyphsUsed()];
+ final ShortSequence originalWidths = getFreeStandingFont().getWidths();
+ final ShortArrayBuilder tmpWidth = new ShortArrayBuilder(subset.numGlyphsUsed());
for (int i = 0; i < subset.numGlyphsUsed(); i++) {
final int originalIndex = subset.decodeSubsetIndex(i);
- tmpWidth[i] = originalWidths[originalIndex];
+ tmpWidth.setShortAt(i, originalWidths.shortAt(originalIndex));
}
- return tmpWidth;
+ return tmpWidth.toImmutable();
}
@Override
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -36,6 +36,7 @@
import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
import org.axsl.font.FontException;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
import org.axsl.ps.Encoding;
@@ -103,9 +104,8 @@
/** The width that should be used for glyphs that have no width recorded. */
private int missingWidth = 0;
- /** The array of glyph widths for this font, expressed in text-space
- * units. */
- private short[] width = null;
+ /** The array of glyph widths for this font, expressed in text-space units. */
+ private ShortSequence width = null;
/** This font's internal encoding. */
private Encoding internalEncoding;
@@ -377,7 +377,7 @@
* Returns the widths of the glyphs in this font in an array.
* @return The widths of the glyphs in this font.
*/
- public short[] getWidths() {
+ public ShortSequence getWidths() {
return this.width;
}
@@ -442,7 +442,7 @@
* Set the widths for this font.
* @param widths The width array to set.
*/
- protected void setWidths(final short[] widths) {
+ protected void setWidths(final ShortSequence widths) {
this.width = widths;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -39,6 +39,7 @@
import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
import org.axsl.font.FontException;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.BoundingBox;
import org.slf4j.Logger;
@@ -126,13 +127,13 @@
this.setItalicAngle(this.ttf.getItalicAngle().floatValue());
this.setNumGlyphs(this.ttf.getNumGlyphs());
this.setInternalEncoding(this.ttf.getUnicodeCMap());
- final short[] widths = this.ttf.getWidths();
+ final ShortSequence widths = this.ttf.getWidths();
this.setWidths(widths);
/*
* The last entry hMetrics entry in the hmtx table holds the default
* width for the remaining glyphs in the font.
*/
- this.setMissingWidth(widths[widths.length - 1]);
+ this.setMissingWidth(widths.shortAt(widths.length() - 1));
this.setKerning(this.ttf.getKerning());
this.setPanose(this.ttf.getPanose());
@@ -183,12 +184,12 @@
}
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[glyphIndex] / TypographicConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths().shortAt(glyphIndex) / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0] / TypographicConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths().shortAt(0) / TypographicConstants.MILLIPOINTS_PER_POINT;
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -271,12 +271,12 @@
public int width(final int metricIndex, final int fontSize) {
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[metricIndex] / TypographicConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths().shortAt(metricIndex) / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0] / TypographicConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths().shortAt(0) / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -409,7 +409,7 @@
final int metricIndex =
this.metricsFile.getCharSet().getIndex(codePoint);
if (metricIndex < 0
- || metricIndex > this.getWidths().length) {
+ || metricIndex > this.getWidths().length()) {
return Integer.MIN_VALUE;
}
return metricIndex;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -34,9 +34,11 @@
import org.foray.font.format.Panose4a;
import org.foray.font.output.FontPdfUtilities;
import org.foray.primitive.BitUtils;
+import org.foray.primitive.sequence.ShortArrayBuilder;
import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.Cmap;
@@ -685,12 +687,12 @@
* Return the widths of the glyphs in this font in an array.
* @return The widths of the glyphs in this font.
*/
- public short[] getWidths() {
- final short[] wx = new short[this.hmtxTable.numMtxEntries()];
- for (int i = 0; i < wx.length; i++) {
- wx[i] = convertFunitsToMillipoints(this.hmtxTable.getMtxEntry(i).getWidth());
+ public ShortSequence getWidths() {
+ final ShortArrayBuilder wx = new ShortArrayBuilder(this.hmtxTable.numMtxEntries());
+ for (int i = 0; i < wx.length(); i++) {
+ wx.setShortAt(i, convertFunitsToMillipoints(this.hmtxTable.getMtxEntry(i).getWidth()));
}
- return wx;
+ return wx.toImmutable();
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -32,7 +32,9 @@
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
import org.foray.primitive.BitUtils;
+import org.foray.primitive.sequence.ShortArrayBuilder;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
import org.axsl.ps.PsEncoding;
@@ -156,7 +158,8 @@
private float etmSlant;
/** The parsed extent table. */
- private short[] extentTable;
+ private ShortArrayBuilder extentTable;
+ /* TODO: Change this type to ShortSequence after cleaning up parsing. */
/** The parsed bounding boxes. */
private BoundingBox[] glyphBoundingBoxes;
@@ -491,7 +494,7 @@
* Returns the character widths for this font.
* @return The character widths for this font.
*/
- public short[] getCharWidths() {
+ public ShortSequence getCharWidths() {
return this.extentTable;
}
@@ -659,7 +662,7 @@
* Sets the extent table.
* @param extentTable The extent table to set.
*/
- public void setExtentTable(final short[] extentTable) {
+ public void setExtentTable(final ShortArrayBuilder extentTable) {
this.extentTable = extentTable;
}
@@ -667,7 +670,7 @@
* Returns the extent table.
* @return The extent table.
*/
- public short[] getExtentTable() {
+ public ShortArrayBuilder getExtentTable() {
return this.extentTable;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -33,6 +33,7 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.foray.primitive.sequence.ShortArrayBuilder;
import org.axsl.font.Font;
import org.axsl.font.FontException;
@@ -1041,7 +1042,8 @@
if (this.metrics.getCharSet() == null) {
this.codePoints = new int[this.qtyCharMetricsExpected];
}
- final short[] extentTable = new short[this.qtyCharMetricsExpected];
+ final ShortArrayBuilder extentTable = new ShortArrayBuilder(this.qtyCharMetricsExpected);
+ extentTable.setLength(this.qtyCharMetricsExpected);
this.metrics.setExtentTable(extentTable);
final BoundingBox[] glyphBoundingBoxes = new BoundingBox [this.qtyCharMetricsExpected];
this.metrics.setGlyphBoundingBoxes(glyphBoundingBoxes);
@@ -1073,7 +1075,7 @@
* @param psServer The PostScript server.
*/
private void createCharSet(final PsServer psServer) {
- final short[] extentTable = this.metrics.getExtentTable();
+ final ShortArrayBuilder extentTable = this.metrics.getExtentTable();
// Sort the char array and any related arrays
boolean anyChanges = true;
while (anyChanges) {
@@ -1085,9 +1087,7 @@
this.codePoints[i] = this.codePoints[i + 1];
this.codePoints[i + 1] = saveInt;
/* Also switch the same elements in the width array. */
- final short saveShort = extentTable[i];
- extentTable[i] = extentTable[i + 1];
- extentTable[i + 1] = saveShort;
+ extentTable.swap(i, i + 1);
anyChanges = true;
}
}
@@ -1458,13 +1458,13 @@
} else {
charIndex = this.metrics.getCharSet().getIndex(theChar);
}
- final short[] extentTable = this.metrics.getExtentTable();
+ final ShortArrayBuilder extentTable = this.metrics.getExtentTable();
if (charIndex < 0
- || charIndex > extentTable.length) {
+ || charIndex > extentTable.length()) {
throw new FontException("Cannot encode glyph name: " + this.glyphName + " at line: "
+ this.currentLineNumber);
}
- extentTable[charIndex] = this.charWidth;
+ extentTable.setShortAt(charIndex, this.charWidth);
this.metrics.getGlyphBoundingBoxes()[charIndex] = this.glyphBoundingBox;
if (this.glyphIndex > -1) {
/* Accumulate the information needed to create the internal
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -31,6 +31,7 @@
import org.foray.common.RandomAccessInput;
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
+import org.foray.primitive.sequence.ShortArrayBuilder;
import org.axsl.constants.CharsetConstants;
import org.axsl.constants.PrimitiveConstants;
@@ -349,7 +350,7 @@
if (charSet == null) {
return;
}
- final short[] extentTable = new short[charSet.size()];
+ final ShortArrayBuilder extentTable = new ShortArrayBuilder(charSet.size());
this.metrics.setMinWidth(this.metrics.getMaxWidth());
for (int i = this.dfFirstChar; i <= this.dfLastChar; i++) {
final short width = (short) this.input.readUnsignedShortLoHi();
@@ -357,10 +358,10 @@
final int codePoint = internalEncoding.decode(encodedIndex);
final int charSetIndex = charSet.getIndex(codePoint);
if (charSetIndex < 0
- || charSetIndex >= extentTable.length) {
+ || charSetIndex >= extentTable.length()) {
continue;
}
- extentTable[charSetIndex] = width;
+ extentTable.setShortAt(charSetIndex, width);
if (width < this.metrics.getMinWidth()) {
this.metrics.setMinWidth(width);
}
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Courier.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-BoldOblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica-Oblique.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Helvetica.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Symbol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Bold.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-BoldItalic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Italic.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/Times-Roman.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/main/resources/resources/org/foray/font/base14/ZapfDingbats.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -65,7 +65,7 @@
/* The WX records occupy rows 26 through 340 inclusive. Also, 315 agrees with the "StartCharMetrics 315" entry
* at line 25. */
- assertEquals(315, metrics.getExtentTable().length);
+ assertEquals(315, metrics.getExtentTable().length());
/* The KPX records occupy rows 344 through 2416 inclusive. Also, 2073 agrees with the "StartKernPairs 2073"
* entry at line 343. */
@@ -74,13 +74,13 @@
final CharSet charset = metrics.getCharSet();
assertEquals(315, charset.size());
/* Test the width of the space glyph. See line 26. */
- assertEquals(250, metrics.getCharWidths()[charset.getIndex(' ')]);
+ assertEquals(250, metrics.getCharWidths().shortAt(charset.getIndex(' ')));
/* Test the width of the "!" glyph. See line 27. */
- assertEquals(333, metrics.getCharWidths()[charset.getIndex('!')]);
+ assertEquals(333, metrics.getCharWidths().shortAt(charset.getIndex('!')));
/* Test the width of the i-macron glyph. See line 339. */
- assertEquals(278, metrics.getCharWidths()[charset.getIndex(0x012B)]);
+ assertEquals(278, metrics.getCharWidths().shortAt(charset.getIndex(0x012B)));
/* Test the width of the euro symbol glyph. See line 340. */
- assertEquals(500, metrics.getCharWidths()[charset.getIndex(0x20AC)]);
+ assertEquals(500, metrics.getCharWidths().shortAt(charset.getIndex(0x20AC)));
}
}
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/eng.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/fin.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/hun.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/ita.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/mah.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/pol.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/por.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/rus.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/spa.jbso
===================================================================
(Binary files differ)
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -41,6 +41,7 @@
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.primitive.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ShortSequence;
/**
* Class representing a "character identifier" font. See PDF Reference, Second
@@ -182,7 +183,7 @@
* Returns the array of glyph widths for this font.
* @return The array of glyph widths for this font.
*/
- private short[] getCIDWidths() {
+ private ShortSequence getCIDWidths() {
if (! this.fsFont.getFont().isEmbeddable()) {
return null;
}
@@ -197,9 +198,9 @@
* entry.
* @return The String containing the /W entry.
*/
- public static String widthArrayToPDFString(final short[] widthArray) {
+ public static String widthArrayToPDFString(final ShortSequence widthArray) {
if (widthArray == null
- || widthArray.length == 0) {
+ || widthArray.length() == 0) {
return StringUtils.EMPTY_STRING;
}
final StringBuilder p = new StringBuilder();
@@ -206,15 +207,14 @@
p.append(EOL + "/W [");
int start = 0;
int end = 0;
- while (start < widthArray.length) {
- final int nextEqualRunStarts = findStartOfNextEqualRun(widthArray,
- start);
+ while (start < widthArray.length()) {
+ final int nextEqualRunStarts = findStartOfNextEqualRun(widthArray, start);
if (nextEqualRunStarts < 0) {
/*
* There are no more Equal Runs. Therefore, write the remaining
* items out as an Unequal Run.
*/
- end = widthArray.length - 1;
+ end = widthArray.length() - 1;
writeWidthArrayUnequalRun(p, widthArray, start, end);
} else if (nextEqualRunStarts == start) {
/*
@@ -229,8 +229,7 @@
*/
end = nextEqualRunStarts - 1;
writeWidthArrayUnequalRun(p, widthArray, start, end);
- end = writeWidthArrayEqualRun(p, widthArray,
- nextEqualRunStarts);
+ end = writeWidthArrayEqualRun(p, widthArray, nextEqualRunStarts);
}
start = end + 1;
}
@@ -245,11 +244,11 @@
* @param start The first element being written.
* @param end The last element being written.
*/
- private static void writeWidthArrayUnequalRun(final StringBuilder p,
- final short[] widthArray, final int start, final int end) {
+ private static void writeWidthArrayUnequalRun(final StringBuilder p, final ShortSequence widthArray,
+ final int start, final int end) {
p.append(" " + start + " [");
for (int i = start; i <= end; i++) {
- p.append(widthArray[i]);
+ p.append(widthArray.shortAt(i));
if (i < end) {
p.append(" ");
}
@@ -264,21 +263,20 @@
* @param start The first element being written.
* @return The index in {@code widthArray} to the last element written.
*/
- private static int writeWidthArrayEqualRun(final StringBuilder p,
- final short[] widthArray, final int start) {
+ private static int writeWidthArrayEqualRun(final StringBuilder p, final ShortSequence widthArray, final int start) {
// First, compute the end-point of the run.
int end = -1;
- for (int i = start; i < widthArray.length && end < 0; i++) {
- if (i + 1 >= widthArray.length) {
- end = widthArray.length - 1;
+ for (int i = start; i < widthArray.length() && end < 0; i++) {
+ if (i + 1 >= widthArray.length()) {
+ end = widthArray.length() - 1;
break;
}
- if (widthArray[i] != widthArray[i + 1]) {
+ if (widthArray.shortAt(i) != widthArray.shortAt(i + 1)) {
end = i;
}
}
// Now, write the entry
- p.append(" " + start + " " + end + " " + widthArray[start]);
+ p.append(" " + start + " " + end + " " + widthArray.shortAt(start));
return end;
}
@@ -291,12 +289,11 @@
* @return The index to the first array element that starts a run of 3 or
* more equal values in the array, or -1 if there is not one.
*/
- private static int findStartOfNextEqualRun(final short[] widthArray,
- final int start) {
+ private static int findStartOfNextEqualRun(final ShortSequence widthArray, final int start) {
int returnValue = -1;
- for (int i = start; i < widthArray.length - 2 && returnValue < 0; i++) {
- if ((widthArray[i] == widthArray[i + 1])
- && (widthArray[i] == widthArray[i + 2])) {
+ for (int i = start; i < widthArray.length() - 2 && returnValue < 0; i++) {
+ if ((widthArray.shortAt(i) == widthArray.shortAt(i + 1))
+ && (widthArray.shortAt(i) == widthArray.shortAt(i + 2))) {
returnValue = i;
}
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java 2023-01-04 03:26:37 UTC (rev 13016)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java 2023-01-04 04:07:57 UTC (rev 13017)
@@ -41,6 +41,7 @@
import org.axsl.orthography.Orthography;
import org.axsl.pdf.PdfFont;
import org.axsl.primitive.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
import org.axsl.ps.PsEncoding;
@@ -253,7 +254,9 @@
return;
}
final PdfArray widthArray = new PdfArray();
- for (short aShort : this.fsFont.getWidths()) {
+ final ShortSequence widths = this.fsFont.getWidths();
+ for (int index = 0; index < widths.length(); index ++) {
+ final short aShort = widths.shortAt(index);
widthArray.add(aShort);
}
buffer.append("/Widths ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-04 03:26:40
|
Revision: 13016
http://sourceforge.net/p/foray/code/13016
Author: victormote
Date: 2023-01-04 03:26:37 +0000 (Wed, 04 Jan 2023)
Log Message:
-----------
Regenerate serialVersionUID to clean up cut-and-paste from similar classes.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractByteSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractCharSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractDoubleSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractFloatSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractIntSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractLongSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractShortSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceSubset.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractByteSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractByteSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractByteSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -48,7 +48,7 @@
public abstract class AbstractByteSequence extends AbstractSequence implements ByteSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -1357351215576051840L;
+ private static final long serialVersionUID = -7127309629480150165L;
/** Byte array containing all whitespace characters. */
private static final ByteArray WHITESPACE_CHARS = new ByteArray(" \n\r\t");
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractCharSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractCharSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractCharSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractCharSequence extends AbstractSequence implements CharSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -1486986783061908158L;
+ private static final long serialVersionUID = -4790770925304512788L;
@Override
public int indexOf(final char aChar) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractDoubleSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractDoubleSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractDoubleSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractDoubleSequence extends AbstractSequence implements DoubleSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 2366533487441850922L;
+ private static final long serialVersionUID = -460518736372819472L;
@Override
public int indexOf(final double aDouble) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractFloatSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractFloatSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractFloatSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractFloatSequence extends AbstractSequence implements FloatSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 2366533487441850922L;
+ private static final long serialVersionUID = 5696774869086963028L;
@Override
public int indexOf(final float aFloat) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractIntSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractIntSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractIntSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractIntSequence extends AbstractSequence implements IntSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 6308504447450398044L;
+ private static final long serialVersionUID = -7886656099618775680L;
@Override
public int indexOf(final int anInt) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractLongSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractLongSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractLongSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractLongSequence extends AbstractSequence implements LongSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -4561491878925977191L;
+ private static final long serialVersionUID = -6030416496206309157L;
@Override
public int indexOf(final long aLong) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractShortSequence.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractShortSequence.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractShortSequence.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -39,7 +39,7 @@
public abstract class AbstractShortSequence extends AbstractSequence implements ShortSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 2366533487441850922L;
+ private static final long serialVersionUID = -9026237362654665973L;
@Override
public int indexOf(final short aShort) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -60,7 +60,7 @@
Collections.unmodifiableList(new ArrayList<ByteArray>(0));
/** Constant needed for serialization. */
- private static final long serialVersionUID = -8330116207758178277L;
+ private static final long serialVersionUID = 7028830925894620170L;
/** The internal array. */
private byte[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -64,7 +64,7 @@
public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
/** Constant needed for serialization. */
- static final long serialVersionUID = 977379027446677063L;
+ private static final long serialVersionUID = -8991286918638672037L;
/** Default Capacity increment size. */
private static final int DEFAULT_BLOCK_SIZE = 2048;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -53,7 +53,7 @@
public class ByteSequenceChars extends AbstractByteSequence implements ByteSequence, Serializable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -8521627567574491374L;
+ private static final long serialVersionUID = -1751607833341542464L;
/** The internal sequence. */
private CharSequence sequence;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceSubset.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceSubset.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceSubset.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -38,7 +38,7 @@
public class ByteSequenceSubset extends AbstractByteSequence {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 6342437674139035081L;
+ private static final long serialVersionUID = -7660444189289581628L;
/** The wrapped sequence. */
private ByteSequencePlus wrappedSequence;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -42,7 +42,7 @@
public class CharArray extends AbstractCharSequence {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -7587343160916738493L;
+ private static final long serialVersionUID = -1539531984619174210L;
/** The internal array. */
private char[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -52,7 +52,7 @@
public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
/** Constant needed for serialization. */
- private static final long serialVersionUID = 3764720272508615707L;
+ private static final long serialVersionUID = 7689131033321204099L;
/** Default Capacity increment size. */
private static final int DEFAULT_BLOCK_SIZE = 2048;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -43,7 +43,7 @@
public class DoubleArray extends AbstractDoubleSequence implements DoubleSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -2196475282575408782L;
+ private static final long serialVersionUID = 2965730464073575273L;
/** The internal array. */
private double[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -44,7 +44,7 @@
public class DoubleArrayBuilder extends AbstractDoubleSequence implements DoubleSequenceMutable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -1176730727260937528L;
+ private static final long serialVersionUID = -2818261916734420658L;
/** The initial size of the array of no initial size is specified. */
private static final int DEFAULT_INITIAL_SIZE = 10;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -43,7 +43,7 @@
public class FloatArray extends AbstractFloatSequence implements FloatSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -2196475282575408782L;
+ private static final long serialVersionUID = 2128993525299346990L;
/** The internal array. */
private float[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -44,7 +44,7 @@
public class FloatArrayBuilder extends AbstractFloatSequence implements FloatSequenceMutable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -1176730727260937528L;
+ private static final long serialVersionUID = 3722709561000625299L;
/** The initial size of the array of no initial size is specified. */
private static final int DEFAULT_INITIAL_SIZE = 10;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -50,7 +50,7 @@
public static final IntArray EMPTY = new IntArray();
/** Constant needed for serialization. */
- private static final long serialVersionUID = -4297045025807702664L;
+ private static final long serialVersionUID = -321055952376755507L;
/** The internal array. */
private int[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -44,7 +44,7 @@
public class IntArrayBuilder extends AbstractIntSequence implements IntSequenceMutable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = 8469400214536606921L;
+ private static final long serialVersionUID = -3028365753797489349L;
/** The initial size of the array of no initial size is specified. */
private static final int DEFAULT_INITIAL_SIZE = 10;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -47,7 +47,7 @@
**************************************************************************************************************** */
/** Constant needed for serialization. */
- private static final long serialVersionUID = 2373745313861916853L;
+ private static final long serialVersionUID = -4526977471486128186L;
/** The internal array. */
private long[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -46,7 +46,7 @@
public class LongArrayBuilder extends AbstractLongSequence implements LongSequenceMutable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -5408291000284628952L;
+ private static final long serialVersionUID = -7063002585347383093L;
/** The initial size of the array of no initial size is specified. */
private static final int DEFAULT_INITIAL_SIZE = 10;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -46,7 +46,7 @@
public class NibbleArrayBuilder implements NibbleSequenceMutable, Serializable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -8706615311680792485L;
+ private static final long serialVersionUID = -6084170850295281240L;
/** Default Capacity increment size. */
private static final int DEFAULT_BLOCK_SIZE = 2048;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -43,7 +43,7 @@
public class ShortArray extends AbstractShortSequence implements ShortSequencePlus {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -2196475282575408782L;
+ private static final long serialVersionUID = -4243900857925687263L;
/** The internal array. */
private short[] array;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2023-01-04 00:29:45 UTC (rev 13015)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2023-01-04 03:26:37 UTC (rev 13016)
@@ -44,7 +44,7 @@
public class ShortArrayBuilder extends AbstractShortSequence implements ShortSequenceMutable {
/** Constant needed for serialization. */
- private static final long serialVersionUID = -1176730727260937528L;
+ private static final long serialVersionUID = -8119597960928521741L;
/** The initial size of the array of no initial size is specified. */
private static final int DEFAULT_INITIAL_SIZE = 10;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-04 00:29:48
|
Revision: 13015
http://sourceforge.net/p/foray/code/13015
Author: victormote
Date: 2023-01-04 00:29:45 +0000 (Wed, 04 Jan 2023)
Log Message:
-----------
Conform to aXSL changes: Clean up related to simulation of font features that aren't natively available in the font.
Modified Paths:
--------------
trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
Added Paths:
-----------
trunk/foray/foray-font/src/main/java/org/foray/font/config/FontFeatureSimulation4a.java
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -31,7 +31,6 @@
import org.axsl.content.CharContent;
import org.axsl.content.TextContent;
import org.axsl.font.FontContext;
-import org.axsl.font.FontServer;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoContext;
@@ -135,7 +134,7 @@
* Right now we rely on the user to configure the font correctly to avoid this. */
/* Has the font been configured to simulate small-caps? */
- if (getFontUse().simulateSmallCaps() == FontServer.SMALL_CAP_SIMULATION_INVALID) {
+ if (getFontUse().simulateSmallCaps() == null) {
return false;
}
return true;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -31,6 +31,7 @@
import org.foray.common.Environment;
import org.foray.common.url.classpath.Handler;
import org.foray.font.config.FontConfigParser;
+import org.foray.font.config.FontFeatureSimulation4a;
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.config.RegisteredFontFamily;
@@ -37,6 +38,7 @@
import org.foray.font.format.FontParserClient;
import org.axsl.font.FontException;
+import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.ps.Encoding;
@@ -58,6 +60,7 @@
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -76,7 +79,7 @@
public class FontServer4a implements FontServer, FontParserClient {
/** Constant indicating the default percentage to be applied when creating faux small-caps. */
- private static final int DEFAULT_SMALL_CAPS_SIZE = 80;
+ private static final BigDecimal DEFAULT_SMALL_CAPS_SIZE = new BigDecimal("80");
/** List of font-family aliases for which a default value is provided as the server is created. If an alias with
* one of these names is registered, overwriting the existing default value is treated normally instead of as a
@@ -234,7 +237,7 @@
final RegisteredFontFamily rff = this.registerFontFamily2("serif");
final RegisteredFont font = new RegisteredFont(rf, rff, null, org.axsl.font.Font.Style.NORMAL,
org.axsl.font.Font.Weight.NORMAL, org.axsl.font.Font.Variant.NORMAL,
- org.axsl.font.Font.Stretch.NORMAL);
+ org.axsl.font.Font.Stretch.NORMAL, FontFeatureSimulation.DEFAULT);
rff.registerFont(font);
} catch (final FontException e) {
getLogger().error("Unable to create default system font.");
@@ -576,6 +579,8 @@
if (fontFamily.equals("Base14-ZapfDingbats")) {
encoding = this.psServer.getPredefinedEncoding("ZapfDingbatsEncoding");
}
+ final FontFeatureSimulation4a simulation = new FontFeatureSimulation4a();
+ simulation.setSimulateSmallCaps(FontServer4a.DEFAULT_SMALL_CAPS_SIZE);
registerFontDescription(fontFamily,
fontName,
encoding,
@@ -583,10 +588,7 @@
weight,
org.axsl.font.Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- FontServer4a.DEFAULT_SMALL_CAPS_SIZE,
- FontServer.OBLIQUE_SIMULATION_INVALID,
- FontServer.OBLIQUE_SIMULATION_INVALID,
- new float[0]);
+ simulation);
}
/**
@@ -650,10 +652,7 @@
final org.axsl.font.Font.Variant fontVariant = org.axsl.font.Font.Variant.NORMAL;
final org.axsl.font.Font.Stretch fontStretch = org.axsl.font.Font.Stretch.NORMAL;
final RegisteredFont font = new RegisteredFont(rf, rff, null, fontStyle, fontWeight, fontVariant,
- fontStretch);
- font.setSimulateSmallCaps(FontServer.SMALL_CAP_SIMULATION_INVALID);
- font.setSimulateOblique(FontServer.OBLIQUE_SIMULATION_INVALID);
- font.setSimulateBackslant(FontServer.OBLIQUE_SIMULATION_INVALID);
+ fontStretch, FontFeatureSimulation.DEFAULT);
try {
rff.registerFont(font);
} catch (final FontException e) {
@@ -1009,16 +1008,11 @@
final org.axsl.font.Font.Weight weight,
final org.axsl.font.Font.Variant variant,
final org.axsl.font.Font.Stretch stretch,
- final float simulatedSmallCaps, final float simulatedOblique,
- final float simulatedBackslant, final float[] simulatedStretch)
+ final FontFeatureSimulation simulation)
throws FontException {
final RegisteredFontFamily rff = this.getRegisteredFontFamily(fontFamily);
final RegisteredFontContent rf = this.getRegisteredFont(fontID);
- final RegisteredFont font = new RegisteredFont(rf, rff, encoding, style, weight, variant, stretch);
- font.setSimulateSmallCaps(simulatedSmallCaps);
- font.setSimulateOblique(simulatedOblique);
- font.setSimulateBackslant(simulatedBackslant);
- font.setSimulateStretch(simulatedStretch);
+ final RegisteredFont font = new RegisteredFont(rf, rff, encoding, style, weight, variant, stretch, simulation);
rff.registerFont(font);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -39,11 +39,13 @@
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
+import org.axsl.font.Font.Stretch;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontException;
-import org.axsl.font.FontServer;
+import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
import org.axsl.primitive.sequence.ByteSequence;
@@ -57,6 +59,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
/**
* <p>An implementation of the aXSL {@link FontUse4a} interface.</p>
@@ -299,70 +302,42 @@
}
@Override
- public float simulateSmallCaps() {
- return this.registeredFontDesc.getSimulateSmallCaps();
+ public BigDecimal simulateSmallCaps() {
+ return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedSmallCaps();
}
@Override
public int smallCapsSize(final int fontSize) {
- final float percent = this.registeredFontDesc.getSimulateSmallCaps();
- if (percent == FontServer.SMALL_CAP_SIMULATION_INVALID) {
+ final BigDecimal percent = this.registeredFontDesc.getFontFeatureSimulation().getSimulatedSmallCaps();
+ if (percent == null) {
return fontSize;
}
- return Math.round(fontSize * percent / NumericConstants.PERCENT_CONVERSION);
+ if (percent.equals(FontFeatureSimulation.SMALL_CAP_SIMULATION_NATIVE)) {
+ final Font4a font = getFont();
+ int smallCapsSize = font.getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
+ smallCapsSize /= font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
+ smallCapsSize *= NumericConstants.PERCENT_CONVERSION;
+ return smallCapsSize;
+ }
+ return Math.round(fontSize * percent.floatValue() / NumericConstants.PERCENT_CONVERSION);
}
@Override
- public float simulateOblique() {
- return this.registeredFontDesc.getSimulateOblique();
+ public BigDecimal simulateOblique() {
+ return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedOblique();
}
@Override
- public float simulateBackslant() {
- return this.registeredFontDesc.getSimulateBackslant();
+ public BigDecimal simulateBackslant() {
+ return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedBackslant();
}
@Override
- public float simulateUltraCondensed() {
- return this.registeredFontDesc.getSimulateUltraCondensed();
+ public BigDecimal simulateStretch(final Stretch stretch) {
+ return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedStretch(stretch);
}
@Override
- public float simulateExtraCondensed() {
- return this.registeredFontDesc.getSimulateExtraCondensed();
- }
-
- @Override
- public float simulateCondensed() {
- return this.registeredFontDesc.getSimulateCondensed();
- }
-
- @Override
- public float simulateSemiCondensed() {
- return this.registeredFontDesc.getSimulateSemiCondensed();
- }
-
- @Override
- public float simulateSemiExpanded() {
- return this.registeredFontDesc.getSimulateSemiExpanded();
- }
-
- @Override
- public float simulateExpanded() {
- return this.registeredFontDesc.getSimulateExpanded();
- }
-
- @Override
- public float simulateExtraExpanded() {
- return this.registeredFontDesc.getSimulateExtraExpanded();
- }
-
- @Override
- public float simulateUltraExpanded() {
- return this.registeredFontDesc.getSimulateUltraExpanded();
- }
-
- @Override
public String getPostscriptName() {
final String postScriptName = this.getFont().getPostscriptName();
if (this.encoding == this.getFont().getInternalEncoding()) {
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -455,8 +455,10 @@
simulateStretch[RegisteredFont.SIMULATE_ULTRA_EXPANDED_INDEX]
= attributes.getValue("simulate-ultra-expanded");
+ /* TODO: Reactivate parsing of the simulation parameters and add them to simulation below. */
+ final FontFeatureSimulation4a simulation = new FontFeatureSimulation4a();
final RegisteredFont font = new RegisteredFont(content, this.currentFontFamily, encoding, style, weight,
- variant, stretch);
+ variant, stretch, simulation);
if (font.getRegisteredFont() == null) {
final UnresolvedFont unresolved = new UnresolvedFont();
Added: trunk/foray/foray-font/src/main/java/org/foray/font/config/FontFeatureSimulation4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/FontFeatureSimulation4a.java (rev 0)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/FontFeatureSimulation4a.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2023 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.font.config;
+
+import org.axsl.font.Font;
+import org.axsl.font.FontFeatureSimulation;
+
+import java.math.BigDecimal;
+import java.util.EnumMap;
+import java.util.Map;
+
+/**
+ * FOray implementation of {@link FontFeatureSimulation}.
+ */
+public class FontFeatureSimulation4a implements FontFeatureSimulation {
+
+ /** The percentage at which small-caps should be rendered. */
+ private BigDecimal simulatedSmallCaps;
+
+ /** The percentage by which the font should be skewed clockwise to simulate oblique. */
+ private BigDecimal simulatedOblique;
+
+ /** The percentage by which the font should be skewed counter-clockwise to simulate backslant. */
+ private BigDecimal simulatedBackslant;
+
+ /** Map whose key is a {@link Font.Stretch} instance, and whose value is the percentage by which the font should be
+ * stretched horizontally to simulate the stretch for that key. */
+ private Map<Font.Stretch, BigDecimal> fontStretchMap =
+ new EnumMap<Font.Stretch, BigDecimal>(Font.Stretch.class);
+
+ /**
+ * Sets the simulated small-caps.
+ * @param simulatedSmallCaps The percentage at which small-caps should be rendered, or
+ * FontFeatureSimulation.SMALL_CAP_SIMULATION_NATIVE if the font's native metrics should be used to compute the
+ * small-caps size.
+ */
+ public void setSimulateSmallCaps(final BigDecimal simulatedSmallCaps) {
+ this.simulatedSmallCaps = simulatedSmallCaps;
+ }
+
+ @Override
+ public BigDecimal getSimulatedSmallCaps() {
+ return this.simulatedSmallCaps;
+ }
+
+ /**
+ * Sets the simulated oblique angle.
+ * @param simulatedOblique The new simulated oblique angle.
+ */
+ public void setSimulateOblique(final BigDecimal simulatedOblique) {
+ this.simulatedOblique = simulatedOblique;
+ }
+
+ @Override
+ public BigDecimal getSimulatedOblique() {
+ return this.simulatedOblique;
+ }
+
+ /**
+ * Sets the simulated backslant angle.
+ * @param simulatedBackSlant The new simulated backslant angle.
+ */
+ public void setSimulateBackslant(final BigDecimal simulatedBackSlant) {
+ this.simulatedBackslant = simulatedBackSlant;
+ }
+
+ @Override
+ public BigDecimal getSimulatedBackslant() {
+ return this.simulatedBackslant;
+ }
+
+ /**
+ * Set the simulated font-stretch value for a given {@link Font.Stretch} key.
+ * @param fontStretch The font-stretch for which {@code value} will be set.
+ * @param value The percentage value by which the font should be stretched horizontally to simulate
+ * {@code fontStretch}.
+ */
+ public void setSimulateStretch(final Font.Stretch fontStretch, final BigDecimal value) {
+ this.fontStretchMap.put(fontStretch, value);
+ }
+
+ @Override
+ public BigDecimal getSimulatedStretch(final Font.Stretch fontStretch) {
+ return this.fontStretchMap.get(fontStretch);
+ }
+
+}
Property changes on: trunk/foray/foray-font/src/main/java/org/foray/font/config/FontFeatureSimulation4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -28,12 +28,8 @@
package org.foray.font.config;
-import org.foray.font.Font4a;
-
-import org.axsl.constants.NumericConstants;
-import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontServer;
+import org.axsl.font.FontFeatureSimulation;
import org.axsl.ps.Encoding;
/**
@@ -102,52 +98,10 @@
/** The stretch value of this description. */
private Font.Stretch fontStretch;
- /**
- * Percentage that should be applied to the standard font size to obtain
- * the font size to be used for simulating small caps.
- * A typical amount might be 80%.
- * Invalid or unset amounts are indicated by the value
- * {@link FontServer#SMALL_CAP_SIMULATION_INVALID}
- */
- private float simulateSmallCaps = FontServer.SMALL_CAP_SIMULATION_INVALID;
+ /** The font feature simulation for this registered font. */
+ private FontFeatureSimulation fontFeatureSimulation;
/**
- * Number of degrees by which the font should be slanted clockwise for the
- * simulated oblique effect.
- * Invalid or unset amounts are indicated by the value
- * {@link FontServer#SMALL_CAP_SIMULATION_INVALID}.
- */
- private float simulateOblique = FontServer.OBLIQUE_SIMULATION_INVALID;
-
- /**
- * Number of degrees by which the font should be slanted counterclockwise
- * for the simulated backslant effect.
- * Invalid or unset amounts are indicated by the value
- * {@link FontServer#SMALL_CAP_SIMULATION_INVALID}.
- */
- private float simulateBackslant = FontServer.OBLIQUE_SIMULATION_INVALID;
-
- /**
- * Array containing percentages by which the font should be stretched
- * horizontally for various font-stretch values.
- * Values greater than 100 will result in wider characters.
- * Values less than 100 will result in narrower characters.
- * Invalid or unset amounts are indicated by the value
- * {@link FontServer#STRETCH_SIMULATION_INVALID}.
- * Element 0 corresponds to ultra-condensed (the narrowest value), and
- * element 7 corresponds to ultra-expanded (the widest value).
- * Note that there is no element for "normal", since that does not need to
- * be simulated.
- */
- private float simulateStretch[]
- = new float[RegisteredFont.QTY_SIMULATED_STRETCH];
- {
- for (int i = 0; i < this.simulateStretch.length; i++) {
- this.simulateStretch[i] = FontServer.STRETCH_SIMULATION_INVALID;
- }
- }
-
- /**
* Constructor.
* @param rf The parent registered font.
* @param rff The parent registered font family.
@@ -156,10 +110,11 @@
* @param fontWeight The font weight(100, 200, bold, etc.)
* @param fontVariant The font variant (normal, small-caps)
* @param fontStretch The font stretch (normal, condensed, etc.)
+ * @param simulation The font features to be simulated if not natively present.
*/
public RegisteredFont(final RegisteredFontContent rf, final RegisteredFontFamily rff, final Encoding encoding,
final Font.Style fontStyle, final Font.Weight fontWeight, final Font.Variant fontVariant,
- final Font.Stretch fontStretch) {
+ final Font.Stretch fontStretch, final FontFeatureSimulation simulation) {
this.registeredFont = rf;
this.registeredFontFamily = rff;
this.encoding = encoding;
@@ -167,6 +122,7 @@
this.fontWeight = fontWeight;
this.fontVariant = fontVariant;
this.fontStretch = fontStretch;
+ this.fontFeatureSimulation = simulation == null ? FontFeatureSimulation.DEFAULT : simulation;
}
// /**
@@ -237,253 +193,6 @@
}
/**
- * Sets the simulated small-caps for this registered description.
- * @param simulateSmallCaps The percentage that should be applied to
- * simulated small-caps items for this font.
- * A value of "80" will result in small-caps items that are 80% of the
- * font-size of caps.
- */
- public void setSimulateSmallCaps(final float simulateSmallCaps) {
- this.simulateSmallCaps = simulateSmallCaps;
- }
-
- /**
- * Returns the simulated small-caps percentage.
- * @return The simulated small-caps percentage.
- */
- public float getSimulateSmallCaps() {
- if (this.simulateSmallCaps == FontServer.SMALL_CAP_SIMULATION_NATIVE) {
- final Font4a font = this.getRegisteredFont().getBestFont();
- this.simulateSmallCaps = font.getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps /= font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps *= NumericConstants.PERCENT_CONVERSION;
- }
- return this.simulateSmallCaps;
- }
-
- /**
- * Sets the simulated oblique angle.
- * @param simulateOblique The new simulated oblique angle.
- */
- public void setSimulateOblique(final float simulateOblique) {
- this.simulateOblique = simulateOblique;
- }
-
- /**
- * Returns the simulated oblique angle.
- * @return The simulated oblique angle.
- */
- public float getSimulateOblique() {
- return this.simulateOblique;
- }
-
- /**
- * Sets the simulated backslant angle.
- * @param simulateBackSlant The new simulated backslant angle.
- */
- public void setSimulateBackslant(final float simulateBackSlant) {
- this.simulateBackslant = simulateBackSlant;
- }
-
- /**
- * Returns the simulated backslant angle.
- * @return The simulated backslant angle.
- */
- public float getSimulateBackslant() {
- return this.simulateBackslant;
- }
-
- /**
- * Set the simulated font-stretch value by array position.
- * @param index Index into the internal array.
- * @param value The percentage value to which the array element should be
- * set.
- */
- public void setSimulateStretch(final int index, final float value) {
- if (index < 0) {
- return;
- }
- if (index > this.simulateStretch.length) {
- return;
- }
- this.simulateStretch[index] = value;
- }
-
- /**
- * Get the simulated font-stretch value by array position.
- * @param index Index into the internal array.
- * @return The percentage value of the stretch for the index provided.
- */
- public float getSimulateStretch(final int index) {
- if (this.simulateStretch == null) {
- return 0;
- }
- if (index < 0) {
- return 0;
- }
- if (index > this.simulateStretch.length) {
- return 0;
- }
- return this.simulateStretch[index];
- }
-
- /**
- * Sets the simulated stretch array.
- * @param newStretchArray The new simulated stretch array.
- */
- public void setSimulateStretch(final float[] newStretchArray) {
- if (newStretchArray == null
- || newStretchArray.length != this.simulateStretch.length) {
- return;
- }
- this.simulateStretch = newStretchArray;
- }
-
- /**
- * Sets the simulated "ultra-condensed" percentage.
- * @param value The new simulated "ultra-condensed" percentage.
- */
- public void setSimulateUltraCondensed(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_ULTRA_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "ultra-condensed" percentage.
- * @return The simulated "ultra-condensed" percentage.
- */
- public float getSimulateUltraCondensed() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_ULTRA_CONDENSED_INDEX);
- }
-
- /**
- * Sets the simulated "extra-condensed" percentage.
- * @param value The new simulated "extra-condensed" percentage.
- */
- public void setSimulateExtraCondensed(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_EXTRA_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "extra-condensed" percentage.
- * @return The simulated "extra-condensed" percentage.
- */
- public float getSimulateExtraCondensed() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_EXTRA_CONDENSED_INDEX);
- }
-
- /**
- * Sets the simulated "condensed" percentage.
- * @param value The new simulated "condensed" percentage.
- */
- public void setSimulateCondensed(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "condensed" percentage.
- * @return The simulated "condensed" percentage.
- */
- public float getSimulateCondensed() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_CONDENSED_INDEX);
- }
-
- /**
- * Sets the simulated "semi-condensed" percentage.
- * @param value The new simulated "semi-condensed" percentage.
- */
- public void setSimulateSemiCondensed(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_SEMI_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "semi-condensed" percentage.
- * @return The simulated "semi-condensed" percentage.
- */
- public float getSimulateSemiCondensed() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_SEMI_CONDENSED_INDEX);
- }
-
- /**
- * Sets the simulated "semi-expanded" percentage.
- * @param value The new simulated "semi-expanded" percentage.
- */
- public void setSimulateSemiExpanded(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_SEMI_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "semi-expanded" percentage.
- * @return The simulated "semi-expanded" percentage.
- */
- public float getSimulateSemiExpanded() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_SEMI_EXPANDED_INDEX);
- }
-
- /**
- * Sets the simulated "expanded" percentage.
- * @param value The new simulated "expanded" percentage.
- */
- public void setSimulateExpanded(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "expanded" percentage.
- * @return The simulated "expanded" percentage.
- */
- public float getSimulateExpanded() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_EXPANDED_INDEX);
- }
-
- /**
- * Sets the simulated "extra-expanded" percentage.
- * @param value The new simulated "extra-expanded" percentage.
- */
- public void setSimulateExtraExpanded(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_EXTRA_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "extra-expanded" percentage.
- * @return The simulated "extra-expanded" percentage.
- */
- public float getSimulateExtraExpanded() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_EXTRA_EXPANDED_INDEX);
- }
-
- /**
- * Sets the simulated "ultra-expanded" percentage.
- * @param value The new simulated "ultra-expanded" percentage.
- */
- public void setSimulateUltraExpanded(final float value) {
- this.setSimulateStretch(
- RegisteredFont.SIMULATE_ULTRA_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "ultra-expanded" percentage.
- * @return The simulated "ultra-expanded" percentage.
- */
- public float getSimulateUltraExpanded() {
- return this.getSimulateStretch(
- RegisteredFont.SIMULATE_ULTRA_EXPANDED_INDEX);
- }
-
- /**
* Returns the related registered font instance.
* @return The related registered font instance.
*/
@@ -596,7 +305,7 @@
return true;
}
if (considerSimulated) {
- if (this.simulateOblique != FontServer.OBLIQUE_SIMULATION_INVALID) {
+ if (this.fontFeatureSimulation.getSimulatedOblique() != null) {
/* If it can simulate oblique, it can be used for either
* oblique or italic or normal. */
switch (inputDesiredStyle) {
@@ -648,7 +357,7 @@
return true;
}
if (considerSimulated) {
- if (this.simulateSmallCaps != FontServer.SMALL_CAP_SIMULATION_INVALID) {
+ if (this.fontFeatureSimulation.getSimulatedSmallCaps() != null) {
/* If it can simulate small-caps, it can be used for either
* small-caps or normal. */
return true;
@@ -668,8 +377,7 @@
* considered in the test.
* @return True if and only if the style of this font description matches the criteria.
*/
- public boolean stretchMatches(final Font.Stretch desiredStretch,
- final boolean considerSimulated) {
+ public boolean stretchMatches(final Font.Stretch desiredStretch, final boolean considerSimulated) {
if (desiredStretch == Font.Stretch.ANY) {
return true;
}
@@ -678,14 +386,7 @@
return true;
}
if (considerSimulated) {
- final int simulatedIndex = stretchSimulationIndex(desiredStretch);
- if (simulatedIndex > -1) {
- final float simulationPercent =
- this.simulateStretch[simulatedIndex];
- if (simulationPercent != FontServer.STRETCH_SIMULATION_INVALID) {
- return true;
- }
- }
+ return this.fontFeatureSimulation.getSimulatedStretch(desiredStretch) != null;
}
return false;
}
@@ -800,34 +501,6 @@
return false;
}
- /**
- * Converts a {@link org.axsl.font.Font.Stretch} value into the appropriate index into
- * the simulated percentages.
- * @param stretch The Stretch value for which the index is needed.
- * @return The index into {@link #simulateStretch} for the stretch value.
- */
- private static int stretchSimulationIndex(final Font.Stretch stretch) {
- switch(stretch) {
- case ULTRA_CONDENSED:
- return RegisteredFont.SIMULATE_ULTRA_CONDENSED_INDEX;
- case EXTRA_CONDENSED:
- return RegisteredFont.SIMULATE_EXTRA_CONDENSED_INDEX;
- case CONDENSED:
- return RegisteredFont.SIMULATE_CONDENSED_INDEX;
- case SEMI_CONDENSED:
- return RegisteredFont.SIMULATE_SEMI_CONDENSED_INDEX;
- case SEMI_EXPANDED:
- return RegisteredFont.SIMULATE_SEMI_EXPANDED_INDEX;
- case EXPANDED:
- return RegisteredFont.SIMULATE_EXPANDED_INDEX;
- case EXTRA_EXPANDED:
- return RegisteredFont.SIMULATE_EXTRA_EXPANDED_INDEX;
- case ULTRA_EXPANDED:
- return RegisteredFont.SIMULATE_ULTRA_EXPANDED_INDEX;
- default: return -1;
- }
- }
-
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
@@ -850,4 +523,12 @@
return builder.toString();
}
+ /**
+ * Returns the font feature simulation for this registered font.
+ * @return The font feature simulation.
+ */
+ public FontFeatureSimulation getFontFeatureSimulation() {
+ return fontFeatureSimulation;
+ }
+
}
Modified: trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
===================================================================
--- trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2023-01-03 21:10:59 UTC (rev 13014)
+++ trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2023-01-04 00:29:45 UTC (rev 13015)
@@ -47,6 +47,7 @@
import org.axsl.font.Font;
import org.axsl.font.FontContext;
import org.axsl.font.FontException;
+import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontUse;
import org.axsl.pdf.PdfException;
import org.axsl.pdf.PdfFont;
@@ -96,7 +97,7 @@
final FreeStandingFont font = rf.getFreeStandingFont();
final RegisteredFont rfd = new RegisteredFont(rf, rff,
rf.getFreeStandingFont().getInternalEncoding(), Font.Style.NORMAL, Font.Weight.NORMAL,
- Font.Variant.NORMAL, Font.Stretch.NORMAL);
+ Font.Variant.NORMAL, Font.Stretch.NORMAL, FontFeatureSimulation.DEFAULT);
final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
final FontUse fontUse = new FontUse4a(consumerFont, rfd, EncodingStandard.getInstance());
final PdfFont pdfFont = doc.getPdfFont(fontUse);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 21:11:01
|
Revision: 13014
http://sourceforge.net/p/foray/code/13014
Author: victormote
Date: 2023-01-03 21:10:59 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert array parameters and return types to List.
Modified Paths:
--------------
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfContentStream4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2023-01-03 18:43:02 UTC (rev 13013)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2023-01-03 21:10:59 UTC (rev 13014)
@@ -73,11 +73,11 @@
/** The array of best breakpoints by class for a given active node. To conserve garbage collection, this is shared
* by all iterations, and must therefore be reset before being used.*/
- private LbBreakpoint[] bestBreakpointsByClass = new LbBreakpoint[KpFitnessClass.getQtyValues()];
+ private LbBreakpoint[] bestBreakpointsByClass = new LbBreakpoint[KpFitnessClass.VALUES.size()];
/** The array of best demerits by class for a given active node. To conserve garbage collection, this is shared
* by all iterations, and must therefore be reset before being used.*/
- private int[] capDarray = new int[KpFitnessClass.getQtyValues()];
+ private int[] capDarray = new int[KpFitnessClass.VALUES.size()];
/** The first node in the list of currently active nodes. */
private LbBreakpoint capA;
@@ -303,7 +303,7 @@
}
}
- for (int cIndex = 0; cIndex < KpFitnessClass.getQtyValues(); cIndex ++) {
+ for (int cIndex = 0; cIndex < KpFitnessClass.VALUES.size(); cIndex ++) {
if (this.capDarray[cIndex] <=
(capD + this.paraContext.getIncompatibleFitnessClassDemerits())) {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfContentStream4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfContentStream4a.java 2023-01-03 18:43:02 UTC (rev 13013)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfContentStream4a.java 2023-01-03 21:10:59 UTC (rev 13014)
@@ -49,6 +49,8 @@
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
+import java.math.BigDecimal;
+import java.util.List;
import java.util.Stack;
/**
@@ -320,7 +322,7 @@
}
@Override
- public void setDashPattern(final float[] dashArray, final float dashPhase) throws PdfException {
+ public void setDashPattern(final List<BigDecimal> dashArray, final BigDecimal dashPhase) throws PdfException {
final PdfDashPattern4a newDashPattern = new PdfDashPattern4a(dashArray, dashPhase);
if (! this.getCurrentGraphicsState().setLineDashPattern(newDashPattern)) {
// Nothing needs to change.
@@ -328,11 +330,11 @@
}
write("[");
if (dashArray != null) {
- for (int i = 0; i < dashArray.length; i++) {
+ for (int i = 0; i < dashArray.size(); i++) {
if (i != 0) {
write(" ");
}
- write(Float.toString(dashArray[i]));
+ write(dashArray.get(i).toString());
}
}
write("] " + dashPhase + " d" + EOL);
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java 2023-01-03 18:43:02 UTC (rev 13013)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java 2023-01-03 21:10:59 UTC (rev 13014)
@@ -28,27 +28,37 @@
package org.foray.pdf.graphics;
+import org.axsl.pdf.PdfContentStream;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
/**
* A PDF Line Dash Pattern.
* Instances of this class are immutable.
* @see "PDF Reference, Sixth Edition (PDF Version 1.7), Section 4.3.2."
*/
-public class PdfDashPattern4a {
+public final class PdfDashPattern4a {
/** Dash pattern that will draw a solid, unbroken line. */
- public static final PdfDashPattern4a SOLID_LINE = new PdfDashPattern4a(new float[0], 0);
+ public static final PdfDashPattern4a SOLID_LINE =
+ new PdfDashPattern4a(PdfContentStream.DASHPATTERN_SOLID, BigDecimal.ZERO);
/** Constant used to designate a "dotted" dash pattern. */
- public static final PdfDashPattern4a DOTTED = new PdfDashPattern4a(new float[] {1, 3}, 0);
+ public static final PdfDashPattern4a DOTTED =
+ new PdfDashPattern4a(PdfContentStream.DASHPATTERN_DOTTED, BigDecimal.ZERO);
/** Constant used to designate a "dashed" dash pattern. */
- public static final PdfDashPattern4a DASHED = new PdfDashPattern4a(new float[] {3, 3}, 0);
+ public static final PdfDashPattern4a DASHED =
+ new PdfDashPattern4a(PdfContentStream.DASHPATTERN_DASHED, BigDecimal.ZERO);
/** The dash array. */
- private float[] dashArray;
+ private List<BigDecimal> dashArray;
/** The dash phase. */
- private float dashPhase;
+ private BigDecimal dashPhase;
/**
* Constructor.
@@ -55,9 +65,9 @@
* @param dashArray The dash array for this pattern.
* @param dashPhase The dash phase for this pattern.
*/
- public PdfDashPattern4a(final float[] dashArray, final float dashPhase) {
- this.dashArray = new float[dashArray.length];
- System.arraycopy(dashArray, 0, this.dashArray, 0, dashArray.length);
+ public PdfDashPattern4a(final List<BigDecimal> dashArray, final BigDecimal dashPhase) {
+ this.dashArray = new ArrayList<BigDecimal>(dashArray.size());
+ Collections.copy(dashArray, this.dashArray);
this.dashPhase = dashPhase;
}
@@ -65,7 +75,7 @@
* Returns the dash array.
* @return The dash array.
*/
- public float[] getDashArray() {
+ public List<BigDecimal> getDashArray() {
return this.dashArray;
}
@@ -73,7 +83,7 @@
* Returns the dash phase.
* @return The dash phase.
*/
- public float getDashPhase() {
+ public BigDecimal getDashPhase() {
return this.dashPhase;
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 18:43:02 UTC (rev 13013)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 21:10:59 UTC (rev 13014)
@@ -91,6 +91,7 @@
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
+import java.math.BigDecimal;
import java.net.URL;
import java.util.Comparator;
import java.util.Date;
@@ -128,15 +129,6 @@
}
- /** Constant used to designate a solid dash pattern. */
- private static final float[] DASHPATTERN_SOLID = new float[] {};
-
- /** Constant used to designate a "dotted" dash pattern. */
- private static final float[] DASHPATTERN_DOTTED = new float[] {1, 3};
-
- /** Constant used to designate a "dashed" dash pattern. */
- private static final float[] DASHPATTERN_DASHED = new float[] {3, 3};
-
/** The PDF Document being created. */
private PdfDocument<?> pdfDoc;
@@ -269,19 +261,19 @@
newStrokeColor = this.getPDFDocument().createPdfColor(strokeColor);
}
- final float[] dashArray;
+ final List<BigDecimal> dashArray;
if (ruleStyle == null) {
- dashArray = PdfRenderer.DASHPATTERN_SOLID;
+ dashArray = PdfContentStream.DASHPATTERN_SOLID;
} else {
switch (ruleStyle) {
case DASHED:
- dashArray = PdfRenderer.DASHPATTERN_DASHED;
+ dashArray = PdfContentStream.DASHPATTERN_DASHED;
break;
case DOTTED:
- dashArray = PdfRenderer.DASHPATTERN_DOTTED;
+ dashArray = PdfContentStream.DASHPATTERN_DOTTED;
break;
default:
- dashArray = PdfRenderer.DASHPATTERN_SOLID;
+ dashArray = PdfContentStream.DASHPATTERN_SOLID;
}
}
@@ -291,7 +283,7 @@
getContentStream().setLineCapStyle(
PdfLineCapStyle.PROJECTING_SQUARE_CAP);
getContentStream().setLineWidth(toPoints(thickness));
- getContentStream().setDashPattern(dashArray, 0);
+ getContentStream().setDashPattern(dashArray, BigDecimal.ZERO);
getContentStream().setStrokeColor(newStrokeColor);
getContentStream().drawLine(line);
} catch (final PdfException e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 18:43:04
|
Revision: 13013
http://sourceforge.net/p/foray/code/13013
Author: victormote
Date: 2023-01-03 18:43:02 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert array parameters and return types to List.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2023-01-03 18:20:38 UTC (rev 13012)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2023-01-03 18:43:02 UTC (rev 13013)
@@ -424,7 +424,7 @@
}
@Override
- public BackgroundAreaG5[] getBackgroundAreas() {
+ public List<BackgroundAreaG5> getBackgroundAreas() {
final List<BackgroundAreaG5> backgroundAreas = new ArrayList<BackgroundAreaG5>();
/* We add them in z-order. */
/* 1. The table. */
@@ -447,8 +447,7 @@
}
/* 6. Cells. Cells handler their own backgrounds, so we ignore them
* here. */
- final BackgroundAreaG5[] returnArray = new BackgroundAreaG5[backgroundAreas.size()];
- return backgroundAreas.toArray(returnArray);
+ return backgroundAreas;
}
/**
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2023-01-03 18:20:38 UTC (rev 13012)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2023-01-03 18:43:02 UTC (rev 13013)
@@ -42,6 +42,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.Collections;
+import java.util.List;
/**
* Abstract base class for graphics.
@@ -63,9 +65,6 @@
/** The bit depth (bits per pixel) for a typical 3-channel color image. */
public static final byte BIT_DEPTH_COLOR = 24;
- /** An empty array of links to be used as the default. */
- private static final GraphicLink4a[] DEFAULT_LINKS = new GraphicLink4a[0];
-
/**
* The default maximimum number of bytes that need to be read in order to
* extract the basic information from a file.
@@ -104,7 +103,7 @@
private boolean isValid = true;
/** The links associated with this image. */
- private GraphicLink4a[] links;
+ private List<GraphicLink4a> links;
/**
* Constructor.
@@ -425,9 +424,9 @@
* Returns the links associated with this graphic.
* @return The links associated with this graphic.
*/
- public GraphicLink4a[] getLinks() {
+ public List<GraphicLink4a> getLinks() {
if (this.links == null) {
- return Graphic4a.DEFAULT_LINKS;
+ return Collections.emptyList();
}
return this.links;
}
@@ -436,7 +435,7 @@
* Sets the links for this graphic.
* @param links The new array of links for this graphic.
*/
- protected void setLinks(final GraphicLink4a[] links) {
+ protected void setLinks(final List<GraphicLink4a> links) {
this.links = links;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java 2023-01-03 18:20:38 UTC (rev 13012)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java 2023-01-03 18:43:02 UTC (rev 13013)
@@ -40,6 +40,8 @@
import java.awt.Color;
import java.awt.color.ColorSpace;
import java.net.URL;
+import java.util.Collections;
+import java.util.List;
/**
* An implementation of the axsl Graphic interface that provides the ability
@@ -47,9 +49,6 @@
*/
public class TempImage implements Graphic {
- /** An array of empty link to be used as a default. */
- private static final GraphicLink[] EMPTY_LINKS = new GraphicLink[0];
-
/** The image height, in millipoints. */
private int height;
@@ -175,8 +174,8 @@
}
@Override
- public GraphicLink[] getLinks() {
- return TempImage.EMPTY_LINKS;
+ public List<GraphicLink> getLinks() {
+ return Collections.emptyList();
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java 2023-01-03 18:20:38 UTC (rev 13012)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java 2023-01-03 18:43:02 UTC (rev 13013)
@@ -70,6 +70,7 @@
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
+import java.util.List;
/**
* Abstract base class for all renderers.
@@ -436,12 +437,11 @@
@Override
public Void visit(final TableAreaG5 area) throws GalleyVisitorException {
- /* Render background Areas for the table-related background-only
- * areas. */
- final BackgroundAreaG5[] backgroundAreas = area.getBackgroundAreas();
+ /* Render background Areas for the table-related background-only areas. */
+ final List<BackgroundAreaG5> backgroundAreas = area.getBackgroundAreas();
if (backgroundAreas != null) {
- for (int i = 0; i < backgroundAreas.length; i++) {
- final BackgroundAreaG5 bga = backgroundAreas[i];
+ for (int i = 0; i < backgroundAreas.size(); i++) {
+ final BackgroundAreaG5 bga = backgroundAreas.get(i);
markBackground(bga);
}
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 18:20:38 UTC (rev 13012)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 18:43:02 UTC (rev 13013)
@@ -389,7 +389,7 @@
*/
private void addSVGLinks(final SvgGraphic svg) {
/* Add any links found in the SVG to the current page. */
- final GraphicLink[] graphicLinks = svg.getLinks();
+ final List<? extends GraphicLink> graphicLinks = svg.getLinks();
for (GraphicLink graphicLink : graphicLinks) {
/* TODO: This is untested. */
final Shape shape = graphicLink.getShape();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 18:20:41
|
Revision: 13012
http://sourceforge.net/p/foray/code/13012
Author: victormote
Date: 2023-01-03 18:20:38 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert array parameters and return types to List.
Modified Paths:
--------------
trunk/foray/foray-core/src/main/java/org/foray/core/OutputConfig.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/OutputConfig.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/OutputConfig.java 2023-01-03 16:16:04 UTC (rev 13011)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/OutputConfig.java 2023-01-03 18:20:38 UTC (rev 13012)
@@ -36,6 +36,8 @@
import java.net.URL;
import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.List;
/**
* Configuration implementation for those configuration items that are
@@ -117,8 +119,10 @@
}
@Override
- public String[] getPdfFilters() {
- return (String[]) getValue("pdf-filters");
+ public List<String> getPdfFilters() {
+ /* TODO: Put this collection in the upstream process as a List from the start. */
+ final String[] array = (String[]) getValue("pdf-filters");
+ return Arrays.asList(array);
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 16:16:04 UTC (rev 13011)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2023-01-03 18:20:38 UTC (rev 13012)
@@ -95,6 +95,7 @@
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -226,9 +227,9 @@
} catch (final PdfException e) {
throw new OutputException(e);
}
- final String[] filters = this.getOutputConfiguration().getPdfFilters();
- for (int i = 0; i < filters.length; i++) {
- final String filter = filters[i];
+ final List<String> filters = this.getOutputConfiguration().getPdfFilters();
+ for (int i = 0; i < filters.size(); i++) {
+ final String filter = filters.get(i);
this.pdfDoc.addDefaultFilter(filter);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 16:16:07
|
Revision: 13011
http://sourceforge.net/p/foray/code/13011
Author: victormote
Date: 2023-01-03 16:16:04 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert array parameters and return types to List.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2023-01-03 14:32:12 UTC (rev 13010)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2023-01-03 16:16:04 UTC (rev 13011)
@@ -250,12 +250,12 @@
// Add the Standard Encoding to the System Dictionary.
PsName name = new PsName("StandardEncoding", false, false);
PsEncoding encoding = psServer.getPredefinedEncoding(name.getValue());
- PsArray array = new PsArray(encoding.getGlyphNames(), false);
+ PsArray array = new PsArray(encoding.getGlyphNames().toArray(), false);
systemDictToUse.addItem(this, name, array);
// Add the ISO Latin 1 Encoding to the System Dictionary.
name = new PsName("ISOLatin1Encoding", false, false);
encoding = psServer.getPredefinedEncoding(name.getValue());
- array = new PsArray(encoding.getGlyphNames(), false);
+ array = new PsArray(encoding.getGlyphNames().toArray(), false);
systemDictToUse.addItem(this, name, array);
// Add the System Dictionary to the dictionary stack.
this.dictionaryStack.push(systemDictToUse);
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2023-01-03 14:32:12 UTC (rev 13010)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2023-01-03 16:16:04 UTC (rev 13011)
@@ -42,6 +42,7 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.util.Arrays;
import java.util.List;
/**
@@ -185,7 +186,7 @@
}
@Override
- public String[] getGlyphNames() {
+ public List<String> getGlyphNames() {
final int listSize = getLastIndex() + 1;
final String[] glyphList = new String[listSize];
// Initialize all items to ".notdef".
@@ -204,7 +205,7 @@
final int encodingIndex = this.codePointIndexes2.charAt(i);
glyphList[encodingIndex] = glyphName;
}
- return glyphList;
+ return Arrays.asList(glyphList);
}
@Override
@@ -265,7 +266,7 @@
/* TODO: The baseEncoding is ignored for now. We need to consider it. */
final int maxCharsPerLine = 80;
final String indent = " ";
- final String[] glyphNames = this.getGlyphNames();
+ final List<String> glyphNames = this.getGlyphNames();
if (glyphNames == null) {
return null;
}
@@ -274,8 +275,8 @@
buffer.append("[ 0 \n");
buffer.append(indent);
int lineLength = indent.length();
- for (int i = 0; i < glyphNames.length; i++) {
- final String glyphName = glyphNames[i];
+ for (int i = 0; i < glyphNames.size(); i++) {
+ final String glyphName = glyphNames.get(i);
/* If line length will exceed maxCharsPerLine, add linefeed. */
final int sizeToAdd = glyphName.length() + 2;
if (lineLength + sizeToAdd > maxCharsPerLine) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 14:32:15
|
Revision: 13010
http://sourceforge.net/p/foray/code/13010
Author: victormote
Date: 2023-01-03 14:32:12 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Convert array parameters and return types to List.
Modified Paths:
--------------
trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2023-01-03 13:50:22 UTC (rev 13009)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2023-01-03 14:32:12 UTC (rev 13010)
@@ -31,6 +31,8 @@
import org.axsl.speech.SpeechServer;
import org.axsl.speech.Voice;
+import java.util.List;
+
/**
* The FOray implementation of {@link SpeechServer}.
*/
@@ -61,17 +63,17 @@
}
@Override
- public Voice selectVoiceXsl(final String[] familyList) {
+ public Voice selectVoiceXsl(final List<String> familyList) {
return selectVoiceCss(familyList);
}
@Override
- public Voice selectVoiceCss(final String[] familyList) {
+ public Voice selectVoiceCss(final List<String> familyList) {
if (familyList == null) {
return SpeechServer4a.DEFAULT_VOICE;
} else {
- for (int i = 0; i < familyList.length; i++) {
- final String familyToUse = familyList[i];
+ for (int i = 0; i < familyList.size(); i++) {
+ final String familyToUse = familyList.get(i);
if ("male".equalsIgnoreCase(familyToUse)) {
return SpeechServer4a.DEFAULT_VOICE_MALE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 13:50:24
|
Revision: 13009
http://sourceforge.net/p/foray/code/13009
Author: victormote
Date: 2023-01-03 13:50:22 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Switch the numeric aural return types from int x 1000 back to Number.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -2703,7 +2703,7 @@
}
@Override
- public int traitSpeechRate(final FoContext context) {
+ public Number traitSpeechRate(final FoContext context) {
return getPropertyList().traitSpeechRate(this, context);
}
@@ -2728,12 +2728,12 @@
}
@Override
- public int traitPitchRange(final FoContext context) {
+ public Number traitPitchRange(final FoContext context) {
return getPropertyList().traitPitchRange(this, context);
}
@Override
- public int traitVolume(final FoContext context) {
+ public Number traitVolume(final FoContext context) {
return getPropertyList().traitVolume(this, context);
}
@@ -2758,12 +2758,12 @@
}
@Override
- public int traitRichness(final FoContext context) {
+ public Number traitRichness(final FoContext context) {
return getPropertyList().traitRichness(this, context);
}
@Override
- public int traitStress(final FoContext context) {
+ public Number traitStress(final FoContext context) {
return getPropertyList().traitStress(this, context);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -4049,7 +4049,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The speech-rate property.
*/
- public int traitSpeechRate(final FoObj fobj, final FoContext context) {
+ public Number traitSpeechRate(final FoObj fobj, final FoContext context) {
final PdSpeechRate property = (PdSpeechRate) getProperty(FoPropertyId.SPEECH_RATE);
if (property != null) {
return property.getValue(context, fobj);
@@ -4129,7 +4129,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The pitch-range property.
*/
- public int traitPitchRange(final FoObj fobj, final FoContext context) {
+ public Number traitPitchRange(final FoObj fobj, final FoContext context) {
final AbstractAudioDial property = (AbstractAudioDial) getProperty(FoPropertyId.PITCH_RANGE);
if (property != null) {
return property.getValue(context, fobj);
@@ -4143,7 +4143,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The volume property.
*/
- public int traitVolume(final FoObj fobj, final FoContext context) {
+ public Number traitVolume(final FoObj fobj, final FoContext context) {
final PdVolume property = (PdVolume) getProperty(FoPropertyId.VOLUME);
if (property != null) {
return property.getValue(context, fobj);
@@ -4209,7 +4209,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The richness property.
*/
- public int traitRichness(final FoObj fobj, final FoContext context) {
+ public Number traitRichness(final FoObj fobj, final FoContext context) {
final AbstractAudioDial property = (AbstractAudioDial) getProperty(FoPropertyId.RICHNESS);
if (property != null) {
return property.getValue(context, fobj);
@@ -4223,7 +4223,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The stress property.
*/
- public int traitStress(final FoObj fobj, final FoContext context) {
+ public Number traitStress(final FoObj fobj, final FoContext context) {
final AbstractAudioDial property = (AbstractAudioDial) getProperty(FoPropertyId.STRESS);
if (property != null) {
return property.getValue(context, fobj);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -95,7 +95,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public int getValue(final FoContext context, final FoObj fobj) {
+ public Number getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalNumber()) {
return value().evalNumber().intValue();
}
@@ -121,7 +121,8 @@
* is needed.
* @return The initial value for this property.
*/
- public static int getValueNoInstance(final FoContext context, final FoObj fobj, final FoPropertyId propertyType) {
+ public static Number getValueNoInstance(final FoContext context, final FoObj fobj,
+ final FoPropertyId propertyType) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
switch (propertyType) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -152,7 +152,7 @@
* is computed in units of words-per-minute, so we multiply by
* 60,000 to convert from minutes to milliseconds.
*/
- final double base = 1 / fobj.traitSpeechRate(context) * 60000;
+ final double base = 1 / fobj.traitSpeechRate(context).floatValue() * 60000;
return (int) Math.round(base * percentage.doubleValue());
}
if (value().canEvalKeyword()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -117,7 +117,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public int getValue(final FoContext context, final FoObj fobj) {
+ public Number getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalNumber()) {
return value().evalNumber().intValue();
}
@@ -143,10 +143,10 @@
return PdSpeechRate.SPEECH_RATE_X_FAST;
}
case FASTER: {
- return getValueNoInstance(context, fobj) + PdSpeechRate.SPEECH_RATE_RELATIVE_INCREMENT;
+ return getValueNoInstance(context, fobj).floatValue() + PdSpeechRate.SPEECH_RATE_RELATIVE_INCREMENT;
}
case SLOWER: {
- return getValueNoInstance(context, fobj) - PdSpeechRate.SPEECH_RATE_RELATIVE_INCREMENT;
+ return getValueNoInstance(context, fobj).floatValue() - PdSpeechRate.SPEECH_RATE_RELATIVE_INCREMENT;
}
default: {
throw this.unexpectedRetrieval();
@@ -162,7 +162,7 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static int getValueNoInstance(final FoContext context, final FoObj fobj) {
+ public static Number getValueNoInstance(final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitSpeechRate(context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java 2023-01-03 11:59:29 UTC (rev 13008)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java 2023-01-03 13:50:22 UTC (rev 13009)
@@ -121,15 +121,15 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public int getValue(final FoContext context, final FoObj fobj) {
+ public Number getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalPercentage()) {
- final int base = getInheritedValue(context, fobj);
- if (base < 0) {
+ final Number base = getInheritedValue(context, fobj);
+ if (base.floatValue() < 0) {
// Handle the special case of "silent"
return base;
}
final Number percent = value().evalPercentage();
- int product = (int) Math.round(percent.doubleValue() * base);
+ int product = (int) Math.round(percent.doubleValue() * base.floatValue());
product = Math.max(product, 0);
product = Math.min(product, NumericConstants.PERCENT_CONVERSION);
return product;
@@ -175,7 +175,7 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static int getValueNoInstance(final FoContext context, final FoObj fobj) {
+ public static Number getValueNoInstance(final FoContext context, final FoObj fobj) {
return getInheritedValue(context, fobj);
}
@@ -185,7 +185,7 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- private static int getInheritedValue(final FoContext context, final FoObj fobj) {
+ private static Number getInheritedValue(final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitVolume(context);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 11:59:32
|
Revision: 13008
http://sourceforge.net/p/foray/code/13008
Author: victormote
Date: 2023-01-03 11:59:29 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Conform to aXSL change: Rename method for clarity.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2023-01-03 11:15:20 UTC (rev 13007)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java 2023-01-03 11:59:29 UTC (rev 13008)
@@ -285,7 +285,7 @@
if (column == null) {
getAreaTree().logWarning("No table-column specification for column " + (i + 1) + ".");
} else {
- final double tu = column.traitColumnWidthTableUnits().doubleValue();
+ final double tu = column.traitProportionalColumnWidthUnits().doubleValue();
/* Keep track of minimum number of proportional units in any
* column which has only proportional units. */
if (tu > 0 && tu < tuMin
@@ -384,9 +384,9 @@
if (column != null) {
//Compute the width of the column
int colWidth = -1;
- if (column.traitColumnWidthTableUnits().doubleValue() > 0) {
+ if (column.traitProportionalColumnWidthUnits().doubleValue() > 0) {
//Proportional width
- colWidth = (int) (column.traitColumnWidthTableUnits().doubleValue() * dUnitLength);
+ colWidth = (int) (column.traitProportionalColumnWidthUnits().doubleValue() * dUnitLength);
} else {
//Fixed width
colWidth = column.traitColumnWidth(this);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-03 11:15:20 UTC (rev 13007)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-03 11:59:29 UTC (rev 13008)
@@ -3643,7 +3643,7 @@
}
@Override
- public Number traitColumnWidthTableUnits() {
+ public Number traitProportionalColumnWidthUnits() {
// TODO Auto-generated method stub
return 0;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java 2023-01-03 11:15:20 UTC (rev 13007)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java 2023-01-03 11:59:29 UTC (rev 13008)
@@ -156,7 +156,7 @@
}
@Override
- public Number traitColumnWidthTableUnits() {
+ public Number traitProportionalColumnWidthUnits() {
return getPropertyList().getColumnWidthTableUnits();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 11:15:26
|
Revision: 13007
http://sourceforge.net/p/foray/code/13007
Author: victormote
Date: 2023-01-03 11:15:20 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Update foray-fotree to-do list.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-03 10:58:38 UTC (rev 13006)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-03 11:15:20 UTC (rev 13007)
@@ -74,6 +74,10 @@
* we could not switch on String. It could be that switching on String would be more efficient now.</li>
* <li>TODO: Investigate whether Java 1.8 lambda functions would help us with parsing.</li>
* <li>TODO: There is a lot of unit tests still be be written.</li>
+ * <li>For reasons similar to the question about object and property ID classes, we may be able to eliminate the
+ * {@link org.foray.fotree.fo.FoKeyword} enum, and simply wrap the keyword String inside of
+ * org.foray.fotree.fo.PvKeyordFo}. We still need a list of valid keywords, but probably don't need to have the
+ * enum any more.</li>
* </ul>
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-03 10:58:42
|
Revision: 13006
http://sourceforge.net/p/foray/code/13006
Author: victormote
Date: 2023-01-03 10:58:38 +0000 (Tue, 03 Jan 2023)
Log Message:
-----------
Replace separate list of keywords with a copy of the FoKeyword enum and a custom binary search through it.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -756,7 +756,7 @@
case NO_WRAP: return WrapOption.NO_WRAP;
case WRAP: return WrapOption.WRAP;
default: throw new IllegalArgumentException(
- "Illegal wrap-option value: " + foWrapOption.toXslFo());
+ "Illegal wrap-option value: " + foWrapOption.getText());
}
}
@@ -849,7 +849,7 @@
switch (foSpan) {
case NONE: return Span.NONE;
case ALL: return Span.ALL;
- default: throw new IllegalArgumentException("Illegal span value: " + foSpan.toXslFo());
+ default: throw new IllegalArgumentException("Illegal span value: " + foSpan.getText());
}
}
@@ -930,7 +930,7 @@
case BEFORE: return DisplayAlign.BEFORE;
case CENTER: return DisplayAlign.CENTER;
case AFTER: return DisplayAlign.AFTER;
- default: throw new IllegalArgumentException("Illegal display-align value: " + foDisplayAlign.toXslFo());
+ default: throw new IllegalArgumentException("Illegal display-align value: " + foDisplayAlign.getText());
}
}
@@ -956,7 +956,7 @@
switch (foRelativeAlign) {
case BEFORE: return RelativeAlign.BEFORE;
case BASELINE: return RelativeAlign.BASELINE;
- default: throw new IllegalArgumentException("Illegal display-align value: " + foRelativeAlign.toXslFo());
+ default: throw new IllegalArgumentException("Illegal display-align value: " + foRelativeAlign.getText());
}
}
@@ -993,7 +993,7 @@
case PAGE: return Break.PAGE;
case EVEN_PAGE: return Break.EVEN_PAGE;
case ODD_PAGE: return Break.ODD_PAGE;
- default: throw new IllegalArgumentException("Illegal break value: " + foBreak.toXslFo());
+ default: throw new IllegalArgumentException("Illegal break value: " + foBreak.getText());
}
}
@@ -1136,7 +1136,7 @@
case END_ON_EVEN: return ForcePageCount.END_ON_EVEN;
case END_ON_ODD: return ForcePageCount.END_ON_ODD;
case NO_FORCE: return ForcePageCount.NO_FORCE;
- default: throw new IllegalArgumentException("Illegal force-page-count value: " + foForcePageCount.toXslFo());
+ default: throw new IllegalArgumentException("Illegal force-page-count value: " + foForcePageCount.getText());
}
}
@@ -1185,7 +1185,7 @@
case AUTO: return Overflow.AUTO;
case ERROR_IF_OVERFLOW: return Overflow.ERROR_IF_OVERFLOW;
case REPEAT: return Overflow.REPEAT;
- default: throw new IllegalArgumentException("Illegal overflow value: " + foOverflow.toXslFo());
+ default: throw new IllegalArgumentException("Illegal overflow value: " + foOverflow.getText());
}
}
@@ -1236,7 +1236,7 @@
case LEFT: return TextAlign.START;
/* As per XSL-FO 1.1 Section 7.16.9, normalize "right" to "end". */
case RIGHT: return TextAlign.END;
- default: throw new IllegalArgumentException("Illegal text-align value: " + foTextAlign.toXslFo());
+ default: throw new IllegalArgumentException("Illegal text-align value: " + foTextAlign.getText());
}
}
@@ -1269,7 +1269,7 @@
case LEFT: return TextAlignLast.START;
/* As per XSL-FO 1.1 Section 7.16.10, normalize "right" to "end". */
case RIGHT: return TextAlignLast.END;
- default: throw new IllegalArgumentException("Illegal text-align-last value: " + foTextAlignLast.toXslFo());
+ default: throw new IllegalArgumentException("Illegal text-align-last value: " + foTextAlignLast.getText());
}
}
@@ -1437,7 +1437,7 @@
switch (foScaling) {
case UNIFORM: return Scaling.UNIFORM;
case NON_UNIFORM: return Scaling.NON_UNIFORM;
- default: throw new IllegalArgumentException("Illegal scaling value: " + foScaling.toXslFo());
+ default: throw new IllegalArgumentException("Illegal scaling value: " + foScaling.getText());
}
}
@@ -1464,7 +1464,7 @@
case RULE: return LeaderPattern.RULE;
case DOTS: return LeaderPattern.DOTS;
case USE_CONTENT: return LeaderPattern.USE_CONTENT;
- default: throw new IllegalArgumentException("Illegal leader-pattern value: " + foLeaderPattern.toXslFo());
+ default: throw new IllegalArgumentException("Illegal leader-pattern value: " + foLeaderPattern.getText());
}
}
@@ -1511,7 +1511,7 @@
case DOUBLE: return RuleStyle.DOUBLE;
case GROOVE: return RuleStyle.GROOVE;
case RIDGE: return RuleStyle.RIDGE;
- default: throw new IllegalArgumentException("Illegal rule style: " + foRuleStyle.toXslFo());
+ default: throw new IllegalArgumentException("Illegal rule style: " + foRuleStyle.getText());
}
}
@@ -1536,7 +1536,7 @@
case NONE: return LeaderAlignment.NONE;
case REFERENCE_AREA: return LeaderAlignment.REFERENCE_AREA;
case PAGE: return LeaderAlignment.PAGE;
- default: throw new IllegalArgumentException("Illegal leader-alignment: " + foLeaderAlignment.toXslFo());
+ default: throw new IllegalArgumentException("Illegal leader-alignment: " + foLeaderAlignment.getText());
}
}
@@ -1560,7 +1560,7 @@
switch (foTableLayout) {
case AUTO: return TableLayout.AUTO;
case FIXED: return TableLayout.FIXED;
- default: throw new IllegalArgumentException("Illegal table-layout: " + foTableLayout.toXslFo());
+ default: throw new IllegalArgumentException("Illegal table-layout: " + foTableLayout.getText());
}
}
@@ -1787,7 +1787,7 @@
case REPEAT_X: return BackgroundRepeat.REPEAT_X;
case REPEAT_Y: return BackgroundRepeat.REPEAT_Y;
case NO_REPEAT: return BackgroundRepeat.NO_REPEAT;
- default: throw new IllegalArgumentException("Illegal background-repeat: " + foBackgroundRepeat.toXslFo());
+ default: throw new IllegalArgumentException("Illegal background-repeat: " + foBackgroundRepeat.getText());
}
}
@@ -2004,7 +2004,7 @@
case AUTO: return AbsolutePosition.AUTO;
case ABSOLUTE: return AbsolutePosition.ABSOLUTE;
case FIXED: return AbsolutePosition.FIXED;
- default: throw new IllegalArgumentException("Illegal absolute-position: " + foAbsolutePosition.toXslFo());
+ default: throw new IllegalArgumentException("Illegal absolute-position: " + foAbsolutePosition.getText());
}
}
@@ -2024,7 +2024,7 @@
case SCROLL: return BackgroundAttachment.SCROLL;
case FIXED: return BackgroundAttachment.FIXED;
default: throw new IllegalArgumentException("Illegal background-attachment: " +
- foBackgroundAttachment.toXslFo());
+ foBackgroundAttachment.getText());
}
}
@@ -2050,7 +2050,7 @@
case BOTTOM: return writingMode.getBottom();
case LEFT: return writingMode.getLeft();
case RIGHT: return writingMode.getRight();
- default: throw new IllegalArgumentException("Illegal caption-side: " + foCaptionSide.toXslFo());
+ default: throw new IllegalArgumentException("Illegal caption-side: " + foCaptionSide.getText());
}
}
@@ -2069,7 +2069,7 @@
switch (foDirection) {
case LTR: return AbsoluteDirection.LEFT_TO_RIGHT;
case RTL: return AbsoluteDirection.RIGHT_TO_LEFT;
- default: throw new IllegalArgumentException("Illegal direction: " + foDirection.toXslFo());
+ default: throw new IllegalArgumentException("Illegal direction: " + foDirection.getText());
}
}
@@ -2090,7 +2090,7 @@
case AUTO: return FontSelectionStrategy.AUTO;
case CHARACTER_BY_CHARACTER: return FontSelectionStrategy.CHARACTER_BY_CHARACTER;
default: throw new IllegalArgumentException("Illegal font-selection-strategy: " +
- foFontSelectionStrategy.toXslFo());
+ foFontSelectionStrategy.getText());
}
}
@@ -2110,7 +2110,7 @@
case AUTO: return HyphenationKeep.AUTO;
case COLUMN: return HyphenationKeep.COLUMN;
case PAGE: return HyphenationKeep.PAGE;
- default: throw new IllegalArgumentException("Illegal hyphenation-keep: " + foHyphenationKeep.toXslFo());
+ default: throw new IllegalArgumentException("Illegal hyphenation-keep: " + foHyphenationKeep.getText());
}
}
@@ -2131,7 +2131,7 @@
case PRESERVE: return LinefeedTreatment.PRESERVE;
case TREAT_AS_SPACE: return LinefeedTreatment.TREAT_AS_SPACE;
case TREAT_AS_ZERO_WIDTH_SPACE: return LinefeedTreatment.TREAT_AS_ZERO_WIDTH_SPACE;
- default: throw new IllegalArgumentException("Illegal linefeed-treatment: " + foLinefeedTreatment.toXslFo());
+ default: throw new IllegalArgumentException("Illegal linefeed-treatment: " + foLinefeedTreatment.getText());
}
}
@@ -2153,7 +2153,7 @@
case CONSIDER_SHIFTS: return LineHeightShiftAdjustment.CONSIDER_SHIFTS;
case DISREGARD_SHIFTS: return LineHeightShiftAdjustment.DISREGARD_SHIFTS;
default: throw new IllegalArgumentException("Illegal line-height-shift-adjustment: " +
- foLineHeightShiftAdjustment.toXslFo());
+ foLineHeightShiftAdjustment.getText());
}
}
@@ -2175,7 +2175,7 @@
case FONT_HEIGHT: return LineStackingStrategy.FONT_HEIGHT;
case MAX_HEIGHT: return LineStackingStrategy.MAX_HEIGHT;
default: throw new IllegalArgumentException("Illegal line-stacking-strategy: " +
- foLineStackingStrategy.toXslFo());
+ foLineStackingStrategy.getText());
}
}
@@ -2194,7 +2194,7 @@
switch (foRelativePosition) {
case STATIC: return RelativePosition.STATIC;
case RELATIVE: return RelativePosition.RELATIVE;
- default: throw new IllegalArgumentException("Illegal relative-position: " + foRelativePosition.toXslFo());
+ default: throw new IllegalArgumentException("Illegal relative-position: " + foRelativePosition.getText());
}
}
@@ -2214,7 +2214,7 @@
case AUTO: return ScalingMethod.AUTO;
case INTEGER_PIXELS: return ScalingMethod.INTEGER_PIXELS;
case RESAMPLE_ANY_METHOD: return ScalingMethod.RESAMPLE_ANY_METHOD;
- default: throw new IllegalArgumentException("Illegal scaling-method: " + foScalingMethod.toXslFo());
+ default: throw new IllegalArgumentException("Illegal scaling-method: " + foScalingMethod.getText());
}
}
@@ -2240,7 +2240,7 @@
case SUPPRESS: return SuppressAtLineBreak.SUPPRESS;
case RETAIN: return SuppressAtLineBreak.RETAIN;
default: throw new IllegalArgumentException("Illegal suppress-at-line-break: " +
- foSuppressAtLineBreak.toXslFo());
+ foSuppressAtLineBreak.getText());
}
}
@@ -2260,7 +2260,7 @@
case NORMAL: return UnicodeBidi.NORMAL;
case EMBED: return UnicodeBidi.EMBED;
case BIDI_OVERRIDE: return UnicodeBidi.BIDI_OVERRIDE;
- default: throw new IllegalArgumentException("Illegal unicode-bidi: " + foUnicodeBidi.toXslFo());
+ default: throw new IllegalArgumentException("Illegal unicode-bidi: " + foUnicodeBidi.getText());
}
}
@@ -2283,7 +2283,7 @@
case IGNORE_IF_AFTER_LINEFEED: return WhiteSpaceTreatment.IGNORE_IF_AFTER_LINEFEED;
case IGNORE_IF_SURROUNDING_LINEFEED: return WhiteSpaceTreatment.IGNORE_IF_SURROUNDING_LINEFEED;
default: throw new IllegalArgumentException("Illegal white-space-treatment: " +
- foWhiteSpaceTreatment.toXslFo());
+ foWhiteSpaceTreatment.getText());
}
}
@@ -2310,7 +2310,7 @@
case ACTIVE: return ActiveState.ACTIVE;
case HOVER: return ActiveState.HOVER;
case FOCUS: return ActiveState.FOCUS;
- default: throw new IllegalArgumentException("Illegal active-state: " + foActiveState.toXslFo());
+ default: throw new IllegalArgumentException("Illegal active-state: " + foActiveState.getText());
}
}
@@ -2333,7 +2333,7 @@
case OUTSIDE: return Clear.OUTSIDE;
case BOTH: return Clear.BOTH;
case NONE: return Clear.NONE;
- default: throw new IllegalArgumentException("Illegal clear: " + foClear.toXslFo());
+ default: throw new IllegalArgumentException("Illegal clear: " + foClear.getText());
}
}
@@ -2352,7 +2352,7 @@
switch (foEmptyCells) {
case SHOW: return EmptyCells.SHOW;
case HIDE: return EmptyCells.HIDE;
- default: throw new IllegalArgumentException("Illegal empty-cells: " + foEmptyCells.toXslFo());
+ default: throw new IllegalArgumentException("Illegal empty-cells: " + foEmptyCells.getText());
}
}
@@ -2375,7 +2375,7 @@
case INSIDE: return Float.INSIDE;
case OUTSIDE: return Float.OUTSIDE;
case NONE: return Float.NONE;
- default: throw new IllegalArgumentException("Illegal float: " + foFloat.toXslFo());
+ default: throw new IllegalArgumentException("Illegal float: " + foFloat.getText());
}
}
@@ -2395,7 +2395,7 @@
case PAGINATE: return MediaUsage.PAGINATE;
case BOUNDED_IN_ONE_DIMENSION: return MediaUsage.BOUNDED_IN_ONE_DIMENSION;
case UNBOUNDED: return MediaUsage.UNBOUNDED;
- default: throw new IllegalArgumentException("Illegal media-usage: " + foMediaUsage.toXslFo());
+ default: throw new IllegalArgumentException("Illegal media-usage: " + foMediaUsage.getText());
}
}
@@ -2420,7 +2420,7 @@
case NUM_NEGATIVE_180: return ReferenceOrientation.ROTATION_180_DEGREES;
case NUM_NEGATIVE_270: return ReferenceOrientation.ROTATION_90_DEGREES;
default: throw new IllegalArgumentException("Illegal reference-orientation: " +
- foReferenceOrientation.toXslFo());
+ foReferenceOrientation.getText());
}
}
@@ -2447,7 +2447,7 @@
case RELATIVE_COLORIMETRIC: return RenderingIntent.RELATIVE_COLORIMETRIC;
case SATURATION: return RenderingIntent.SATURATION;
case ABSOLUTE_COLORIMETRIC: return RenderingIntent.ABSOLUTE_COLORIMETRIC;
- default: throw new IllegalArgumentException("Illegal rendering-intent: " + foRenderingIntent.toXslFo());
+ default: throw new IllegalArgumentException("Illegal rendering-intent: " + foRenderingIntent.getText());
}
}
@@ -2466,7 +2466,7 @@
switch (foShowDestination) {
case REPLACE: return ShowDestination.REPLACE;
case NEW: return ShowDestination.NEW;
- default: throw new IllegalArgumentException("Illegal show-destination: " + foShowDestination.toXslFo());
+ default: throw new IllegalArgumentException("Illegal show-destination: " + foShowDestination.getText());
}
}
@@ -2485,7 +2485,7 @@
switch (foSpeakHeader) {
case ONCE: return SpeakHeader.ONCE;
case ALWAYS: return SpeakHeader.ALWAYS;
- default: throw new IllegalArgumentException("Illegal speak-header: " + foSpeakHeader.toXslFo());
+ default: throw new IllegalArgumentException("Illegal speak-header: " + foSpeakHeader.getText());
}
}
@@ -2505,7 +2505,7 @@
case NORMAL: return Speak.NORMAL;
case NONE: return Speak.NONE;
case SPELL_OUT: return Speak.SPELL_OUT;
- default: throw new IllegalArgumentException("Illegal speak: " + foSpeak.toXslFo());
+ default: throw new IllegalArgumentException("Illegal speak: " + foSpeak.getText());
}
}
@@ -2524,7 +2524,7 @@
switch (foSpeakNumeral) {
case DIGITS: return SpeakNumeral.DIGITS;
case CONTINUOUS: return SpeakNumeral.CONTINUOUS;
- default: throw new IllegalArgumentException("Illegal speak-numeral: " + foSpeakNumeral.toXslFo());
+ default: throw new IllegalArgumentException("Illegal speak-numeral: " + foSpeakNumeral.getText());
}
}
@@ -2543,7 +2543,7 @@
switch (foSpeakPunctuation) {
case CODE: return SpeakPunctuation.CODE;
case NONE: return SpeakPunctuation.NONE;
- default: throw new IllegalArgumentException("Illegal speak-punctuation: " + foSpeakPunctuation.toXslFo());
+ default: throw new IllegalArgumentException("Illegal speak-punctuation: " + foSpeakPunctuation.getText());
}
}
@@ -2562,7 +2562,7 @@
switch (foStartingState) {
case SHOW: return StartingState.SHOW;
case HIDE: return StartingState.HIDE;
- default: throw new IllegalArgumentException("Illegal starting-state: " + foStartingState.toXslFo());
+ default: throw new IllegalArgumentException("Illegal starting-state: " + foStartingState.getText());
}
}
@@ -2583,7 +2583,7 @@
case UPPERCASE: return TextTransform.UPPERCASE;
case LOWERCASE: return TextTransform.LOWERCASE;
case NONE: return TextTransform.NONE;
- default: throw new IllegalArgumentException("Illegal text-transform: " + foTextTransform.toXslFo());
+ default: throw new IllegalArgumentException("Illegal text-transform: " + foTextTransform.getText());
}
}
@@ -2603,7 +2603,7 @@
case VISIBLE: return Visibility.VISIBLE;
case HIDDEN: return Visibility.HIDDEN;
case COLLAPSE: return Visibility.COLLAPSE;
- default: throw new IllegalArgumentException("Illegal visibility: " + foVisibility.toXslFo());
+ default: throw new IllegalArgumentException("Illegal visibility: " + foVisibility.getText());
}
}
@@ -2814,7 +2814,7 @@
case XSL_FOLLOWING: return SwitchTo.XSL_FOLLOWING;
case XSL_ANY: return SwitchTo.XSL_ANY;
case NOT_A_KEYWORD: return SwitchTo.NAME_LIST;
- default: throw new IllegalArgumentException("Illegal switch-to: " + foSwitchTo.toXslFo());
+ default: throw new IllegalArgumentException("Illegal switch-to: " + foSwitchTo.getText());
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -28,8 +28,6 @@
package org.foray.fotree.fo;
-import java.util.Arrays;
-
/**
* An enumeration of the XSL-FO property value keywords.
*/
@@ -829,276 +827,12 @@
/** The "xx-small" FO property value. */
XX_SMALL("xx-small"); // 261
- /**
- * An array of property keyword values.
- * These are kept in alphabetical order so that they can be used in a
- * binary search, and to make them easier to find.
- */
- private static final String[] PROPERTY_KEYWORD_VALUES = {
- "-180", // 0
- "-270", // 1
- "-90", // 2
- "0", // 3
- "180", // 4
- "270", // 5
- "90", // 6
- "above", // 7
- "absolute", // 8
- "absolute-colorimetric", // 9
- "active", // 10
- "after", // 11
- "after-edge", // 12
- "all", // 13
- "alphabetic", // 14
- "alternate", // 15
- "always", // 16
- "any", // 17
- "auto", // 18
- "auto-even", // 19
- "auto-odd", // 20
- "avoid", // 21
- "backslant", // 22
- "baseline", // 23
- "before", // 24
- "before-edge", // 25
- "below", // 26
- "bidi-override", // 27
- "blank", // 28
- "blink", // 29
- "block", // 30
- "bold", // 31
- "bolder", // 32
- "both", // 33
- "bottom", // 34
- "bounded-in-one-dimension", // 35
- "capitalize", // 36
- "center", // 37
- "center-left", // 38
- "center-right", // 39
- "central", // 40
- "character-by-character", // 41
- "child", // 42
- "code", // 43
- "collapse", // 44
- "collapse-with-precedence", // 45
- "column", // 46
- "condensed", // 47
- "consider-shifts", // 48
- "continuous", // 49
- "cursive", // 50
- "dashed", // 51
- "digits", // 52
- "discard", // 53
- "disregard-shifts", // 54
- "document", // 55
- "document-root", // 56
- "dots", // 57
- "dotted", // 58
- "double", // 59
- "embed", // 60
- "end", // 61
- "end-on-even", // 62
- "end-on-odd", // 63
- "error-if-overflow", // 64
- "even", // 65
- "even-page", // 66
- "expanded", // 67
- "extra-condensed", // 68
- "extra-expanded", // 69
- "false", // 70
- "fantasy", // 71
- "far-left", // 72
- "far-right", // 73
- "fast", // 74
- "faster", // 75
- "female", // 76
- "first", // 77
- "first-including-carryover", // 78
- "first-starting", // 79
- "first-starting-within-page", // 80
- "fixed", // 81
- "focus", // 82
- "font-height", // 83
- "force", // 84
- "groove", // 85
- "hanging", // 86
- "height", // 87
- "hidden", // 88
- "hide", // 89
- "high", // 90
- "higher", // 91
- "hover", // 92
- "ideographic", // 93
- "ignore", // 94
- "ignore-if-after-linefeed", // 95
- "ignore-if-before-linefeed", // 96
- "ignore-if-surrounding-linefeed", // 97
- "indefinite", // 98
- "indent", // 99
- "inherit", // 100
- "inset", // 101
- "inside", // 102
- "integer-pixels", // 103
- "italic", // 104
- "justify", // 105
- "landscape", // 106
- "large", // 107
- "larger", // 108
- "last", // 109
- "last-ending", // 110
- "last-ending-within-page", // 111
- "last-starting", // 112
- "last-starting-within-page", // 113
- "leave-separate", // 114
- "left", // 115
- "left-side", // 116
- "leftwards", // 117
- "level", // 118
- "lighter", // 119
- "line", // 120
- "line-height", // 121
- "line-through", // 122
- "link", // 123
- "loud", // 124
- "low", // 125
- "lower", // 126
- "lowercase", // 127
- "lr", // 128
- "lr-tb", // 129
- "ltr", // 130
- "male", // 131
- "mathematical", // 132
- "max-height", // 133
- "medium", // 134
- "merge", // 135
- "middle", // 136
- "monospace", // 137
- "narrower", // 138
- "new", // 139
- "no-blink", // 140
- "no-change", // 141
- "no-force", // 142
- "no-limit", // 143
- "no-line-through", // 144
- "no-link", // 145
- "no-overline", // 146
- "no-repeat", // 147
- "no-underline", // 148
- "no-wrap", // 149
- "non-blank", // 150
- "non-uniform", // 151
- "none", // 152
- "normal", // 153
- "not-a-keyword", // 154
- "not-blank", // 155
- "nowrap", // 156
- "oblique", // 157
- "odd", // 158
- "odd-page", // 159
- "once", // 160
- "only", // 161
- "outset", // 162
- "outside", // 163
- "overline", // 164
- "page", // 165
- "page-sequence", // 166
- "paginate", // 167
- "perceptual", // 168
- "portrait", // 169
- "pre", // 170
- "preserve", // 171
- "reference-area", // 172
- "relative", // 173
- "relative-colorimetric", // 174
- "repeat", // 175
- "repeat-x", // 176
- "repeat-y", // 177
- "replace", // 178
- "resample-any-method", // 179
- "reset-size", // 180
- "rest", // 181
- "retain", // 182
- "ridge", // 183
- "right", // 184
- "right-side", // 185
- "rightwards", // 186
- "rl", // 187
- "rl-tb", // 188
- "rtl", // 189
- "rule", // 190
- "sans-serif", // 191
- "saturation", // 192
- "scale-down-to-fit", // 193
- "scale-to-fit", // 194
- "scale-up-to-fit", // 195
- "scroll", // 196
- "semi-condensed", // 197
- "semi-expanded", // 198
- "separate", // 199
- "serif", // 200
- "show", // 201
- "silent", // 202
- "slow", // 203
- "slower", // 204
- "small", // 205
- "small-caps", // 206
- "smaller", // 207
- "soft", // 208
- "solid", // 209
- "space", // 210
- "spell-out", // 211
- "start", // 212
- "static", // 213
- "sub", // 214
- "super", // 215
- "suppress", // 216
- "table", // 217
- "table-fragment", // 218
- "tb", // 219
- "tb-rl", // 220
- "text-after-edge", // 221
- "text-before-edge", // 222
- "text-bottom", // 223
- "text-top", // 224
- "thick", // 225
- "thin", // 226
- "top", // 227
- "traditional", // 228
- "transparent", // 229
- "treat-as-space", // 230
- "treat-as-zero-width-space", // 231
- "true", // 232
- "ultra-condensed", // 233
- "ultra-expanded", // 234
- "unbounded", // 235
- "underline", // 236
- "uniform", // 237
- "uppercase", // 238
- "use-content", // 239
- "use-font-metrics", // 240
- "use-normal-stylesheet", // 241
- "use-script", // 242
- "use-target-processing-context", // 243
- "visible", // 244
- "visited", // 245
- "wider", // 246
- "width", // 247
- "wrap", // 248
- "x-fast", // 249
- "x-high", // 250
- "x-large", // 251
- "x-loud", // 252
- "x-low", // 253
- "x-slow", // 254
- "x-small", // 255
- "x-soft", // 256
- "xsl-any", // 257
- "xsl-following", // 258
- "xsl-preceding", // 259
- "xx-large", // 260
- "xx-small", // 261
- };
+
+
+ /** Keep a local copy of the enum array, for performance. */
+ private static final FoKeyword[] VALUES = values();
+
/** The keyword text. */
private String text;
@@ -1119,34 +853,42 @@
}
/**
- * Returns the XSL-FO name for this value.
- * For example, the enumeration {@link FoKeyword#XSL_PRECEDING} converts to
- * the XSL-FO name "xsl-preceding".
- * @return The XSL-FO name for the value enumeration.
- */
- public String toXslFo() {
- return FoKeyword.PROPERTY_KEYWORD_VALUES[this.ordinal()];
- }
-
- /**
- * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the
- * XSL-FO value instead of its enumerated name.
- * For example, for the XSL-FO value "xsl-preceding", the enum is
- * {@link FoKeyword#XSL_PRECEDING}.
- * The Java 1.5 Enum valueOf(String) method would operate on the enum name
- * "XSL_PRECEDING".
+ * Similar to the Java 1.5 Enum valueOf(String) method, but operates on the XSL-FO value instead of its enumerated
+ * name.
+ * For example, for the XSL-FO value "xsl-preceding", the enum is {@link FoKeyword#XSL_PRECEDING}.
+ * The Java 1.5 Enum valueOf(String) method would operate on the enum name "XSL_PRECEDING".
* This method instead operates on "xsl-preceding".
- * @param xslName The XSL-FO value for which the enumerated value is needed.
+ * @param text The XSL-FO value for which the enumerated value is needed.
* @return The enumerated value for {@code xslName}.
*/
- public static FoKeyword xslValueOf(final String xslName) {
- final int ordinal = Arrays.binarySearch(FoKeyword.PROPERTY_KEYWORD_VALUES,
- xslName);
- if (ordinal < 0
- || ordinal >= FoKeyword.values().length) {
+ public static FoKeyword xslValueOf(final String text) {
+ /* Non-standard binary search needed because the comparison is on a property of the items in the list being
+ * searched, not the item itself. */
+ if (text == null) {
return null;
}
- return FoKeyword.values()[ordinal];
+ int low = 0;
+ int high = VALUES.length - 1;
+ int mid;
+ while (low != high) {
+ mid = (low + high) / 2;
+ final int comparison = text.compareTo(VALUES[mid].text);
+ if (comparison == 0) {
+ return VALUES[mid];
+ }
+ if (comparison > 0) {
+ /* text is greater than mid. */
+ low = mid + 1;
+ } else {
+ /* test is less than mid. */
+ high = mid - 1;
+ }
+ }
+ if (text.equals(VALUES[low].text)) {
+ return VALUES[low];
+ }
+ /* Not found. */
+ return null;
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -131,7 +131,7 @@
case LAST_ENDING_WITHIN_PAGE:
return RetrievePosition.LAST_ENDING_WITHIN_PAGE;
default: throw new IllegalArgumentException(
- "Illegal retrieve-position: " + foRetrievePosition.toXslFo());
+ "Illegal retrieve-position: " + foRetrievePosition.getText());
}
}
@@ -155,7 +155,7 @@
case PAGE_SEQUENCE: return RetrieveBoundary.PAGE_SEQUENCE;
case DOCUMENT: return RetrieveBoundary.DOCUMENT;
default: throw new IllegalArgumentException(
- "Illegal retrieve-position: " + foRetrieveBoundary.toXslFo());
+ "Illegal retrieve-position: " + foRetrieveBoundary.getText());
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -165,7 +165,7 @@
}
default: {
throw new IllegalStateException("Invalid keyword for "
- + "border-width data type: " + keywordValue.toXslFo());
+ + "border-width data type: " + keywordValue.getText());
}
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -140,7 +140,7 @@
final PropertyValue pv = collection.getItem(i);
if (pv.canEvalKeyword()) {
final FoKeyword foValue = this.convertValueToFoValue(pv);
- returnArray.add(foValue.toXslFo());
+ returnArray.add(foValue.getText());
} else if (pv instanceof DtName) {
final DtName dtName = (DtName) pv;
returnArray.add(dtName.getValue());
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -122,7 +122,7 @@
case MALE:
case FEMALE:
case CHILD: {
- final List<String> returnArray = Arrays.asList(keyword.toXslFo());
+ final List<String> returnArray = Arrays.asList(keyword.getText());
return returnArray;
}
default: {
@@ -138,7 +138,7 @@
if (innerValue.canEvalKeyword()) {
final FoKeyword foValue = this.convertValueToFoValue(
innerValue);
- returnArray[i] = foValue.toXslFo();
+ returnArray[i] = foValue.getText();
} else if (innerValue instanceof DtName) {
final DtName name = (DtName) innerValue;
returnArray[i] = name.getValue();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderStyle.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderStyle.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -107,7 +107,7 @@
case INSET: return BorderStyle.INSET;
case OUTSET: return BorderStyle.OUTSET;
default: throw new IllegalArgumentException("Illegal border style: "
- + foBorderStyle.toXslFo());
+ + foBorderStyle.getText());
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2023-01-02 18:14:33 UTC (rev 13005)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2023-01-03 10:58:38 UTC (rev 13006)
@@ -152,7 +152,7 @@
this.conditionality = Conditionality.RETAIN;
} else {
throw new PropertyException("Invalid conditionality: "
- + conditionality.toXslFo());
+ + conditionality.getText());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-02 18:14:36
|
Revision: 13005
http://sourceforge.net/p/foray/code/13005
Author: victormote
Date: 2023-01-02 18:14:33 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Step one in combining the enums with the keyword values array.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2023-01-02 16:06:34 UTC (rev 13004)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2023-01-02 18:14:33 UTC (rev 13005)
@@ -35,357 +35,357 @@
*/
public enum FoKeyword {
- /** Constant indicating a "-180" FO property value. */
- NUM_NEGATIVE_180, // 0
+ /** The "-180" FO property value. */
+ NUM_NEGATIVE_180("-180"), // 0
- /** Constant indicating a "-270" FO property value. */
- NUM_NEGATIVE_270, // 1
+ /** The "-270" FO property value. */
+ NUM_NEGATIVE_270("-270"), // 1
- /** Constant indicating a "-90" FO property value. */
- NUM_NEGATIVE_90, // 2
+ /** The "-90" FO property value. */
+ NUM_NEGATIVE_90("-90"), // 2
- /** Constant indicating a "0" FO property value. */
- NUM_ZERO, // 3
+ /** The "0" FO property value. */
+ NUM_ZERO("0"), // 3
- /** Constant indicating a "180" FO property value. */
- NUM_180, // 4
+ /** The "180" FO property value. */
+ NUM_180("180"), // 4
- /** Constant indicating a "270" FO property value. */
- NUM_270, // 5
+ /** The "270" FO property value. */
+ NUM_270("270"), // 5
- /** Constant indicating a "90" FO property value. */
- NUM_90, // 6
+ /** The "90" FO property value. */
+ NUM_90("90"), // 6
- /** Constant indicating an "above" FO property value. */
- ABOVE, // 7
+ /** The "above" FO property value. */
+ ABOVE("above"), // 7
- /** Constant indicating an "absolute" FO property value. */
- ABSOLUTE, // 8
+ /** The "absolute" FO property value. */
+ ABSOLUTE("absolute"), // 8
- /** Constant indicating an "absolute-colorimetrics" FO property value. */
- ABSOLUTE_COLORIMETRIC, // 9
+ /** The "absolute-colorimetrics" FO property value. */
+ ABSOLUTE_COLORIMETRIC("absolute-colorimetric"), // 9
- /** Constant indicating an "active" FO property value. */
- ACTIVE, // 10
+ /** The "active" FO property value. */
+ ACTIVE("active"), // 10
- /** Constant indicating an "after" FO property value. */
- AFTER, // 11
+ /** The "after" FO property value. */
+ AFTER("after"), // 11
- /** Constant indicating an "after-edge" FO property value. */
- AFTER_EDGE, // 12
+ /** The "after-edge" FO property value. */
+ AFTER_EDGE("after-edge"), // 12
- /** Constant indicating an "all" FO property value. */
- ALL, // 13
+ /** The "all" FO property value. */
+ ALL("all"), // 13
- /** Constant indicating an "alphabetic" FO property value. */
- ALPHABETIC, // 14
+ /** The "alphabetic" FO property value. */
+ ALPHABETIC("alphabetic"), // 14
- /** Constant indicating an "alternate" FO property value. */
- ALTERNATE, // 15
+ /** The "alternate" FO property value. */
+ ALTERNATE("alternate"), // 15
- /** Constant indicating an "always" FO property value. */
- ALWAYS, // 16
+ /** The "always" FO property value. */
+ ALWAYS("always"), // 16
- /** Constant indicating an "any" FO property value. */
- ANY, // 17
+ /** The "any" FO property value. */
+ ANY("any"), // 17
- /** Constant indicating an "auto" FO property value. */
- AUTO, // 18
+ /** The "auto" FO property value. */
+ AUTO("auto"), // 18
- /** Constant indicating an "auto-even" FO property value. */
- AUTO_EVEN, // 19
+ /** The "auto-even" FO property value. */
+ AUTO_EVEN("auto-even"), // 19
- /** Constant indicating an "auto-odd" FO property value. */
- AUTO_ODD, // 20
+ /** The "auto-odd" FO property value. */
+ AUTO_ODD("auto-odd"), // 20
- /** Constant indicating an "avoid" FO property value. */
- AVOID, // 21
+ /** The "avoid" FO property value. */
+ AVOID("avoid"), // 21
- /** Constant indicating a "backslant" FO property value. */
- BACKSLANT, // 22
+ /** The "backslant" FO property value. */
+ BACKSLANT("backslant"), // 22
- /** Constant indicating a "baseline" FO property value. */
- BASELINE, // 23
+ /** The "baseline" FO property value. */
+ BASELINE("baseline"), // 23
- /** Constant indicating a "before" FO property value. */
- BEFORE, // 24
+ /** The "before" FO property value. */
+ BEFORE("before"), // 24
- /** Constant indicating a "before-edge" FO property value. */
- BEFORE_EDGE, // 25
+ /** The "before-edge" FO property value. */
+ BEFORE_EDGE("before-edge"), // 25
- /** Constant indicating a "below" FO property value. */
- BELOW, // 26
+ /** The "below" FO property value. */
+ BELOW("below"), // 26
- /** Constant indicating a "bidi-override" FO property value. */
- BIDI_OVERRIDE, // 27
+ /** The "bidi-override" FO property value. */
+ BIDI_OVERRIDE("bidi-override"), // 27
- /** Constant indicating a "blank" FO property value. */
- BLANK, // 28
+ /** The "blank" FO property value. */
+ BLANK("blank"), // 28
- /** Constant indicating a "blink" FO property value. */
- BLINK, // 29
+ /** The "blink" FO property value. */
+ BLINK("blink"), // 29
- /** Constant indicating a "block" FO property value. */
- BLOCK, // 30
+ /** The "block" FO property value. */
+ BLOCK("block"), // 30
- /** Constant indicating a "bold" FO property value. */
- BOLD, // 31
+ /** The "bold" FO property value. */
+ BOLD("bold"), // 31
- /** Constant indicating a "bolder" FO property value. */
- BOLDER, // 32
+ /** The "bolder" FO property value. */
+ BOLDER("bolder"), // 32
- /** Constant indicating a "both" FO property value. */
- BOTH, // 33
+ /** The "both" FO property value. */
+ BOTH("both"), // 33
- /** Constant indicating a "bottom" FO property value. */
- BOTTOM, // 34
+ /** The "bottom" FO property value. */
+ BOTTOM("bottom"), // 34
- /** Constant indicating a "bounded-in-one-dimension" FO property value. */
- BOUNDED_IN_ONE_DIMENSION, // 35
+ /** The "bounded-in-one-dimension" FO property value. */
+ BOUNDED_IN_ONE_DIMENSION("bounded-in-one-dimension"), // 35
- /** Constant indicating a "capitalize" FO property value. */
- CAPITALIZE, // 36
+ /** The "capitalize" FO property value. */
+ CAPITALIZE("capitalize"), // 36
- /** Constant indicating a "center" FO property value. */
- CENTER, // 37
+ /** The "center" FO property value. */
+ CENTER("center"), // 37
- /** Constant indicating a "center-left" FO property value. */
- CENTER_LEFT, // 38
+ /** The "center-left" FO property value. */
+ CENTER_LEFT("center-left"), // 38
- /** Constant indicating a "center-right" FO property value. */
- CENTER_RIGHT, // 39
+ /** The "center-right" FO property value. */
+ CENTER_RIGHT("center-right"), // 39
- /** Constant indicating a "central" FO property value. */
- CENTRAL, // 40
+ /** The "central" FO property value. */
+ CENTRAL("central"), // 40
- /** Constant indicating a "character-by-character" FO property value. */
- CHARACTER_BY_CHARACTER, // 41
+ /** The "character-by-character" FO property value. */
+ CHARACTER_BY_CHARACTER("character-by-character"), // 41
- /** Constant indicating a "child" FO property value. */
- CHILD, // 42
+ /** The "child" FO property value. */
+ CHILD("child"), // 42
- /** Constant indicating a "code" FO property value. */
- CODE, // 43
+ /** The "code" FO property value. */
+ CODE("code"), // 43
- /** Constant indicating a "collapse" FO property value. */
- COLLAPSE, // 44
+ /** The "collapse" FO property value. */
+ COLLAPSE("collapse"), // 44
- /** Constant indicating a "collapse-with-precedence" FO property value. */
- COLLAPSE_WITH_PRECEDENCE, // 45
+ /** The "collapse-with-precedence" FO property value. */
+ COLLAPSE_WITH_PRECEDENCE("collapse-with-precedence"), // 45
- /** Constant indicating a "column" FO property value. */
- COLUMN, // 46
+ /** The "column" FO property value. */
+ COLUMN("column"), // 46
- /** Constant indicating a "condensed" FO property value. */
- CONDENSED, // 47
+ /** The "condensed" FO property value. */
+ CONDENSED("condensed"), // 47
- /** Constant indicating a "consider-shifts" FO property value. */
- CONSIDER_SHIFTS, // 48
+ /** The "consider-shifts" FO property value. */
+ CONSIDER_SHIFTS("consider-shifts"), // 48
- /** Constant indicating a "continuous" FO property value. */
- CONTINUOUS, // 49
+ /** The "continuous" FO property value. */
+ CONTINUOUS("continuous"), // 49
- /** Constant indicating a "cursive" FO property value. */
- CURSIVE, // 50
+ /** The "cursive" FO property value. */
+ CURSIVE("cursive"), // 50
- /** Constant indicating a "dashed" FO property value. */
- DASHED, // 51
+ /** The "dashed" FO property value. */
+ DASHED("dashed"), // 51
- /** Constant indicating a "digits" FO property value. */
- DIGITS, // 52
+ /** The "digits" FO property value. */
+ DIGITS("digits"), // 52
- /** Constant indicating a "discard" FO property value. */
- DISCARD, // 53
+ /** The "discard" FO property value. */
+ DISCARD("discard"), // 53
- /** Constant indicating a "disregard-shifts" FO property value. */
- DISREGARD_SHIFTS, // 54
+ /** The "disregard-shifts" FO property value. */
+ DISREGARD_SHIFTS("disregard-shifts"), // 54
- /** Constant indicating a "document" FO property value. */
- DOCUMENT, // 55
+ /** The "document" FO property value. */
+ DOCUMENT("document"), // 55
- /** Constant indicating a "document-root" FO property value. */
- DOCUMENT_ROOT, // 56
+ /** The "document-root" FO property value. */
+ DOCUMENT_ROOT("document-root"), // 56
- /** Constant indicating a "dots" FO property value. */
- DOTS, // 57
+ /** The "dots" FO property value. */
+ DOTS("dots"), // 57
- /** Constant indicating a "dotted" FO property value. */
- DOTTED, // 58
+ /** The "dotted" FO property value. */
+ DOTTED("dotted"), // 58
- /** Constant indicating a "double" FO property value. */
- DOUBLE, // 59
+ /** The "double" FO property value. */
+ DOUBLE("double"), // 59
- /** Constant indicating an "embed" FO property value. */
- EMBED, // 60
+ /** The "embed" FO property value. */
+ EMBED("embed"), // 60
- /** Constant indicating an "end" FO property value. */
- END, // 61
+ /** The "end" FO property value. */
+ END("end"), // 61
- /** Constant indicating an "end-on-even" FO property value. */
- END_ON_EVEN, // 62
+ /** The "end-on-even" FO property value. */
+ END_ON_EVEN("end-on-even"), // 62
- /** Constant indicating an "end-on-odd" FO property value. */
- END_ON_ODD, // 63
+ /** The "end-on-odd" FO property value. */
+ END_ON_ODD("end-on-odd"), // 63
- /** Constant indicating an "error-if-overflow" FO property value. */
- ERROR_IF_OVERFLOW, // 64
+ /** The "error-if-overflow" FO property value. */
+ ERROR_IF_OVERFLOW("error-if-overflow"), // 64
- /** Constant indicating an "even" FO property value. */
- EVEN, // 65
+ /** The "even" FO property value. */
+ EVEN("even"), // 65
- /** Constant indicating an "even-page" FO property value. */
- EVEN_PAGE, // 66
+ /** The "even-page" FO property value. */
+ EVEN_PAGE("even-page"), // 66
- /** Constant indicating an "expanded" FO property value. */
- EXPANDED, // 67
+ /** The "expanded" FO property value. */
+ EXPANDED("expanded"), // 67
- /** Constant indicating an "extra-condensed" FO property value. */
- EXTRA_CONDENSED, // 68
+ /** The "extra-condensed" FO property value. */
+ EXTRA_CONDENSED("extra-condensed"), // 68
- /** Constant indicating an "extra-expanded" FO property value. */
- EXTRA_EXPANDED, // 69
+ /** The "extra-expanded" FO property value. */
+ EXTRA_EXPANDED("extra-expanded"), // 69
- /** Constant indicating a "false" FO property value. */
- FALSE, // 70
+ /** The "false" FO property value. */
+ FALSE("false"), // 70
- /** Constant indicating a "fantasy" FO property value. */
- FANTASY, // 71
+ /** The "fantasy" FO property value. */
+ FANTASY("fantasy"), // 71
- /** Constant indicating a "far-left" FO property value. */
- FAR_LEFT, // 72
+ /** The "far-left" FO property value. */
+ FAR_LEFT("far-left"), // 72
- /** Constant indicating a "far-right" FO property value. */
- FAR_RIGHT, // 73
+ /** The "far-right" FO property value. */
+ FAR_RIGHT("far-right"), // 73
- /** Constant indicating a "fast" FO property value. */
- FAST, // 74
+ /** The "fast" FO property value. */
+ FAST("fast"), // 74
- /** Constant indicating a "faster" FO property value. */
- FASTER, // 75
+ /** The "faster" FO property value. */
+ FASTER("faster"), // 75
- /** Constant indicating a "female" FO property value. */
- FEMALE, // 76
+ /** The "female" FO property value. */
+ FEMALE("female"), // 76
- /** Constant indicating a "first" FO property value. */
- FIRST, // 77
+ /** The "first" FO property value. */
+ FIRST("first"), // 77
- /** Constant indicating a "first-including-carryover" FO property value. */
- FIRST_INCLUDING_CARRYOVER, // 78
+ /** The "first-including-carryover" FO property value. */
+ FIRST_INCLUDING_CARRYOVER("first-including-carryover"), // 78
- /** Constant indicating a "first-starting" FO property value. */
- FIRST_STARTING, // 79
+ /** The "first-starting" FO property value. */
+ FIRST_STARTING("first-starting"), // 79
- /** Constant indicating a "first-starting-within-page" FO property value. */
- FIRST_STARTING_WITHIN_PAGE, // 80
+ /** The "first-starting-within-page" FO property value. */
+ FIRST_STARTING_WITHIN_PAGE("first-starting-within-page"), // 80
- /** Constant indicating a "fixed" FO property value. */
- FIXED, // 81
+ /** The "fixed" FO property value. */
+ FIXED("fixed"), // 81
- /** Constant indicating a "focus" FO property value. */
- FOCUS, // 82
+ /** The "focus" FO property value. */
+ FOCUS("focus"), // 82
- /** Constant indicating a "font-height" FO property value. */
- FONT_HEIGHT, // 83
+ /** The "font-height" FO property value. */
+ FONT_HEIGHT("font-height"), // 83
- /** Constant indicating a "force" FO property value. */
- FORCE, // 84
+ /** The "force" FO property value. */
+ FORCE("force"), // 84
- /** Constant indicating a "groove" FO property value. */
- GROOVE, // 85
+ /** The "groove" FO property value. */
+ GROOVE("groove"), // 85
- /** Constant indicating a "hanging" FO property value. */
- HANGING, // 86
+ /** The "hanging" FO property value. */
+ HANGING("hanging"), // 86
- /** Constant indicating a "height" FO property value. */
- HEIGHT, // 87
+ /** The "height" FO property value. */
+ HEIGHT("height"), // 87
- /** Constant indicating a "hidden" FO property value. */
- HIDDEN, // 88
+ /** The "hidden" FO property value. */
+ HIDDEN("hidden"), // 88
- /** Constant indicating a "hide" FO property value. */
- HIDE, // 89
+ /** The "hide" FO property value. */
+ HIDE("hide"), // 89
- /** Constant indicating a "high" FO property value. */
- HIGH, // 90
+ /** The "high" FO property value. */
+ HIGH("high"), // 90
- /** Constant indicating a "higher" FO property value. */
- HIGHER, // 91
+ /** The "higher" FO property value. */
+ HIGHER("higher"), // 91
- /** Constant indicating a "hover" FO property value. */
- HOVER, // 92
+ /** The "hover" FO property value. */
+ HOVER("hover"), // 92
- /** Constant indicating an "ideographic" FO property value. */
- IDEOGRAPHIC, // 93
+ /** The "ideographic" FO property value. */
+ IDEOGRAPHIC("ideographic"), // 93
- /** Constant indicating an "ignore" FO property value. */
- IGNORE, // 94
+ /** The "ignore" FO property value. */
+ IGNORE("ignore"), // 94
- /** Constant indicating an "ignore-if-after-linefeed" FO property value. */
- IGNORE_IF_AFTER_LINEFEED, // 95
+ /** The "ignore-if-after-linefeed" FO property value. */
+ IGNORE_IF_AFTER_LINEFEED("ignore-if-after-linefeed"), // 95
- /** Constant indicating an "ignore-if-before-linefeed" FO property value. */
- IGNORE_IF_BEFORE_LINEFEED, // 96
+ /** The "ignore-if-before-linefeed" FO property value. */
+ IGNORE_IF_BEFORE_LINEFEED("ignore-if-before-linefeed"), // 96
- /** Constant indicating an "ignore-if-surrounding-linefeed" FO property
+ /** The "ignore-if-surrounding-linefeed" FO property
* value. */
- IGNORE_IF_SURROUNDING_LINEFEED, // 97
+ IGNORE_IF_SURROUNDING_LINEFEED("ignore-if-surrounding-linefeed"), // 97
- /** Constant indicating an "indefinite" FO property value. */
- INDEFINITE, // 98
+ /** The "indefinite" FO property value. */
+ INDEFINITE("indefinite"), // 98
- /** Constant indicating an "indent" FO property value. */
- INDENT, // 99
+ /** The "indent" FO property value. */
+ INDENT("indent"), // 99
- /** Constant indicating an "inherit" FO property value. */
- INHERIT, // 100
+ /** The "inherit" FO property value. */
+ INHERIT("inherit"), // 100
- /** Constant indicating an "inset" FO property value. */
- INSET, // 101
+ /** The "inset" FO property value. */
+ INSET("inset"), // 101
- /** Constant indicating an "inside" FO property value. */
- INSIDE, // 102
+ /** The "inside" FO property value. */
+ INSIDE("inside"), // 102
- /** Constant indicating an "integer-pixels" FO property value. */
- INTEGER_PIXELS, // 103
+ /** The "integer-pixels" FO property value. */
+ INTEGER_PIXELS("integer-pixels"), // 103
- /** Constant indicating an "italic" FO property value. */
- ITALIC, // 104
+ /** The "italic" FO property value. */
+ ITALIC("italic"), // 104
- /** Constant indicating a "justify" FO property value. */
- JUSTIFY, // 105
+ /** The "justify" FO property value. */
+ JUSTIFY("justify"), // 105
- /** Constant indicating a "landscape" FO property value. */
- LANDSCAPE, // 106
+ /** The "landscape" FO property value. */
+ LANDSCAPE("landscape"), // 106
- /** Constant indicating a "large" FO property value. */
- LARGE, // 107
+ /** The "large" FO property value. */
+ LARGE("large"), // 107
- /** Constant indicating a "larger" FO property value. */
- LARGER, // 108
+ /** The "larger" FO property value. */
+ LARGER("larger"), // 108
- /** Constant indicating a "last" FO property value. */
- LAST, // 109
+ /** The "last" FO property value. */
+ LAST("last"), // 109
- /** Constant indicating a "last-ending" FO property value. */
- LAST_ENDING, // 110
+ /** The "last-ending" FO property value. */
+ LAST_ENDING("last-ending"), // 110
- /** Constant indicating a "last-ending-within-page" FO property value. */
- LAST_ENDING_WITHIN_PAGE, // 111
+ /** The "last-ending-within-page" FO property value. */
+ LAST_ENDING_WITHIN_PAGE("last-ending-within-page"), // 111
- /** Constant indicating a "last-starting" FO property value. */
- LAST_STARTING, // 112
+ /** The "last-starting" FO property value. */
+ LAST_STARTING("last-starting"), // 112
- /** Constant indicating a "last-starting-within-page" FO property value. */
- LAST_STARTING_WITHIN_PAGE, // 113
+ /** The "last-starting-within-page" FO property value. */
+ LAST_STARTING_WITHIN_PAGE("last-starting-within-page"), // 113
- /** Constant indicating a "leave-separate" FO property value. */
- LEAVE_SEPARATE, // 114
+ /** The "leave-separate" FO property value. */
+ LEAVE_SEPARATE("leave-separate"), // 114
- /** Constant indicating a "left" FO property value. */
- LEFT, // 115
+ /** The "left" FO property value. */
+ LEFT("left"), // 115
- /** Constant indicating a "left-side" FO property value. */
- LEFT_SIDE, // 116
+ /** The "left-side" FO property value. */
+ LEFT_SIDE("left-side"), // 116
/* In ASCII, "LEFTWARDS" comes before "LEFT_SIDE". However, "left-side"
* comes before "leftwards". Since any binary search will be done on
@@ -392,443 +392,442 @@
* the String array, we will let it govern the order, and we will
* follow it here. */
- /** Constant indicating a "leftwards" FO property value. */
- LEFTWARDS, // 117
+ /** The "leftwards" FO property value. */
+ LEFTWARDS("leftwards"), // 117
- /** Constant indicating a "level" FO property value. */
- LEVEL, // 118
+ /** The "level" FO property value. */
+ LEVEL("level"), // 118
- /** Constant indicating a "lighter" FO property value. */
- LIGHTER, // 119
+ /** The "lighter" FO property value. */
+ LIGHTER("lighter"), // 119
- /** Constant indicating a "line" FO property value. */
- LINE, // 120
+ /** The "line" FO property value. */
+ LINE("line"), // 120
- /** Constant indicating a "line-height" FO property value. */
- LINE_HEIGHT, // 121
+ /** The "line-height" FO property value. */
+ LINE_HEIGHT("line-height"), // 121
- /** Constant indicating a "line-through" FO property value. */
- LINE_THROUGH, // 122
+ /** The "line-through" FO property value. */
+ LINE_THROUGH("line-through"), // 122
- /** Constant indicating a "link" FO property value. */
- LINK, // 123
+ /** The "link" FO property value. */
+ LINK("link"), // 123
- /** Constant indicating a "loud" FO property value. */
- LOUD, // 124
+ /** The "loud" FO property value. */
+ LOUD("loud"), // 124
- /** Constant indicating a "low" FO property value. */
- LOW, // 125
+ /** The "low" FO property value. */
+ LOW("low"), // 125
- /** Constant indicating a "lower" FO property value. */
- LOWER, // 126
+ /** The "lower" FO property value. */
+ LOWER("lower"), // 126
- /** Constant indicating a "lowercase" FO property value. */
- LOWERCASE, // 127
+ /** The "lowercase" FO property value. */
+ LOWERCASE("lowercase"), // 127
- /** Constant indicating a "lr" FO property value. */
- LR, // 128
+ /** The "lr" FO property value. */
+ LR("lr"), // 128
- /** Constant indicating a "lr-tb" FO property value. */
- LR_TB, // 129
+ /** The "lr-tb" FO property value. */
+ LR_TB("lr-tb"), // 129
- /** Constant indicating a "ltr" FO property value. */
- LTR, // 130
+ /** The "ltr" FO property value. */
+ LTR("ltr"), // 130
- /** Constant indicating a "male" FO property value. */
- MALE, // 131
+ /** The "male" FO property value. */
+ MALE("male"), // 131
- /** Constant indicating a "mathematical" FO property value. */
- MATHEMATICAL, // 132
+ /** The "mathematical" FO property value. */
+ MATHEMATICAL("mathematical"), // 132
- /** Constant indicating a "max-height" FO property value. */
- MAX_HEIGHT, // 133
+ /** The "max-height" FO property value. */
+ MAX_HEIGHT("max-height"), // 133
- /** Constant indicating a "medium" FO property value. */
- MEDIUM, // 134
+ /** The "medium" FO property value. */
+ MEDIUM("medium"), // 134
- /** Constant indicating a "merge" FO property value. */
- MERGE, // 135
+ /** The "merge" FO property value. */
+ MERGE("merge"), // 135
- /** Constant indicating a "middle" FO property value. */
- MIDDLE, // 136
+ /** The "middle" FO property value. */
+ MIDDLE("middle"), // 136
- /** Constant indicating a "monospace" FO property value. */
- MONOSPACE, // 137
+ /** The "monospace" FO property value. */
+ MONOSPACE("monospace"), // 137
- /** Constant indicating a "narrower" FO property value. */
- NARROWER, // 138
+ /** The "narrower" FO property value. */
+ NARROWER("narrower"), // 138
- /** Constant indicating a "new" FO property value. */
- NEW, // 139
+ /** The "new" FO property value. */
+ NEW("new"), // 139
- /** Constant indicating a "no-blink" FO property value. */
- NO_BLINK, // 140
+ /** The "no-blink" FO property value. */
+ NO_BLINK("no-blink"), // 140
- /** Constant indicating a "no-change" FO property value. */
- NO_CHANGE, // 141
+ /** The "no-change" FO property value. */
+ NO_CHANGE("no-change"), // 141
- /** Constant indicating a "no-force" FO property value. */
- NO_FORCE, // 142
+ /** The "no-force" FO property value. */
+ NO_FORCE("no-force"), // 142
- /** Constant indicating a "no-limit" FO property value. */
- NO_LIMIT, // 143
+ /** The "no-limit" FO property value. */
+ NO_LIMIT("no-limit"), // 143
- /** Constant indicating a "no-line-through" FO property value. */
- NO_LINE_THROUGH, // 144
+ /** The "no-line-through" FO property value. */
+ NO_LINE_THROUGH("no-line-through"), // 144
- /** Constant indicating a "no-link" FO property value. */
- NO_LINK, // 145
+ /** The "no-link" FO property value. */
+ NO_LINK("no-link"), // 145
- /** Constant indicating a "no-overline" FO property value. */
- NO_OVERLINE, // 146
+ /** The "no-overline" FO property value. */
+ NO_OVERLINE("no-overline"), // 146
- /** Constant indicating a "no-repeate" FO property value. */
- NO_REPEAT, // 147
+ /** The "no-repeate" FO property value. */
+ NO_REPEAT("no-repeat"), // 147
- /** Constant indicating a "no-underline" FO property value. */
- NO_UNDERLINE, // 148
+ /** The "no-underline" FO property value. */
+ NO_UNDERLINE("no-underline"), // 148
- /** Constant indicating a "no-wrap" FO property value. */
- NO_WRAP, // 149
+ /** The "no-wrap" FO property value. */
+ NO_WRAP("no-wrap"), // 149
- /** Constant indicating a "non-blank" FO property value. */
- NON_BLANK, // 150
+ /** The "non-blank" FO property value. */
+ NON_BLANK("non-blank"), // 150
- /** Constant indicating a "non-uniform" FO property value. */
- NON_UNIFORM, // 151
+ /** The "non-uniform" FO property value. */
+ NON_UNIFORM("non-uniform"), // 151
- /** Constant indicating a "none" FO property value. */
- NONE, // 152
+ /** The "none" FO property value. */
+ NONE("none"), // 152
- /** Constant indicating a "normal" FO property value. */
- NORMAL, // 153
+ /** The "normal" FO property value. */
+ NORMAL("normal"), // 153
- /** Constant indicating a "not-a-keyword" FO property value. */
- NOT_A_KEYWORD, // 154
+ /** The "not-a-keyword" FO property value. */
+ NOT_A_KEYWORD("not-a-keyword"), // 154
- /** Constant indicating a "not-blank" FO property value. */
- NOT_BLANK, // 155
+ /** The "not-blank" FO property value. */
+ NOT_BLANK("not-blank"), // 155
- /** Constant indicating a "nowrap" FO property value. */
- NOWRAP, // 156
+ /** The "nowrap" FO property value. */
+ NOWRAP("nowrap"), // 156
- /** Constant indicating an "oblique" FO property value. */
- OBLIQUE, // 157
+ /** The "oblique" FO property value. */
+ OBLIQUE("oblique"), // 157
- /** Constant indicating an "odd" FO property value. */
- ODD, // 158
+ /** The "odd" FO property value. */
+ ODD("odd"), // 158
- /** Constant indicating an "odd-page" FO property value. */
- ODD_PAGE, // 159
+ /** The "odd-page" FO property value. */
+ ODD_PAGE("odd-page"), // 159
- /** Constant indicating a "once" FO property value. */
- ONCE, // 160
+ /** The "once" FO property value. */
+ ONCE("once"), // 160
- /** Constant indicating an "only" FO property value. */
- ONLY, // 161
+ /** The "only" FO property value. */
+ ONLY("only"), // 161
- /** Constant indicating an "outset" FO property value. */
- OUTSET, // 162
+ /** The "outset" FO property value. */
+ OUTSET("outset"), // 162
- /** Constant indicating an "outside" FO property value. */
- OUTSIDE, // 163
+ /** The "outside" FO property value. */
+ OUTSIDE("outside"), // 163
- /** Constant indicating an "overline" FO property value. */
- OVERLINE, // 164
+ /** The "overline" FO property value. */
+ OVERLINE("overline"), // 164
- /** Constant indicating a "page" FO property value. */
- PAGE, // 165
+ /** The "page" FO property value. */
+ PAGE("page"), // 165
- /** Constant indicating a "page-sequence" FO property value. */
- PAGE_SEQUENCE, // 166
+ /** The "page-sequence" FO property value. */
+ PAGE_SEQUENCE("page-sequence"), // 166
- /** Constant indicating a "paginate" FO property value. */
- PAGINATE, // 167
+ /** The "paginate" FO property value. */
+ PAGINATE("paginate"), // 167
- /** Constant indicating a "perceptual" FO property value. */
- PERCEPTUAL, // 168
+ /** The "perceptual" FO property value. */
+ PERCEPTUAL("perceptual"), // 168
- /** Constant indicating a "portrait" FO property value. */
- PORTRAIT, // 169
+ /** The "portrait" FO property value. */
+ PORTRAIT("portrait"), // 169
- /** Constant indicating a "pre" FO property value. */
- PRE, // 170
+ /** The "pre" FO property value. */
+ PRE("pre"), // 170
- /** Constant indicating a "preserve" FO property value. */
- PRESERVE, // 171
+ /** The "preserve" FO property value. */
+ PRESERVE("preserve"), // 171
- /** Constant indicating a "reference-area" FO property value. */
- REFERENCE_AREA, // 172
+ /** The "reference-area" FO property value. */
+ REFERENCE_AREA("reference-area"), // 172
- /** Constant indicating a "relative" FO property value. */
- RELATIVE, // 173
+ /** The "relative" FO property value. */
+ RELATIVE("relative"), // 173
- /** Constant indicating a "relative-colorimetric" FO property value. */
- RELATIVE_COLORIMETRIC, // 174
+ /** The "relative-colorimetric" FO property value. */
+ RELATIVE_COLORIMETRIC("relative-colorimetric"), // 174
- /** Constant indicating a "repeat" FO property value. */
- REPEAT, // 175
+ /** The "repeat" FO property value. */
+ REPEAT("repeat"), // 175
- /** Constant indicating a "repeat-x" FO property value. */
- REPEAT_X, // 176
+ /** The "repeat-x" FO property value. */
+ REPEAT_X("repeat-x"), // 176
- /** Constant indicating a "repeat-y" FO property value. */
- REPEAT_Y, // 177
+ /** The "repeat-y" FO property value. */
+ REPEAT_Y("repeat-y"), // 177
- /** Constant indicating a "replace" FO property value. */
- REPLACE, // 178
+ /** The "replace" FO property value. */
+ REPLACE("replace"), // 178
- /** Constant indicating a "resample-any-method" FO property value. */
- RESAMPLE_ANY_METHOD, // 179
+ /** The "resample-any-method" FO property value. */
+ RESAMPLE_ANY_METHOD("resample-any-method"), // 179
- /** Constant indicating a "reset-size" FO property value. */
- RESET_SIZE, // 180
+ /** The "reset-size" FO property value. */
+ RESET_SIZE("reset-size"), // 180
- /** Constant indicating a "rest" FO property value. */
- REST, // 181
+ /** The "rest" FO property value. */
+ REST("rest"), // 181
- /** Constant indicating a "retain" FO property value. */
- RETAIN, // 182
+ /** The "retain" FO property value. */
+ RETAIN("retain"), // 182
- /** Constant indicating a "ridge" FO property value. */
- RIDGE, // 183
+ /** The "ridge" FO property value. */
+ RIDGE("ridge"), // 183
- /** Constant indicating a "right" FO property value. */
- RIGHT, // 184
+ /** The "right" FO property value. */
+ RIGHT("right"), // 184
- /** Constant indicating a "right-side" FO property value. */
- RIGHT_SIDE, // 185
+ /** The "right-side" FO property value. */
+ RIGHT_SIDE("right-side"), // 185
/* See note at "LEFTWARDS" explaining the order. */
- /** Constant indicating a "rightwards" FO property value. */
- RIGHTWARDS, // 186
+ /** The "rightwards" FO property value. */
+ RIGHTWARDS("rightwards"), // 186
- /** Constant indicating a "rl" FO property value. */
- RL, // 187
+ /** The "rl" FO property value. */
+ RL("rl"), // 187
- /** Constant indicating a "rl-tb" FO property value. */
- RL_TB, // 188
+ /** The "rl-tb" FO property value. */
+ RL_TB("rl-tb"), // 188
- /** Constant indicating a "rtl" FO property value. */
- RTL, // 189
+ /** The "rtl" FO property value. */
+ RTL("rtl"), // 189
- /** Constant indicating a "rule" FO property value. */
- RULE, // 190
+ /** The "rule" FO property value. */
+ RULE("rule"), // 190
- /** Constant indicating a "sans-serif" FO property value. */
- SANS_SERIF, // 191
+ /** The "sans-serif" FO property value. */
+ SANS_SERIF("sans-serif"), // 191
- /** Constant indicating a "saturation" FO property value. */
- SATURATION, // 192
+ /** The "saturation" FO property value. */
+ SATURATION("saturation"), // 192
- /** Constant indicating a "scale-down-to-fit" FO property value. */
- SCALE_DOWN_TO_FIT, // 193
+ /** The "scale-down-to-fit" FO property value. */
+ SCALE_DOWN_TO_FIT("scale-down-to-fit"), // 193
- /** Constant indicating a "scale-to-fit" FO property value. */
- SCALE_TO_FIT, // 194
+ /** The "scale-to-fit" FO property value. */
+ SCALE_TO_FIT("scale-to-fit"), // 194
- /** Constant indicating a "scale-up-to-fit" FO property value. */
- SCALE_UP_TO_FIT, // 195
+ /** The "scale-up-to-fit" FO property value. */
+ SCALE_UP_TO_FIT("scale-up-to-fit"), // 195
- /** Constant indicating a "scroll" FO property value. */
- SCROLL, // 196
+ /** The "scroll" FO property value. */
+ SCROLL("scroll"), // 196
- /** Constant indicating a "semi-condensed" FO property value. */
- SEMI_CONDENSED, // 197
+ /** The "semi-condensed" FO property value. */
+ SEMI_CONDENSED("semi-condensed"), // 197
- /** Constant indicating a "semi-expanded" FO property value. */
- SEMI_EXPANDED, // 198
+ /** The "semi-expanded" FO property value. */
+ SEMI_EXPANDED("semi-expanded"), // 198
- /** Constant indicating a "separate" FO property value. */
- SEPARATE, // 199
+ /** The "separate" FO property value. */
+ SEPARATE("separate"), // 199
- /** Constant indicating a "serif" FO property value. */
- SERIF, // 200
+ /** The "serif" FO property value. */
+ SERIF("serif"), // 200
- /** Constant indicating a "show" FO property value. */
- SHOW, // 201
+ /** The "show" FO property value. */
+ SHOW("show"), // 201
- /** Constant indicating a "silent" FO property value. */
- SILENT, // 202
+ /** The "silent" FO property value. */
+ SILENT("silent"), // 202
- /** Constant indicating a "slow" FO property value. */
- SLOW, // 203
+ /** The "slow" FO property value. */
+ SLOW("slow"), // 203
- /** Constant indicating a "slower" FO property value. */
- SLOWER, // 204
+ /** The "slower" FO property value. */
+ SLOWER("slower"), // 204
- /** Constant indicating a "small" FO property value. */
- SMALL, // 205
+ /** The "small" FO property value. */
+ SMALL("small"), // 205
- /** Constant indicating a "small-caps" FO property value. */
- SMALL_CAPS, // 206
+ /** The "small-caps" FO property value. */
+ SMALL_CAPS("small-caps"), // 206
- /** Constant indicating a "smaller" FO property value. */
- SMALLER, // 207
+ /** The "smaller" FO property value. */
+ SMALLER("smaller"), // 207
- /** Constant indicating a "soft" FO property value. */
- SOFT, // 208
+ /** The "soft" FO property value. */
+ SOFT("soft"), // 208
- /** Constant indicating a "solid" FO property value. */
- SOLID, // 209
+ /** The "solid" FO property value. */
+ SOLID("solid"), // 209
- /** Constant indicating a "space" FO property value. */
- SPACE, // 210
+ /** The "space" FO property value. */
+ SPACE("space"), // 210
- /** Constant indicating a "spell-out" FO property value. */
- SPELL_OUT, // 211
+ /** The "spell-out" FO property value. */
+ SPELL_OUT("spell-out"), // 211
- /** Constant indicating a "start" FO property value. */
- START, // 212
+ /** The "start" FO property value. */
+ START("start"), // 212
- /** Constant indicating a "static" FO property value. */
- STATIC, // 213
+ /** The "static" FO property value. */
+ STATIC("static"), // 213
- /** Constant indicating a "sub" FO property value. */
- SUB, // 214
+ /** The "sub" FO property value. */
+ SUB("sub"), // 214
- /** Constant indicating a "super" FO property value. */
- SUPER, // 215
+ /** The "super" FO property value. */
+ SUPER("super"), // 215
- /** Constant indicating a "supress" FO property value. */
- SUPPRESS, // 216
+ /** The "supress" FO property value. */
+ SUPPRESS("suppress"), // 216
- /** Constant indicating a "table" FO property value. */
- TABLE, // 217
+ /** The "table" FO property value. */
+ TABLE("table"), // 217
- /** Constant indicating a "table-fragment" FO property value. */
- TABLE_FRAGMENT, // 218
+ /** The "table-fragment" FO property value. */
+ TABLE_FRAGMENT("table-fragment"), // 218
- /** Constant indicating a "tb" FO property value. */
- TB, // 219
+ /** The "tb" FO property value. */
+ TB("tb"), // 219
- /** Constant indicating a "tb-rl" FO property value. */
- TB_RL, // 220
+ /** The "tb-rl" FO property value. */
+ TB_RL("tb-rl"), // 220
- /** Constant indicating a "text-after-edge" FO property value. */
- TEXT_AFTER_EDGE, // 221
+ /** The "text-after-edge" FO property value. */
+ TEXT_AFTER_EDGE("text-after-edge"), // 221
- /** Constant indicating a "text-before-edge" FO property value. */
- TEXT_BEFORE_EDGE, // 222
+ /** The "text-before-edge" FO property value. */
+ TEXT_BEFORE_EDGE("text-before-edge"), // 222
- /** Constant indicating a "text-bottom" FO property value. */
- TEXT_BOTTOM, // 223
+ /** The "text-bottom" FO property value. */
+ TEXT_BOTTOM("text-bottom"), // 223
- /** Constant indicating a "text-top" FO property value. */
- TEXT_TOP, // 224
+ /** The "text-top" FO property value. */
+ TEXT_TOP("text-top"), // 224
- /** Constant indicating a "thick" FO property value. */
- THICK, // 225
+ /** The "thick" FO property value. */
+ THICK("thick"), // 225
- /** Constant indicating a "thin" FO property value. */
- THIN, // 226
+ /** The "thin" FO property value. */
+ THIN("thin"), // 226
- /** Constant indicating a "top" FO property value. */
- TOP, // 227
+ /** The "top" FO property value. */
+ TOP("top"), // 227
- /** Constant indicating a "traditional" FO property value. */
- TRADITIONAL, // 228
+ /** The "traditional" FO property value. */
+ TRADITIONAL("traditional"), // 228
- /** Constant indicating a "transparent" FO property value. */
- TRANSPARENT, // 229
+ /** The "transparent" FO property value. */
+ TRANSPARENT("transparent"), // 229
- /** Constant indicating a "treat-as-space" FO property value. */
- TREAT_AS_SPACE, // 230
+ /** The "treat-as-space" FO property value. */
+ TREAT_AS_SPACE("treat-as-space"), // 230
- /** Constant indicating a "treat-as-zero-width-space" FO property value. */
- TREAT_AS_ZERO_WIDTH_SPACE, // 231
+ /** The "treat-as-zero-width-space" FO property value. */
+ TREAT_AS_ZERO_WIDTH_SPACE("treat-as-zero-width-space"), // 231
- /** Constant indicating a "true" FO property value. */
- TRUE, // 232
+ /** The "true" FO property value. */
+ TRUE("true"), // 232
- /** Constant indicating an "ultra-condensed" FO property value. */
- ULTRA_CONDENSED, // 233
+ /** The "ultra-condensed" FO property value. */
+ ULTRA_CONDENSED("ultra-condensed"), // 233
- /** Constant indicating an "ultra-expanded" FO property value. */
- ULTRA_EXPANDED, // 234
+ /** The "ultra-expanded" FO property value. */
+ ULTRA_EXPANDED("ultra-expanded"), // 234
- /** Constant indicating an "unbounded" FO property value. */
- UNBOUNDED, // 235
+ /** The "unbounded" FO property value. */
+ UNBOUNDED("unbounded"), // 235
- /** Constant indicating an "underline" FO property value. */
- UNDERLINE, // 236
+ /** The "underline" FO property value. */
+ UNDERLINE("underline"), // 236
- /** Constant indicating a "uniform" FO property value. */
- UNIFORM, // 237
+ /** The "uniform" FO property value. */
+ UNIFORM("uniform"), // 237
- /** Constant indicating an "uppercase" FO property value. */
- UPPERCASE, // 238
+ /** The "uppercase" FO property value. */
+ UPPERCASE("uppercase"), // 238
- /** Constant indicating a "use-content" FO property value. */
- USE_CONTENT, // 239
+ /** The "use-content" FO property value. */
+ USE_CONTENT("use-content"), // 239
- /** Constant indicating a "use-font-metrics" FO property value. */
- USE_FONT_METRICS, // 240
+ /** The "use-font-metrics" FO property value. */
+ USE_FONT_METRICS("use-font-metrics"), // 240
- /** Constant indicating a "use-normal-stylesheet" FO property value. */
- USE_NORMAL_STYLESHEET, // 241
+ /** The "use-normal-stylesheet" FO property value. */
+ USE_NORMAL_STYLESHEET("use-normal-stylesheet"), // 241
- /** Constant indicating a "use-script" FO property value. */
- USE_SCRIPT, // 242
+ /** The "use-script" FO property value. */
+ USE_SCRIPT("use-script"), // 242
- /** Constant indicating a "use-target-processing-context" FO property
- * value. */
- USE_TARGET_PROCESSING_CONTEXT, // 243
+ /** The "use-target-processing-context" FO property value. */
+ USE_TARGET_PROCESSING_CONTEXT("use-targ...
[truncated message content] |
|
From: <vic...@us...> - 2023-01-02 16:06:45
|
Revision: 13004
http://sourceforge.net/p/foray/code/13004
Author: victormote
Date: 2023-01-02 16:06:34 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Rename type FoValue to FoKeyword, for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAllowedAxisScale.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBoolean.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMergeIndex.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPageDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractString.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdActiveState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAutoRestore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundAttachment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundImage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPositionHorizontal.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPositionVertical.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundRepeat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBlankOrNotBlank.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCaptionSide.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCaseName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarClass.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarPlacement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdChangeBarWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCharacter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdClear.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdClip.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColorProfileName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentType.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdCountry.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDestinationPlacementOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDirection.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDisplayAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdElevation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEmptyCells.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEndsRow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExternalDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFloat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowMapName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowMapReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFlowNameReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSelectionStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSizeAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdForcePageCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGlyphOrientationHorizontal.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGlyphOrientationVertical.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGroupingSeparator.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdGroupingSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenate.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationCharacter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationLadderCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationPushCharacterCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationRemainCharacterCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIndicateDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdInitialPageNumber.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdInternalDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIntrinsicScaleValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdIntrusionDisplace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLanguage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPattern.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeightShiftAdjustment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineStackingStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLinefeedTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMarkerClassName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMasterName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMasterReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaxHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaxWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMaximumRepeats.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMediaUsage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMinHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMinWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberColumnsRepeated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberColumnsSpanned.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdNumberRowsSpanned.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOddOrEven.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOrphans.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOverflow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageBreakInside.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageCitationStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPageNumberTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPagePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPlayDuring.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPrecedence.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRefId.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdReferenceOrientation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRegionName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRegionNameReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRelativeAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRelativePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRenderingIntent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveBoundary.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveBoundaryWithinTable.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrieveClassName.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrievePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRetrievePositionWithinTable.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRole.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScaleOption.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScaling.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScalingMethod.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScoreSpaces.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScript.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdShowDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSourceDocument.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpan.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakHeader.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakNumeral.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakPunctuation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeechRate.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSrc.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartingState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartsRow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSuppressAtLineBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSwitchTo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableLayout.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableOmitFooterAtBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableOmitHeaderAtBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetPresentationContext.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetProcessingContext.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTargetStylesheet.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlignLast.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDecoration.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextShadow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextTransform.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTreatAsWordSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdUnicodeBidi.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVerticalAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVisibility.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVoiceFamily.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpaceCollapse.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpaceTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWidows.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWordSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWrapOption.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWritingMode.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdZindex.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Datatype.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLengthConditional.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/AbstractBorderWidthTests.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoValue.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-02 15:07:30 UTC (rev 13003)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2023-01-02 16:06:34 UTC (rev 13004)
@@ -34,8 +34,8 @@
import org.foray.common.i18n.Script4a;
import org.foray.common.i18n.WritingSystem4a;
import org.foray.common.primitive.XmlCharacterUtils;
+import org.foray.fotree.fo.FoKeyword;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.BasicLink4a;
import org.foray.fotree.fo.obj.Block4a;
import org.foray.fotree.fo.obj.Flow4a;
@@ -747,11 +747,11 @@
}
/**
- * Converts an {@link FoValue} wrap-option value to the more generic {@link WrapOption} value.
+ * Converts an {@link FoKeyword} wrap-option value to the more generic {@link WrapOption} value.
* @param foWrapOption The raw FO wrap-option value to be converted.
* @return The matching WrapOption instance.
*/
- private WrapOption convertWrapOption(final FoValue foWrapOption) {
+ private WrapOption convertWrapOption(final FoKeyword foWrapOption) {
switch (foWrapOption) {
case NO_WRAP: return WrapOption.NO_WRAP;
case WRAP: return WrapOption.WRAP;
@@ -762,7 +762,7 @@
@Override
public WrapOption traitWrapOption(final FoContext context) {
- final FoValue foWrapOption = getPropertyList().getWrapOption(this,
+ final FoKeyword foWrapOption = getPropertyList().getWrapOption(this,
context);
return convertWrapOption(foWrapOption);
}
@@ -840,12 +840,12 @@
}
/**
- * Converts an {@link FoValue} span value to the more generic
+ * Converts an {@link FoKeyword} span value to the more generic
* {@link Span} value.
* @param foSpan The raw FO span value to be converted.
* @return The matching Span instance.
*/
- private static Span convertSpan(final FoValue foSpan) {
+ private static Span convertSpan(final FoKeyword foSpan) {
switch (foSpan) {
case NONE: return Span.NONE;
case ALL: return Span.ALL;
@@ -859,7 +859,7 @@
/* Only block-level FOs are affected by column-count, so, for all other
* FOs, treat them as if the span trait were "all". */
if (this.isBlockLevelFo()) {
- final FoValue foSpan = getPropertyList().getSpan(this, context);
+ final FoKeyword foSpan = getPropertyList().getSpan(this, context);
return convertSpan(foSpan);
}
return Span.ALL;
@@ -921,11 +921,11 @@
}
/**
- * Converts an {@link FoValue} display-align value to the more generic {@link DisplayAlign} value.
+ * Converts an {@link FoKeyword} display-align value to the more generic {@link DisplayAlign} value.
* @param foDisplayAlign The raw FO display-align value to be converted.
* @return The matching DisplayAlign instance.
*/
- private static DisplayAlign convertDisplayAlign(final FoValue foDisplayAlign) {
+ private static DisplayAlign convertDisplayAlign(final FoKeyword foDisplayAlign) {
switch (foDisplayAlign) {
case BEFORE: return DisplayAlign.BEFORE;
case CENTER: return DisplayAlign.CENTER;
@@ -936,7 +936,7 @@
@Override
public DisplayAlign traitDisplayAlign(final FoContext context) {
- final FoValue foDisplayAlign = getPropertyList().getDisplayAlign(this, context);
+ final FoKeyword foDisplayAlign = getPropertyList().getDisplayAlign(this, context);
if (this.relativeAlignApplies()) {
final RelativeAlign foRelativeAlign = this.traitRelativeAlign(context);
switch (foRelativeAlign) {
@@ -948,11 +948,11 @@
}
/**
- * Converts an {@link FoValue} relative-align value to the more generic {@link RelativeAlign} value.
+ * Converts an {@link FoKeyword} relative-align value to the more generic {@link RelativeAlign} value.
* @param foRelativeAlign The raw FO relative-align value to be converted.
* @return The matching RelativeAlign instance.
*/
- private static RelativeAlign convertRelativeAlign(final FoValue foRelativeAlign) {
+ private static RelativeAlign convertRelativeAlign(final FoKeyword foRelativeAlign) {
switch (foRelativeAlign) {
case BEFORE: return RelativeAlign.BEFORE;
case BASELINE: return RelativeAlign.BASELINE;
@@ -962,7 +962,7 @@
@Override
public RelativeAlign traitRelativeAlign(final FoContext context) {
- final FoValue foRelativeAlign = getPropertyList().getRelativeAlign(this, context);
+ final FoKeyword foRelativeAlign = getPropertyList().getRelativeAlign(this, context);
return convertRelativeAlign(foRelativeAlign);
}
@@ -982,11 +982,11 @@
}
/**
- * Converts a {@link FoValue} break-after or break-before value to the more generic {@link Break} value.
+ * Converts a {@link FoKeyword} break-after or break-before value to the more generic {@link Break} value.
* @param foBreak The raw FO break-after or break-before value to be converted.
* @return The matching Break instance.
*/
- private static Break convertBreak(final FoValue foBreak) {
+ private static Break convertBreak(final FoKeyword foBreak) {
switch (foBreak) {
case AUTO: return Break.AUTO;
case COLUMN: return Break.COLUMN;
@@ -999,7 +999,7 @@
@Override
public Break traitBreakAfter(final FoContext context) {
- final FoValue foBreak = getPropertyList().getBreakAfter(this, context);
+ final FoKeyword foBreak = getPropertyList().getBreakAfter(this, context);
return convertBreak(foBreak);
}
@@ -1087,8 +1087,8 @@
@Override
public boolean initialPageNumberSetExplicitly() {
- final FoValue rawInitialPageNumber = getPropertyList().getRawInitialPageNumber(this);
- return rawInitialPageNumber == FoValue.NOT_A_KEYWORD;
+ final FoKeyword rawInitialPageNumber = getPropertyList().getRawInitialPageNumber(this);
+ return rawInitialPageNumber == FoKeyword.NOT_A_KEYWORD;
}
/**
@@ -1124,11 +1124,11 @@
}
/**
- * Converts a {@link FoValue} force-page-count value to the more generic {@link ForcePageCount} value.
+ * Converts a {@link FoKeyword} force-page-count value to the more generic {@link ForcePageCount} value.
* @param foForcePageCount The raw FO force-page-count value to be converted.
* @return The matching ForcePageCount instance.
*/
- private static ForcePageCount convertForcePageCount(final FoValue foForcePageCount) {
+ private static ForcePageCount convertForcePageCount(final FoKeyword foForcePageCount) {
switch (foForcePageCount) {
case AUTO: return ForcePageCount.AUTO;
case EVEN: return ForcePageCount.EVEN;
@@ -1142,7 +1142,7 @@
@Override
public ForcePageCount traitForcePageCount(final FoContext context) {
- final FoValue foForcePageCount = getPropertyList().getForcePageCount(this, context);
+ final FoKeyword foForcePageCount = getPropertyList().getForcePageCount(this, context);
return convertForcePageCount(foForcePageCount);
}
@@ -1173,11 +1173,11 @@
}
/**
- * Converts an {@link FoValue} overflow value to the more generic {@link Overflow} value.
+ * Converts an {@link FoKeyword} overflow value to the more generic {@link Overflow} value.
* @param foOverflow The raw FO overflow value to be converted.
* @return The matching Overflow instance.
*/
- private static Overflow convertOverflow(final FoValue foOverflow) {
+ private static Overflow convertOverflow(final FoKeyword foOverflow) {
switch (foOverflow) {
case VISIBLE: return Overflow.VISIBLE;
case HIDDEN: return Overflow.HIDDEN;
@@ -1191,7 +1191,7 @@
@Override
public Overflow traitOverflow(final FoContext context) {
- final FoValue foOverflow = getPropertyList().getOverflow(this, context);
+ final FoKeyword foOverflow = getPropertyList().getOverflow(this, context);
return convertOverflow(foOverflow);
}
@@ -1219,11 +1219,11 @@
}
/**
- * Converts an {@link FoValue} text-align value to the more generic {@link TextAlign} value.
+ * Converts an {@link FoKeyword} text-align value to the more generic {@link TextAlign} value.
* @param foTextAlign The raw FO text-align value to be converted.
* @return The matching TextAlign instance.
*/
- private static TextAlign convertTextAlign(final FoValue foTextAlign) {
+ private static TextAlign convertTextAlign(final FoKeyword foTextAlign) {
switch (foTextAlign) {
case START: return TextAlign.START;
case CENTER: return TextAlign.CENTER;
@@ -1242,7 +1242,7 @@
@Override
public TextAlign traitTextAlign(final FoContext context) {
- final FoValue foTextAlign = getPropertyList().getTextAlign(this, context);
+ final FoKeyword foTextAlign = getPropertyList().getTextAlign(this, context);
return convertTextAlign(foTextAlign);
}
@@ -1252,11 +1252,11 @@
}
/**
- * Converts an {@link FoValue} text-align-last value to the more generic {@link TextAlignLast} value.
+ * Converts an {@link FoKeyword} text-align-last value to the more generic {@link TextAlignLast} value.
* @param foTextAlignLast The raw FO text-align-last value to be converted.
* @return The matching TextAlignLast instance.
*/
- private static TextAlignLast convertTextAlignLast(final FoValue foTextAlignLast) {
+ private static TextAlignLast convertTextAlignLast(final FoKeyword foTextAlignLast) {
switch (foTextAlignLast) {
case RELATIVE: return TextAlignLast.RELATIVE;
case START: return TextAlignLast.START;
@@ -1275,7 +1275,7 @@
@Override
public TextAlignLast traitTextAlignLast(final FoContext context) {
- final FoValue foTextAlignLast = getPropertyList().getTextAlignLast(this, context);
+ final FoKeyword foTextAlignLast = getPropertyList().getTextAlignLast(this, context);
return convertTextAlignLast(foTextAlignLast);
}
@@ -1424,16 +1424,16 @@
@Override
public Break traitBreakBefore(final FoContext context) {
- final FoValue foBreak = getPropertyList().getBreakBefore(this, context);
+ final FoKeyword foBreak = getPropertyList().getBreakBefore(this, context);
return convertBreak(foBreak);
}
/**
- * Converts an {@link FoValue} scaling value to the more generic {@link Scaling} value.
+ * Converts an {@link FoKeyword} scaling value to the more generic {@link Scaling} value.
* @param foScaling The raw FO scaling value to be converted.
* @return The matching Scaling instance.
*/
- private static Scaling convertScaling(final FoValue foScaling) {
+ private static Scaling convertScaling(final FoKeyword foScaling) {
switch (foScaling) {
case UNIFORM: return Scaling.UNIFORM;
case NON_UNIFORM: return Scaling.NON_UNIFORM;
@@ -1448,17 +1448,17 @@
* @see "XSL-FO Standard 1.0, Section 7.14.10"
*/
public Scaling traitScaling(final FoContext context) {
- final FoValue foScaling = getPropertyList().getScaling(this, context);
+ final FoKeyword foScaling = getPropertyList().getScaling(this, context);
return convertScaling(foScaling);
}
/**
- * Converts an {@link FoValue} leader-pattern value to the more generic {@link LeaderPattern} value.
+ * Converts an {@link FoKeyword} leader-pattern value to the more generic {@link LeaderPattern} value.
* @param foLeaderPattern The raw FO leader-pattern value to be converted.
* @return The matching LeaderPattern instance.
*/
private static LeaderPattern convertLeaderPattern(
- final FoValue foLeaderPattern) {
+ final FoKeyword foLeaderPattern) {
switch (foLeaderPattern) {
case SPACE: return LeaderPattern.SPACE;
case RULE: return LeaderPattern.RULE;
@@ -1470,7 +1470,7 @@
@Override
public LeaderPattern traitLeaderPattern(final FoContext context) {
- final FoValue foLeaderPattern = getPropertyList().getLeaderPattern(this, context);
+ final FoKeyword foLeaderPattern = getPropertyList().getLeaderPattern(this, context);
return convertLeaderPattern(foLeaderPattern);
}
@@ -1498,11 +1498,11 @@
}
/**
- * Converts an {@link FoValue} rule-style value to the more generic {@link RuleStyle} value.
+ * Converts an {@link FoKeyword} rule-style value to the more generic {@link RuleStyle} value.
* @param foRuleStyle The raw FO rule style to be converted.
* @return The matching RuleStyle instance.
*/
- private static RuleStyle convertRuleStyle(final FoValue foRuleStyle) {
+ private static RuleStyle convertRuleStyle(final FoKeyword foRuleStyle) {
switch (foRuleStyle) {
case NONE: return RuleStyle.NONE;
case DOTTED: return RuleStyle.DOTTED;
@@ -1517,7 +1517,7 @@
@Override
public RuleStyle traitRuleStyle(final FoContext context) {
- final FoValue foRuleStyle = getPropertyList().getRuleStyle(this, context);
+ final FoKeyword foRuleStyle = getPropertyList().getRuleStyle(this, context);
return convertRuleStyle(foRuleStyle);
}
@@ -1527,11 +1527,11 @@
}
/**
- * Converts an {@link FoValue} leader-alignment value to the more generic {@link LeaderAlignment} value.
+ * Converts an {@link FoKeyword} leader-alignment value to the more generic {@link LeaderAlignment} value.
* @param foLeaderAlignment The raw FO leader-alignment to be converted.
* @return The matching LeaderAlignment instance.
*/
- private static LeaderAlignment convertLeaderAlignment(final FoValue foLeaderAlignment) {
+ private static LeaderAlignment convertLeaderAlignment(final FoKeyword foLeaderAlignment) {
switch (foLeaderAlignment) {
case NONE: return LeaderAlignment.NONE;
case REFERENCE_AREA: return LeaderAlignment.REFERENCE_AREA;
@@ -1542,7 +1542,7 @@
@Override
public LeaderAlignment traitLeaderAlignment(final FoContext context) {
- final FoValue foLeaderAlignment = getPropertyList().getLeaderAlignment(this, context);
+ final FoKeyword foLeaderAlignment = getPropertyList().getLeaderAlignment(this, context);
return convertLeaderAlignment(foLeaderAlignment);
}
@@ -1552,11 +1552,11 @@
}
/**
- * Converts an {@link FoValue} table-layout value to the more generic {@link TableLayout} value.
+ * Converts an {@link FoKeyword} table-layout value to the more generic {@link TableLayout} value.
* @param foTableLayout The raw FO leader-alignment to be converted.
* @return The matching TableLayout instance.
*/
- private static TableLayout convertTableLayout(final FoValue foTableLayout) {
+ private static TableLayout convertTableLayout(final FoKeyword foTableLayout) {
switch (foTableLayout) {
case AUTO: return TableLayout.AUTO;
case FIXED: return TableLayout.FIXED;
@@ -1566,7 +1566,7 @@
@Override
public TableLayout traitTableLayout() {
- final FoValue foTableLayout = getPropertyList().getTableLayout();
+ final FoKeyword foTableLayout = getPropertyList().getTableLayout();
return convertTableLayout(foTableLayout);
}
@@ -1777,11 +1777,11 @@
}
/**
- * Converts an {@link FoValue} background-repeat value to the more generic {@link BackgroundRepeat} value.
+ * Converts an {@link FoKeyword} background-repeat value to the more generic {@link BackgroundRepeat} value.
* @param foBackgroundRepeat The raw FO background-repeat to be converted.
* @return The matching BackgroundRepeat instance.
*/
- private static BackgroundRepeat convertBackgroundRepeat(final FoValue foBackgroundRepeat) {
+ private static BackgroundRepeat convertBackgroundRepeat(final FoKeyword foBackgroundRepeat) {
switch (foBackgroundRepeat) {
case REPEAT: return BackgroundRepeat.REPEAT;
case REPEAT_X: return BackgroundRepeat.REPEAT_X;
@@ -1793,7 +1793,7 @@
@Override
public BackgroundRepeat traitBackgroundRepeat(final FoContext context) {
- final FoValue foBackgroundRepeat = getPropertyList().getBackgroundRepeat(this, context);
+ final FoKeyword foBackgroundRepeat = getPropertyList().getBackgroundRepeat(this, context);
return convertBackgroundRepeat(foBackgroundRepeat);
}
@@ -1994,12 +1994,12 @@
}
/**
- * Converts an {@link FoValue} absolute-position value to the more generic
+ * Converts an {@link FoKeyword} absolute-position value to the more generic
* {@link AbsolutePosition} value.
* @param foAbsolutePosition The raw FO absolute-position to be converted.
* @return The matching AbsolutePosition instance.
*/
- private static AbsolutePosition convertAbsolutePosition(final FoValue foAbsolutePosition) {
+ private static AbsolutePosition convertAbsolutePosition(final FoKeyword foAbsolutePosition) {
switch (foAbsolutePosition) {
case AUTO: return AbsolutePosition.AUTO;
case ABSOLUTE: return AbsolutePosition.ABSOLUTE;
@@ -2010,16 +2010,16 @@
@Override
public AbsolutePosition traitAbsolutePosition(final FoContext context) {
- final FoValue foAbsolutePosition = getPropertyList().traitAbsolutePosition(this, context);
+ final FoKeyword foAbsolutePosition = getPropertyList().traitAbsolutePosition(this, context);
return convertAbsolutePosition(foAbsolutePosition);
}
/**
- * Converts an {@link FoValue} background-attachment value to the more generic {@link BackgroundAttachment} value.
+ * Converts an {@link FoKeyword} background-attachment value to the more generic {@link BackgroundAttachment} value.
* @param foBackgroundAttachment The raw FO background-attachment to be converted.
* @return The matching BackgroundAttachment instance.
*/
- private static BackgroundAttachment convertBackgroundAttachment(final FoValue foBackgroundAttachment) {
+ private static BackgroundAttachment convertBackgroundAttachment(final FoKeyword foBackgroundAttachment) {
switch (foBackgroundAttachment) {
case SCROLL: return BackgroundAttachment.SCROLL;
case FIXED: return BackgroundAttachment.FIXED;
@@ -2030,17 +2030,17 @@
@Override
public BackgroundAttachment traitBackgroundAttachment(final FoContext context) {
- final FoValue foBackgroundAttachment = getPropertyList().traitBackgroundAttachment(this, context);
+ final FoKeyword foBackgroundAttachment = getPropertyList().traitBackgroundAttachment(this, context);
return convertBackgroundAttachment(foBackgroundAttachment);
}
/**
- * Converts an {@link FoValue} caption-side value to the more generic {@link RelativeCompass} value.
+ * Converts an {@link FoKeyword} caption-side value to the more generic {@link RelativeCompass} value.
* @param foCaptionSide The raw FO caption-side to be converted.
* @param writingMode The writing mode for the fo.
* @return The matching RelativeCompass instance.
*/
- private static RelativeCompass convertCaptionSide(final FoValue foCaptionSide, final DtWritingMode writingMode) {
+ private static RelativeCompass convertCaptionSide(final FoKeyword foCaptionSide, final DtWritingMode writingMode) {
switch (foCaptionSide) {
case BEFORE: return RelativeCompass.BEFORE;
case AFTER: return RelativeCompass.AFTER;
@@ -2056,16 +2056,16 @@
@Override
public RelativeCompass traitCaptionSide(final FoContext context) {
- final FoValue foCaptionSide = getPropertyList().traitCaptionSide(this, context);
+ final FoKeyword foCaptionSide = getPropertyList().traitCaptionSide(this, context);
return convertCaptionSide(foCaptionSide, this.traitWritingMode(context));
}
/**
- * Converts an {@link FoValue} direction value to the more generic {@link AbsoluteDirection} value.
+ * Converts an {@link FoKeyword} direction value to the more generic {@link AbsoluteDirection} value.
* @param foDirection The raw FO direction to be converted.
* @return The matching AbsoluteDirection instance.
*/
- private static AbsoluteDirection convertDirection(final FoValue foDirection) {
+ private static AbsoluteDirection convertDirection(final FoKeyword foDirection) {
switch (foDirection) {
case LTR: return AbsoluteDirection.LEFT_TO_RIGHT;
case RTL: return AbsoluteDirection.RIGHT_TO_LEFT;
@@ -2075,17 +2075,17 @@
@Override
public AbsoluteDirection traitDirection(final FoContext context) {
- final FoValue foDirection = getPropertyList().traitDirection(this, context);
+ final FoKeyword foDirection = getPropertyList().traitDirection(this, context);
return convertDirection(foDirection);
}
/**
- * Converts an {@link FoValue} font-selection-strategy value to the more generic
+ * Converts an {@link FoKeyword} font-selection-strategy value to the more generic
* {@link org.axsl.font.Font.SelectionStrategy} value.
* @param foFontSelectionStrategy The raw FO font-selection-strategy to be converted.
* @return The matching Font.SelectionStrategy instance.
*/
- private static FontSelectionStrategy convertFontSelectionStrategy(final FoValue foFontSelectionStrategy) {
+ private static FontSelectionStrategy convertFontSelectionStrategy(final FoKeyword foFontSelectionStrategy) {
switch (foFontSelectionStrategy) {
case AUTO: return FontSelectionStrategy.AUTO;
case CHARACTER_BY_CHARACTER: return FontSelectionStrategy.CHARACTER_BY_CHARACTER;
@@ -2096,16 +2096,16 @@
@Override
public FontSelectionStrategy traitFontSelectionStrategy(final FoContext context) {
- final FoValue foFss = getPropertyList().traitFontSelectionStrategy(this, context);
+ final FoKeyword foFss = getPropertyList().traitFontSelectionStrategy(this, context);
return convertFontSelectionStrategy(foFss);
}
/**
- * Converts an {@link FoValue} hyphenation-keep value to the more generic {@link HyphenationKeep} value.
+ * Converts an {@link FoKeyword} hyphenation-keep value to the more generic {@link HyphenationKeep} value.
* @param foHyphenationKeep The raw FO hyphenation-keep to be converted.
* @return The matching HyphenationKeep instance.
*/
- private static HyphenationKeep convertHyphenationKeep(final FoValue foHyphenationKeep) {
+ private static HyphenationKeep convertHyphenationKeep(final FoKeyword foHyphenationKeep) {
switch (foHyphenationKeep) {
case AUTO: return HyphenationKeep.AUTO;
case COLUMN: return HyphenationKeep.COLUMN;
@@ -2116,16 +2116,16 @@
@Override
public HyphenationKeep traitHyphenationKeep(final FoContext context) {
- final FoValue foValue = getPropertyList().traitHyphenationKeep(this, context);
+ final FoKeyword foValue = getPropertyList().traitHyphenationKeep(this, context);
return convertHyphenationKeep(foValue);
}
/**
- * Converts an {@link FoValue} linefeed-treatment value to the more generic {@link LinefeedTreatment} value.
+ * Converts an {@link FoKeyword} linefeed-treatment value to the more generic {@link LinefeedTreatment} value.
* @param foLinefeedTreatment The raw FO linefeed-treatment to be converted.
* @return The matching LinefeedTreatment instance.
*/
- private static LinefeedTreatment convertLinefeedTreatment(final FoValue foLinefeedTreatment) {
+ private static LinefeedTreatment convertLinefeedTreatment(final FoKeyword foLinefeedTreatment) {
switch (foLinefeedTreatment) {
case IGNORE: return LinefeedTreatment.IGNORE;
case PRESERVE: return LinefeedTreatment.PRESERVE;
@@ -2137,18 +2137,18 @@
@Override
public LinefeedTreatment traitLinefeedTreatment(final FoContext context) {
- final FoValue foValue = getPropertyList().traitLinefeedTreatment(this, context);
+ final FoKeyword foValue = getPropertyList().traitLinefeedTreatment(this, context);
return convertLinefeedTreatment(foValue);
}
/**
- * Converts an {@link FoValue} line-height-shift-adjustment value to the more generic
+ * Converts an {@link FoKeyword} line-height-shift-adjustment value to the more generic
* {@link LineHeightShiftAdjustment} value.
* @param foLineHeightShiftAdjustment The raw FO line-height-shift-adjustment to be converted.
* @return The matching LineHeightShiftAdjustment instance.
*/
private static LineHeightShiftAdjustment convertLineHeightShiftAdjustment(
- final FoValue foLineHeightShiftAdjustment) {
+ final FoKeyword foLineHeightShiftAdjustment) {
switch (foLineHeightShiftAdjustment) {
case CONSIDER_SHIFTS: return LineHeightShiftAdjustment.CONSIDER_SHIFTS;
case DISREGARD_SHIFTS: return LineHeightShiftAdjustment.DISREGARD_SHIFTS;
@@ -2159,16 +2159,17 @@
@Override
public LineHeightShiftAdjustment traitLineHeightShiftAdjustment(final FoContext context) {
- final FoValue foValue = getPropertyList().traitLineHeightShiftAdjustment(this, context);
+ final FoKeyword foValue = getPropertyList().traitLineHeightShiftAdjustment(this, context);
return convertLineHeightShiftAdjustment(foValue);
}
/**
- * Converts an {@link FoValue} line-stacking-strategy value to the more generic {@link LineStackingStrategy} value.
+ * Converts an {@link FoKeyword} line-stacking-strategy value to the more generic {@link LineStackingStrategy}
+ * value.
* @param foLineStackingStrategy The raw FO line-stacking-strategy to be converted.
* @return The matching LineStackingStrategy instance.
*/
- private static LineStackingStrategy convertLineStackingStrategy(final FoValue foLineStackingStrategy) {
+ private static LineStackingStrategy convertLineStackingStrategy(final FoKeyword foLineStackingStrategy) {
switch (foLineStackingStrategy) {
case LINE_HEIGHT: return LineStackingStrategy.LINE_HEIGHT;
case FONT_HEIGHT: return LineStackingStrategy.FONT_HEIGHT;
@@ -2180,16 +2181,16 @@
@Override
public LineStackingStrategy traitLineStackingStrategy(final FoContext context) {
- final FoValue foValue = getPropertyList().traitLineStackingStrategy(this, context);
+ final FoKeyword foValue = getPropertyList().traitLineStackingStrategy(this, context);
return convertLineStackingStrategy(foValue);
}
/**
- * Converts an {@link FoValue} relative-position value to the more generic {@link RelativePosition} value.
+ * Converts an {@link FoKeyword} relative-position value to the more generic {@link RelativePosition} value.
* @param foRelativePosition The raw FO relative-position to be converted.
* @return The matching RelativePosition instance.
*/
- private static RelativePosition convertRelativePosition(final FoValue foRelativePosition) {
+ private static RelativePosition convertRelativePosition(final FoKeyword foRelativePosition) {
switch (foRelativePosition) {
case STATIC: return RelativePosition.STATIC;
case RELATIVE: return RelativePosition.RELATIVE;
@@ -2199,16 +2200,16 @@
@Override
public RelativePosition traitRelativePosition(final FoContext context) {
- final FoValue foValue = getPropertyList().traitRelativePosition(this, context);
+ final FoKeyword foValue = getPropertyList().traitRelativePosition(this, context);
return convertRelativePosition(foValue);
}
/**
- * Converts an {@link FoValue} scaling-method value to the more generic {@link ScalingMethod} value.
+ * Converts an {@link FoKeyword} scaling-method value to the more generic {@link ScalingMethod} value.
* @param foScalingMethod The raw FO scaling-method to be converted.
* @return The matching ScalingMethod instance.
*/
- private static ScalingMethod convertScalingMethod(final FoValue foScalingMethod) {
+ private static ScalingMethod convertScalingMethod(final FoKeyword foScalingMethod) {
switch (foScalingMethod) {
case AUTO: return ScalingMethod.AUTO;
case INTEGER_PIXELS: return ScalingMethod.INTEGER_PIXELS;
@@ -2224,16 +2225,16 @@
* @see "XSL-FO Standard 1.0, Section 7.14.11"
*/
public ScalingMethod traitScalingMethod(final FoContext context) {
- final FoValue foValue = getPropertyList().traitScalingMethod(this, context);
+ final FoKeyword foValue = getPropertyList().traitScalingMethod(this, context);
return convertScalingMethod(foValue);
}
/**
- * Converts an {@link FoValue} suppress-at-line-break value to the more generic {@link SuppressAtLineBreak} value.
+ * Converts an {@link FoKeyword} suppress-at-line-break value to the more generic {@link SuppressAtLineBreak} value.
* @param foSuppressAtLineBreak The raw FO suppress-at-line-break to be converted.
* @return The matching SuppressAtLineBreak instance.
*/
- private static SuppressAtLineBreak convertSuppressAtLineBreak(final FoValue foSuppressAtLineBreak) {
+ private static SuppressAtLineBreak convertSuppressAtLineBreak(final FoKeyword foSuppressAtLineBreak) {
switch (foSuppressAtLineBreak) {
case AUTO: return SuppressAtLineBreak.AUTO;
case SUPPRESS: return SuppressAtLineBreak.SUPPRESS;
@@ -2245,16 +2246,16 @@
@Override
public SuppressAtLineBreak traitSuppressAtLineBreak(final FoContext context) {
- final FoValue foValue = getPropertyList().traitSuppressAtLineBreak(this, context);
+ final FoKeyword foValue = getPropertyList().traitSuppressAtLineBreak(this, context);
return convertSuppressAtLineBreak(foValue);
}
/**
- * Converts an {@link FoValue} unicode-bidi value to the more generic {@link UnicodeBidi} value.
+ * Converts an {@link FoKeyword} unicode-bidi value to the more generic {@link UnicodeBidi} value.
* @param foUnicodeBidi The raw FO unicode-bidi to be converted.
* @return The matching UnicodeBidi instance.
*/
- private static UnicodeBidi convertUnicodeBidi(final FoValue foUnicodeBidi) {
+ private static UnicodeBidi convertUnicodeBidi(final FoKeyword foUnicodeBidi) {
switch (foUnicodeBidi) {
case NORMAL: return UnicodeBidi.NORMAL;
case EMBED: return UnicodeBidi.EMBED;
@@ -2265,16 +2266,16 @@
@Override
public UnicodeBidi traitUnicodeBidi(final FoContext context) {
- final FoValue foValue = getPropertyList().traitUnicodeBidi(this, context);
+ final FoKeyword foValue = getPropertyList().traitUnicodeBidi(this, context);
return convertUnicodeBidi(foValue);
}
/**
- * Converts an {@link FoValue} white-space-treatment value to the more generic {@link WhiteSpaceTreatment} value.
+ * Converts an {@link FoKeyword} white-space-treatment value to the more generic {@link WhiteSpaceTreatment} value.
* @param foWhiteSpaceTreatment The raw FO white-space-treatment to be converted.
* @return The matching WhiteSpaceTreatment instance.
*/
- private static WhiteSpaceTreatment convertWhiteSpaceTreatment(final FoValue foWhiteSpaceTreatment) {
+ private static WhiteSpaceTreatment convertWhiteSpaceTreatment(final FoKeyword foWhiteSpaceTreatment) {
switch (foWhiteSpaceTreatment) {
case IGNORE: return WhiteSpaceTreatment.IGNORE;
case PRESERVE: return WhiteSpaceTreatment.PRESERVE;
@@ -2288,7 +2289,7 @@
@Override
public WhiteSpaceTreatment traitWhiteSpaceTreatment(final FoContext context) {
- final FoValue foValue = getPropertyList().traitWhiteSpaceTreatment(this, context);
+ final FoKeyword foValue = getPropertyList().traitWhiteSpaceTreatment(this, context);
return convertWhiteSpaceTreatment(foValue);
}
@@ -2298,11 +2299,11 @@
}
/**
- * Converts an {@link FoValue} active-state value to the more generic {@link ActiveState} value.
+ * Converts an {@link FoKeyword} active-state value to the more generic {@link ActiveState} value.
* @param foActiveState The raw FO active-state to be converted.
* @return The matching ActiveState instance.
*/
- private static ActiveState convertActiveState(final FoValue foActiveState) {
+ private static ActiveState convertActiveState(final FoKeyword foActiveState) {
switch (foActiveState) {
case LINK: return ActiveState.LINK;
case VISITED: return ActiveState.VISITED;
@@ -2315,16 +2316,16 @@
@Override
public ActiveState traitActiveState(final FoContext context) {
- final FoValue foValue = getPropertyList().traitActiveState(this, context);
+ final FoKeyword foValue = getPropertyList().traitActiveState(this, context);
return convertActiveState(foValue);
}
/**
- * Converts an {@link FoValue} clear value to the more generic {@link Clear} value.
+ * Converts an {@link FoKeyword} clear value to the more generic {@link Clear} value.
* @param foClear The raw FO clear to be converted.
* @return The matching Clear instance.
*/
- private static Clear convertClear(final FoValue foClear) {
+ private static Clear convertClear(final FoKeyword foClear) {
switch (foClear) {
case START: return Clear.START;
case END: return Clear.END;
@@ -2338,16 +2339,16 @@
@Override
public Clear traitClear(final FoContext context) {
- final FoValue foValue = getPropertyList().traitClear(this, context);
+ final FoKeyword foValue = getPropertyList().traitClear(this, context);
return convertClear(foValue);
}
/**
- * Converts an {@link FoValue} empty-cells value to the more generic {@link EmptyCells} value.
+ * Converts an {@link FoKeyword} empty-cells value to the more generic {@link EmptyCells} value.
* @param foEmptyCells The raw FO empty-cells to be converted.
* @return The matching EmptyCells instance.
*/
- private static EmptyCells convertEmptyCells(final FoValue foEmptyCells) {
+ private static EmptyCells convertEmptyCells(final FoKeyword foEmptyCells) {
switch (foEmptyCells) {
case SHOW: return EmptyCells.SHOW;
case HIDE: return EmptyCells.HIDE;
@@ -2357,16 +2358,16 @@
@Override
public EmptyCells traitEmptyCells(final FoContext context) {
- final FoValue foValue = getPropertyList().traitEmptyCells(this, context);
+ final FoKeyword foValue = getPropertyList().traitEmptyCells(this, context);
return convertEmptyCells(foValue);
}
/**
- * Converts an {@link FoValue} float value to the more generic {@link Float} value.
+ * Converts an {@link FoKeyword} float value to the more generic {@link Float} value.
* @param foFloat The raw FO float to be converted.
* @return The matching Float instance.
*/
- private static Float convertFloat(final FoValue foFloat) {
+ private static Float convertFloat(final FoKeyword foFloat) {
switch (foFloat) {
case BEFORE: return Float.BEFORE;
case START: return Float.START;
@@ -2380,16 +2381,16 @@
@Override
public org.axsl.value.Float traitFloat(final FoContext context) {
- final FoValue foValue = getPropertyList().traitFloat(this, context);
+ final FoKeyword foValue = getPropertyList().traitFloat(this, context);
return convertFloat(foValue);
}
/**
- * Converts an {@link FoValue} media-usage value to the more generic {@link MediaUsage} value.
+ * Converts an {@link FoKeyword} media-usage value to the more generic {@link MediaUsage} value.
* @param foMediaUsage The raw FO media-usage to be converted.
* @return The matching MediaUsage instance.
*/
- private static MediaUsage convertMediaUsage(final FoValue foMediaUsage) {
+ private static MediaUsage convertMediaUsage(final FoKeyword foMediaUsage) {
switch (foMediaUsage) {
case PAGINATE: return MediaUsage.PAGINATE;
case BOUNDED_IN_ONE_DIMENSION: return MediaUsage.BOUNDED_IN_ONE_DIMENSION;
@@ -2400,16 +2401,16 @@
@Override
public MediaUsage traitMediaUsage(final FoContext context) {
- final FoValue foValue = getPropertyList().traitMediaUsage(this, context);
+ final FoKeyword foValue = getPropertyList().traitMediaUsage(this, context);
return convertMediaUsage(foValue);
}
/**
- * Converts an {@link FoValue} reference-orientation value to the more generic {@link ReferenceOrientation} value.
+ * Converts an {@link FoKeyword} reference-orientation value to the more generic {@link ReferenceOrientation} value.
* @param foReferenceOrientation The raw FO reference-orientation to be converted.
* @return The matching ReferenceOrientation instance.
*/
- private static ReferenceOrientation convertReferenceOrientation(final FoValue foReferenceOrientation) {
+ private static ReferenceOrientation convertReferenceOrientation(final FoKeyword foReferenceOrientation) {
switch (foReferenceOrientation) {
case NUM_ZERO: return ReferenceOrientation.ROTATION_0_DEGREES;
case NUM_90: return ReferenceOrientation.ROTATION_90_DEGREES;
@@ -2428,7 +2429,7 @@
/* Per XSL-FO Standard 1.0, Section 7.20.3, reference-orientation is
* only applied to FOs that establish a reference-area. */
if (traitIsReferenceArea()) {
- final FoValue foValue = getPropertyList().traitReferenceOrientation(this, context);
+ final FoKeyword foValue = getPropertyList().traitReferenceOrientation(this, context);
return convertReferenceOrientation(foValue);
}
return null;
@@ -2435,11 +2436,11 @@
}
/**
- * Converts an {@link FoValue} rendering-intent value to the more generic {@link RenderingIntent} value.
+ * Converts an {@link FoKeyword} rendering-intent value to the more generic {@link RenderingIntent} value.
* @param foRenderingIntent The raw FO rendering-intent to be converted.
* @return The matching RenderingIntent instance.
*/
- private static RenderingIntent convertRenderingIntent(final FoValue foRenderingIntent) {
+ private static RenderingIntent convertRenderingIntent(final FoKeyword foRenderingIntent) {
switch (foRenderingIntent) {
case AUTO: return RenderingIntent.AUTO;
case PERCEPTUAL: return RenderingIntent.PERCEPTUAL;
@@ -2452,16 +2453,16 @@
@Override
public RenderingIntent traitRenderingIntent(final FoContext context) {
- final FoValue foValue = getPropertyList().traitRenderingIntent(this, context);
+ final FoKeyword foValue = getPropertyList().traitRenderingIntent(this, context);
return convertRenderingIntent(foValue);
}
/**
- * Converts an {@link FoValue} show-destination value to the more generic {@link ShowDestination} value.
+ * Converts an {@link FoKeyword} show-destination value to the more generic {@lin...
[truncated message content] |
|
From: <vic...@us...> - 2023-01-02 15:07:33
|
Revision: 13003
http://sourceforge.net/p/foray/code/13003
Author: victormote
Date: 2023-01-02 15:07:30 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Rename keyword property value classes, for clarity and consistency.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AbstractAxslProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAllowedAxisScale.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Datatype.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/AbstractBorderWidthTests.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AbstractAxslProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AbstractAxslProperty.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AbstractAxslProperty.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -74,7 +74,7 @@
* @return If {@code possibleKeyword} is found in the validKeywords,
* return an appropriate property value instance, otherwise returns null.
*/
- protected AxslPropertyKeyword checkKeywords(final AxslValue[] validKeywords,
+ protected PvKeywordAxsl checkKeywords(final AxslValue[] validKeywords,
final String possibleKeyword) {
if (validKeywords == null
|| validKeywords.length < 1) {
@@ -83,7 +83,7 @@
final AxslValue value = AxslValue.xslValueOf(possibleKeyword);
for (AxslValue testValue : validKeywords) {
if (testValue.equals(value)) {
- return AxslPropertyKeyword.getPropertyKeyword(value);
+ return PvKeywordAxsl.getPropertyKeyword(value);
}
}
return null;
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.axsl;
-
-import org.foray.fotree.value.PvKeyword;
-
-/**
- * Class encapsulating those property values that are expressed as keywords
- * (e.g. "inherit", "auto", "true", etc.).
- * Instances of this class are immutable and are therefore treated as a group
- * of singletons, one for each possible keyword value.
- */
-public final class AxslPropertyKeyword extends PvKeyword {
-
- /** Array of the possible keyword values. */
- private static AxslPropertyKeyword[] keywords = new AxslPropertyKeyword[
- AxslValue.values().length];
-
- /** The encapsulated keyword enumeration. */
- private AxslValue value;
-
- /**
- * Private constructor. Use {@link #getPropertyKeyword(AxslValue)} to obtain an instance of this class.
- * @param value The keyword enumeration value to encapsulate in this object.
- */
- private AxslPropertyKeyword(final AxslValue value) {
- this.value = value;
- }
-
- /**
- * Return the keyword enumeration.
- * @return The keyword enumeration.
- * @see AxslValue and following for the property keyword enumerations.
- */
- public AxslValue getValue() {
- return this.value;
- }
-
- /**
- * Gets or creates the singleton instance for the specific keyword value.
- * There is no need for multiple instances of this class for the same
- * keyword.
- * @param value The value for which the singleton instance is needed.
- * @return The singleton keyword instance, or null if the value is an
- * invalid keyword index.
- */
- public static AxslPropertyKeyword getPropertyKeyword(
- final AxslValue value) {
- if (value == null) {
- return null;
- }
- final int ordinal = value.ordinal();
- if (AxslPropertyKeyword.keywords[ordinal] == null) {
- AxslPropertyKeyword.keywords[ordinal] =
- new AxslPropertyKeyword(value);
- }
- return AxslPropertyKeyword.keywords[ordinal];
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java (from rev 12923, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.axsl;
+
+import org.foray.fotree.value.PvKeyword;
+
+/**
+ * Class encapsulating those property values that are expressed as keywords
+ * (e.g. "inherit", "auto", "true", etc.).
+ * Instances of this class are immutable and are therefore treated as a group
+ * of singletons, one for each possible keyword value.
+ */
+public final class PvKeywordAxsl extends PvKeyword {
+
+ /** Array of the possible keyword values. */
+ private static PvKeywordAxsl[] keywords = new PvKeywordAxsl[
+ AxslValue.values().length];
+
+ /** The encapsulated keyword enumeration. */
+ private AxslValue value;
+
+ /**
+ * Private constructor. Use {@link #getPropertyKeyword(AxslValue)} to obtain an instance of this class.
+ * @param value The keyword enumeration value to encapsulate in this object.
+ */
+ private PvKeywordAxsl(final AxslValue value) {
+ this.value = value;
+ }
+
+ /**
+ * Return the keyword enumeration.
+ * @return The keyword enumeration.
+ * @see AxslValue and following for the property keyword enumerations.
+ */
+ public AxslValue getValue() {
+ return this.value;
+ }
+
+ /**
+ * Gets or creates the singleton instance for the specific keyword value.
+ * There is no need for multiple instances of this class for the same
+ * keyword.
+ * @param value The value for which the singleton instance is needed.
+ * @return The singleton keyword instance, or null if the value is an
+ * invalid keyword index.
+ */
+ public static PvKeywordAxsl getPropertyKeyword(
+ final AxslValue value) {
+ if (value == null) {
+ return null;
+ }
+ final int ordinal = value.ordinal();
+ if (PvKeywordAxsl.keywords[ordinal] == null) {
+ PvKeywordAxsl.keywords[ordinal] =
+ new PvKeywordAxsl(value);
+ }
+ return PvKeywordAxsl.keywords[ordinal];
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/prop/AxslEnumerated.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.axsl.AbstractAxslProperty;
import org.foray.fotree.axsl.AxslPropertyId;
-import org.foray.fotree.axsl.AxslPropertyKeyword;
import org.foray.fotree.axsl.AxslValue;
+import org.foray.fotree.axsl.PvKeywordAxsl;
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
@@ -63,7 +63,7 @@
*/
private PropertyValue createPropertyValue(final String value) throws PropertyException {
final PropertyValue pv = standardParse(value);
- if (pv instanceof AxslPropertyKeyword) {
+ if (pv instanceof PvKeywordAxsl) {
return pv;
}
throw unexpectedValue(value);
@@ -76,8 +76,8 @@
* @return The value of this property.
*/
public AxslValue getValue(final FoContext context, final FoObj fobj) {
- if (value() instanceof AxslPropertyKeyword) {
- final AxslPropertyKeyword axslKeyword = (AxslPropertyKeyword)
+ if (value() instanceof PvKeywordAxsl) {
+ final PvKeywordAxsl axslKeyword = (PvKeywordAxsl)
this.value();
final AxslValue keyword = axslKeyword.getValue();
// if (keyword == AxslValue.INHERIT) {
@@ -98,8 +98,8 @@
* @return The value of this property.
*/
public AxslValue getValue() {
- if (value() instanceof AxslPropertyKeyword) {
- final AxslPropertyKeyword axslKeyword = (AxslPropertyKeyword)
+ if (value() instanceof PvKeywordAxsl) {
+ final PvKeywordAxsl axslKeyword = (PvKeywordAxsl)
this.value();
final AxslValue keyword = axslKeyword.getValue();
return keyword;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/AbstractFoProperty.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -96,7 +96,7 @@
* @return If {@code possibleKeyword} is found in the validKeywords,
* return an appropriate property value instance, otherwise returns null.
*/
- protected static FoPropertyKeyword checkKeywords(final FoValue[] validKeywords, final String possibleKeyword) {
+ protected static PvKeywordFo checkKeywords(final FoValue[] validKeywords, final String possibleKeyword) {
if (validKeywords == null
|| validKeywords.length < 1) {
return null;
@@ -104,7 +104,7 @@
final FoValue value = FoValue.xslValueOf(possibleKeyword);
for (FoValue testValue : validKeywords) {
if (testValue.equals(value)) {
- return FoPropertyKeyword.getPropertyKeyword(value);
+ return PvKeywordFo.getPropertyKeyword(value);
}
}
return null;
@@ -136,10 +136,10 @@
return null;
}
final PvKeyword genericKeyword = value.evalKeyword();
- if (! (genericKeyword instanceof FoPropertyKeyword)) {
+ if (! (genericKeyword instanceof PvKeywordFo)) {
return null;
}
- final FoPropertyKeyword keyword = (FoPropertyKeyword) genericKeyword;
+ final PvKeywordFo keyword = (PvKeywordFo) genericKeyword;
final FoValue keywordValue = keyword.getValue();
return keywordValue;
}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -1,84 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.fo;
-
-import org.foray.fotree.value.PvKeyword;
-
-/**
- * Class encapsulating those property values that are expressed as keywords
- * (e.g. "inherit", "auto", "true", etc.).
- * Instances of this class are immutable and are therefore treated as a group
- * of singletons, one for each possible keyword value.
- */
-public final class FoPropertyKeyword extends PvKeyword {
-
- /** Array of the possible keyword values. */
- private static FoPropertyKeyword[] keywords = new FoPropertyKeyword[
- FoValue.values().length];
-
- /** The encapsulated keyword enumeration. */
- private FoValue value;
-
- /**
- * Private constructor. Use {@link #getPropertyKeyword(FoValue)} to obtain an instance of this class.
- * @param value The keyword enumeration value to encapsulate in this object.
- */
- private FoPropertyKeyword(final FoValue value) {
- this.value = value;
- }
-
- /**
- * Return the keyword enumeration.
- * @return The keyword enumeration.
- * @see FoValue and following for the property keyword enumerations.
- */
- public FoValue getValue() {
- return this.value;
- }
-
- /**
- * Gets or creates the singleton instance for the specific keyword value.
- * There is no need for multiple instances of this class for the same
- * keyword.
- * @param value The value for which the singleton instance is needed.
- * @return The singleton keyword instance, or null if the value is an
- * invalid keyword index.
- */
- public static FoPropertyKeyword getPropertyKeyword(final FoValue value) {
- if (value == null) {
- return null;
- }
- final int ordinal = value.ordinal();
- if (FoPropertyKeyword.keywords[ordinal] == null) {
- FoPropertyKeyword.keywords[ordinal] = new FoPropertyKeyword(value);
- }
- return FoPropertyKeyword.keywords[ordinal];
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java (from rev 12923, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.fo;
+
+import org.foray.fotree.value.PvKeyword;
+
+/**
+ * Class encapsulating those property values that are expressed as keywords
+ * (e.g. "inherit", "auto", "true", etc.).
+ * Instances of this class are immutable and are therefore treated as a group
+ * of singletons, one for each possible keyword value.
+ */
+public final class PvKeywordFo extends PvKeyword {
+
+ /** Array of the possible keyword values. */
+ private static PvKeywordFo[] keywords = new PvKeywordFo[
+ FoValue.values().length];
+
+ /** The encapsulated keyword enumeration. */
+ private FoValue value;
+
+ /**
+ * Private constructor. Use {@link #getPropertyKeyword(FoValue)} to obtain an instance of this class.
+ * @param value The keyword enumeration value to encapsulate in this object.
+ */
+ private PvKeywordFo(final FoValue value) {
+ this.value = value;
+ }
+
+ /**
+ * Return the keyword enumeration.
+ * @return The keyword enumeration.
+ * @see FoValue and following for the property keyword enumerations.
+ */
+ public FoValue getValue() {
+ return this.value;
+ }
+
+ /**
+ * Gets or creates the singleton instance for the specific keyword value.
+ * There is no need for multiple instances of this class for the same
+ * keyword.
+ * @param value The value for which the singleton instance is needed.
+ * @return The singleton keyword instance, or null if the value is an
+ * invalid keyword index.
+ */
+ public static PvKeywordFo getPropertyKeyword(final FoValue value) {
+ if (value == null) {
+ return null;
+ }
+ final int ordinal = value.ordinal();
+ if (PvKeywordFo.keywords[ordinal] == null) {
+ PvKeywordFo.keywords[ordinal] = new PvKeywordFo(value);
+ }
+ return PvKeywordFo.keywords[ordinal];
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAllowedAxisScale.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAllowedAxisScale.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAllowedAxisScale.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -31,8 +31,8 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.ValueCollection;
import org.foray.primitive.sequence.FloatArray;
@@ -133,7 +133,7 @@
* @return The value of this property.
*/
public FloatSequence traitValue(final FoObj fobj) {
- if (this.value == FoPropertyKeyword.getPropertyKeyword(
+ if (this.value == PvKeywordFo.getPropertyKeyword(
FoValue.INHERIT)) {
return PdAllowedWidthScale.traitValueNoInstance(fobj);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtColor;
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.PvShorthandSubproperties;
@@ -115,13 +115,13 @@
// Check style first, since it only has keywords
if (Property.keywordInSet(value, AbstractBorderStyle.VALID_KEYWORDS)) {
- return new PdBorderStyle(FoPropertyKeyword.getPropertyKeyword(
+ return new PdBorderStyle(PvKeywordFo.getPropertyKeyword(
value));
}
// Now check the width keywords
if (Property.keywordInSet(value, AbstractBorderWidth.VALID_KEYWORDS)) {
- return new PdBorderWidth(FoPropertyKeyword.getPropertyKeyword(
+ return new PdBorderWidth(PvKeywordFo.getPropertyKeyword(
value));
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -33,8 +33,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtBorderWidth;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtLengthConditional;
@@ -161,7 +161,7 @@
*/
private int getKeywordValue(final FoContext context,
final RelativeCompass direction, final FoObj fobj) {
- final FoPropertyKeyword kw = (FoPropertyKeyword) value();
+ final PvKeywordFo kw = (PvKeywordFo) value();
switch (kw.getValue()) {
case THIN: {
return DtBorderWidth.BORDER_WIDTH_THIN;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPadding.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtLengthConditional;
import org.foray.fotree.value.PropertyValue;
@@ -149,7 +149,7 @@
* @return The value of this property.
*/
private int getKeywordValue(final FoContext context, final FoObj fobj) {
- final FoPropertyKeyword kw = (FoPropertyKeyword) value();
+ final PvKeywordFo kw = (PvKeywordFo) value();
final FoObj effectiveParent = fobj.effectiveParent(context);
switch (kw.getValue()) {
case INHERIT: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtAngle;
import org.foray.fotree.value.PropertyValue;
@@ -157,7 +157,7 @@
PropertyValue pv = checkKeywords(this.getValidKeywords(),
remainingValue);
if (pv != null) {
- final FoValue keyword = ((FoPropertyKeyword) pv).getValue();
+ final FoValue keyword = ((PvKeywordFo) pv).getValue();
switch (keyword) {
case LEFTWARDS:
case RIGHTWARDS:
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -33,8 +33,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
@@ -112,7 +112,7 @@
if (Property.keywordInSet(keyword,
PdBackgroundPositionHorizontal.VALID_KEYWORDS)
&& keyword != FoValue.INHERIT) {
- pv = FoPropertyKeyword.getPropertyKeyword(keyword);
+ pv = PvKeywordFo.getPropertyKeyword(keyword);
}
}
if (pv == null) {
@@ -120,7 +120,7 @@
if (Property.keywordInSet(keyword,
PdBackgroundPositionVertical.VALID_KEYWORDS)
&& keyword != FoValue.INHERIT) {
- pv = FoPropertyKeyword.getPropertyKeyword(keyword);
+ pv = PvKeywordFo.getPropertyKeyword(keyword);
}
}
if (pv != null) {
@@ -153,8 +153,8 @@
}
}
// The two keywords need to be from each of the two sets.
- final FoValue keyword = ((FoPropertyKeyword) pv).getValue();
- final FoValue keyword2 = ((FoPropertyKeyword) pv2).getValue();
+ final FoValue keyword = ((PvKeywordFo) pv).getValue();
+ final FoValue keyword2 = ((PvKeywordFo) pv2).getValue();
if (keywordInSet(keyword, PdBackgroundPositionHorizontal.VALID_KEYWORDS)
&& keywordInSet(keyword2,
PdBackgroundPositionVertical.VALID_KEYWORDS)) {
@@ -302,8 +302,8 @@
}
}
/* What is left here should just be keywords. */
- final FoValue keyword = ((FoPropertyKeyword) pv).getValue();
- final FoValue keyword2 = ((FoPropertyKeyword) pv2).getValue();
+ final FoValue keyword = ((PvKeywordFo) pv).getValue();
+ final FoValue keyword2 = ((PvKeywordFo) pv2).getValue();
boolean horizontalFirst = false;
if (keywordInSet(keyword,
PdBackgroundPositionHorizontal.VALID_KEYWORDS)) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderCollapse.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -31,8 +31,8 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
@@ -96,7 +96,7 @@
*/
public FoValue getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
- final FoValue keyword = ((FoPropertyKeyword) value()).getValue();
+ final FoValue keyword = ((PvKeywordFo) value()).getValue();
if (keyword == FoValue.INHERIT) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderSeparation.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -33,8 +33,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtLengthBpIpDirection;
import org.foray.fotree.value.PropertyValue;
@@ -124,7 +124,7 @@
public int getValue(final FoContext context, final RelativeAxis axis,
final FoObj fobj) {
if (value().canEvalKeyword()) {
- final FoValue keyword = ((FoPropertyKeyword) value()).getValue();
+ final FoValue keyword = ((PvKeywordFo) value()).getValue();
if (keyword == FoValue.INHERIT) {
return getValueNoInstance(context, axis, fobj);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -33,8 +33,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtBorderWidth;
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.PvShorthandSubproperties;
@@ -151,7 +151,7 @@
return this.convertValueToLength(value, fobj, context);
}
if (value.canEvalKeyword()) {
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ final PvKeywordFo keyword = (PvKeywordFo) value;
final FoValue keywordValue = keyword.getValue();
switch (keywordValue) {
case THIN: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.parse.PropertyParser;
import org.foray.fotree.value.FnAbstractNamedProperty;
import org.foray.fotree.value.PropertyValue;
@@ -113,7 +113,7 @@
* @param attributeValue The unparsed property value.
*/
private PdDominantBaseline(final FoValue attributeValue) {
- this.value = FoPropertyKeyword.getPropertyKeyword(attributeValue);
+ this.value = PvKeywordFo.getPropertyKeyword(attributeValue);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -32,8 +32,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.parse.PropertyParser;
import org.foray.fotree.value.FnAbstractNamedProperty;
import org.foray.fotree.value.PropertyValue;
@@ -99,7 +99,7 @@
* @param keyword The keyword property value for this instance.
*/
private PdFontStretch(final FoValue keyword) {
- this.value = FoPropertyKeyword.getPropertyKeyword(keyword);
+ this.value = PvKeywordFo.getPropertyKeyword(keyword);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -31,8 +31,8 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
@@ -96,7 +96,7 @@
*/
public FoValue getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
- final FoValue keyword = ((FoPropertyKeyword) value()).getValue();
+ final FoValue keyword = ((PvKeywordFo) value()).getValue();
if (keyword == FoValue.INHERIT) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLetterSpacing.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -35,8 +35,8 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.DtInteger;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtSpace;
@@ -141,7 +141,7 @@
return this.convertValueToLength(value(), fobj, context);
}
if (value().canEvalKeyword()) {
- final FoValue keyword = ((FoPropertyKeyword) value()).getValue();
+ final FoValue keyword = ((PvKeywordFo) value()).getValue();
switch (keyword) {
case INHERIT: {
return getValueNoInstance(context, subProperty, fobj);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Datatype.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Datatype.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/Datatype.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -28,8 +28,8 @@
package org.foray.fotree.value;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
/**
@@ -48,10 +48,10 @@
return null;
}
final PvKeyword genericKeyword = value.evalKeyword();
- if (! (genericKeyword instanceof FoPropertyKeyword)) {
+ if (! (genericKeyword instanceof PvKeywordFo)) {
return null;
}
- final FoPropertyKeyword keyword = (FoPropertyKeyword) genericKeyword;
+ final PvKeywordFo keyword = (PvKeywordFo) genericKeyword;
final FoValue keywordValue = keyword.getValue();
return keywordValue;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtRectangle.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -30,8 +30,8 @@
import org.foray.fotree.PropertyException;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import java.awt.Rectangle;
import java.awt.Shape;
@@ -91,8 +91,8 @@
* @return True if and only if the offset is valid.
*/
private boolean validOffset(final PropertyValue pv) {
- if (pv instanceof FoPropertyKeyword) {
- final FoValue keyword = ((FoPropertyKeyword) pv).getValue();
+ if (pv instanceof PvKeywordFo) {
+ final FoValue keyword = ((PvKeywordFo) pv).getValue();
if (keyword == FoValue.AUTO) {
return true;
}
@@ -153,8 +153,8 @@
*/
private int getOffset(final PropertyValue pv, final int pointSize,
final int percentBase) {
- if (pv instanceof FoPropertyKeyword) {
- final FoValue keyword = ((FoPropertyKeyword) pv).getValue();
+ if (pv instanceof PvKeywordFo) {
+ final FoValue keyword = ((PvKeywordFo) pv).getValue();
if (keyword == FoValue.AUTO) {
return 0;
}
@@ -193,7 +193,7 @@
while (st.hasMoreTokens()) {
final String token = st.nextToken();
if (token.equals("inherit")) {
- pvArray[pvIndex] = FoPropertyKeyword.getPropertyKeyword(
+ pvArray[pvIndex] = PvKeywordFo.getPropertyKeyword(
FoValue.INHERIT);
}
final DtLength length = DtLength.procureInstance(token);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtSpace.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -30,8 +30,8 @@
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.axsl.value.Conditionality;
@@ -284,8 +284,8 @@
public boolean addComponent(final String subPropertyName,
final PropertyValue value) throws PropertyException {
if ("conditionality".equals(subPropertyName)) {
- if (value instanceof FoPropertyKeyword) {
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ if (value instanceof PvKeywordFo) {
+ final PvKeywordFo keyword = (PvKeywordFo) value;
final FoValue foValue = keyword.getValue();
this.setConditionality(foValue);
return true;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/AbstractXmlProperty.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -31,8 +31,8 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.parse.PropertyParser;
import org.foray.fotree.value.PropertyValue;
@@ -73,7 +73,7 @@
* @return If {@code possibleKeyword} is found in the validKeywords,
* return an appropriate property value instance, otherwise returns null.
*/
- protected FoPropertyKeyword checkKeywords(final FoValue[] validKeywords,
+ protected PvKeywordFo checkKeywords(final FoValue[] validKeywords,
final String possibleKeyword) {
if (validKeywords == null
|| validKeywords.length < 1) {
@@ -82,7 +82,7 @@
final FoValue value = FoValue.xslValueOf(possibleKeyword);
for (FoValue testValue : validKeywords) {
if (testValue.equals(value)) {
- return FoPropertyKeyword.getPropertyKeyword(value);
+ return PvKeywordFo.getPropertyKeyword(value);
}
}
return null;
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/AbstractBorderWidthTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/AbstractBorderWidthTests.java 2023-01-02 14:48:23 UTC (rev 13002)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/AbstractBorderWidthTests.java 2023-01-02 15:07:30 UTC (rev 13003)
@@ -31,8 +31,8 @@
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
-import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
+import org.foray.fotree.fo.PvKeywordFo;
import org.foray.fotree.value.PropertyValue;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -82,8 +82,8 @@
public void testThin() throws PropertyException {
final AbstractBorderWidth property = createProperty("thin");
final PropertyValue value = property.value();
- assertTrue(value instanceof FoPropertyKeyword);
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ assertTrue(value instanceof PvKeywordFo);
+ final PvKeywordFo keyword = (PvKeywordFo) value;
assertEquals(FoValue.THIN, keyword.getValue());
}
@@ -95,8 +95,8 @@
public void testThick() throws PropertyException {
final AbstractBorderWidth property = createProperty("thick");
final PropertyValue value = property.value();
- assertTrue(value instanceof FoPropertyKeyword);
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ assertTrue(value instanceof PvKeywordFo);
+ final PvKeywordFo keyword = (PvKeywordFo) value;
assertEquals(FoValue.THICK, keyword.getValue());
}
@@ -108,8 +108,8 @@
public void testMedium() throws PropertyException {
final AbstractBorderWidth property = createProperty("medium");
final PropertyValue value = property.value();
- assertTrue(value instanceof FoPropertyKeyword);
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ assertTrue(value instanceof PvKeywordFo);
+ final PvKeywordFo keyword = (PvKeywordFo) value;
assertEquals(FoValue.MEDIUM, keyword.getValue());
}
@@ -121,8 +121,8 @@
public void testInherit() throws PropertyException {
final AbstractBorderWidth property = createProperty("inherit");
final PropertyValue value = property.value();
- assertTrue(value instanceof FoPropertyKeyword);
- final FoPropertyKeyword keyword = (FoPropertyKeyword) value;
+ assertTrue(value instanceof PvKeywordFo);
+ final PvKeywordFo keyword = (PvKeywordFo) value;
assertEquals(FoValue.INHERIT, keyword.getValue());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-02 14:48:26
|
Revision: 13002
http://sourceforge.net/p/foray/code/13002
Author: victormote
Date: 2023-01-02 14:48:23 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Rename PropertyCollection to PvShorthandSubproperties, for clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java
Removed Paths:
-------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBorder.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtColor;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.value.AbsoluteCompass;
@@ -72,7 +72,7 @@
* @throws PropertyException For an invalid property value.
*/
private PropertyValue createPropertyValue(final String value) throws PropertyException {
- PropertyCollection collection = null;
+ PvShorthandSubproperties collection = null;
/*
* Must handle inherit specially, because it essentially propogates
* to style, width, and color.
@@ -81,7 +81,7 @@
final PdBorderStyle borderStyle = new PdBorderStyle("inherit");
final PdBorderWidth borderWidth = new PdBorderWidth("inherit");
final PdBorderColor borderColor = new PdBorderColor("inherit");
- collection = new PropertyCollection();
+ collection = new PvShorthandSubproperties();
collection.addItem(borderStyle);
collection.addItem(borderWidth);
collection.addItem(borderColor);
@@ -94,7 +94,7 @@
throw unexpectedValue(value);
}
if (collection == null) {
- collection = new PropertyCollection();
+ collection = new PvShorthandSubproperties();
}
collection.addItem(property);
}
@@ -146,10 +146,10 @@
* @return The border-style component of this compound property.
*/
public AbstractBorderStyle getBorderStyle() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_STYLE);
if (property instanceof AbstractBorderStyle) {
@@ -163,10 +163,10 @@
* @return The border-width component of this compound property.
*/
public AbstractBorderWidth getBorderWidth() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_WIDTH);
if (property instanceof AbstractBorderWidth) {
@@ -180,10 +180,10 @@
* @return The border-color component of this compound property.
*/
public AbstractBorderColor getBorderColor() {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final Property property = collection.findProperty(
FoPropertyId.BORDER_COLOR);
if (property instanceof AbstractBorderColor) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractCue.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtUri;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
@@ -108,7 +108,7 @@
if (st.countTokens() != 1 && st.countTokens() != 2) {
throw unexpectedValue(value);
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
while (st.hasMoreTokens()) {
final PropertyValue pv = createPropertyValue(st.nextToken());
final PdCue cueProperty = new PdCue(pv);
@@ -169,10 +169,10 @@
* @return The value of this property.
*/
public URL getShorthandValue(final FoContext context, final FoObj fobj, final FoPropertyId propertyType) {
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return null;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
int index = -1;
switch (propertyType) {
case CUE_BEFORE: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractPause.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -36,8 +36,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.DtTime;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
@@ -111,7 +111,7 @@
if (pv != null) {
return pv;
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() < 1 || st.countTokens() > 2) {
throw unexpectedValue(value);
@@ -219,10 +219,10 @@
}
}
}
- if (! (value() instanceof PropertyCollection)) {
+ if (! (value() instanceof PvShorthandSubproperties)) {
return 0;
}
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
int index = -1;
switch (propertyType) {
case PAUSE_BEFORE: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackground.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -37,8 +37,8 @@
import org.foray.fotree.value.DtColor;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import java.util.ArrayList;
import java.util.List;
@@ -79,7 +79,7 @@
*/
private PropertyValue createPropertyValue(final String propertyFullName, final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdBackgroundColor(pv));
@@ -228,7 +228,7 @@
* @return The background-color component of this compound property.
*/
public PdBackgroundColor getColor() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundColor) collection.findProperty(
FoPropertyId.BACKGROUND_COLOR);
}
@@ -238,7 +238,7 @@
* @return The background-image component of this compound property.
*/
public PdBackgroundImage getImage() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundImage) collection.findProperty(
FoPropertyId.BACKGROUND_IMAGE);
}
@@ -248,7 +248,7 @@
* @return The background-repeat component of this compound property.
*/
public PdBackgroundRepeat getRepeat() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundRepeat) collection.findProperty(
FoPropertyId.BACKGROUND_REPEAT);
}
@@ -258,7 +258,7 @@
* @return The background-attachment component of this compound property.
*/
public PdBackgroundAttachment getAttachment() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundAttachment) collection.findProperty(
FoPropertyId.BACKGROUND_ATTACHMENT);
}
@@ -268,7 +268,7 @@
* @return The background-position component of this compound property.
*/
public PdBackgroundPosition getPosition() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdBackgroundPosition) collection.findProperty(
FoPropertyId.BACKGROUND_POSITION);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -37,8 +37,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
@@ -89,7 +89,7 @@
* @throws PropertyException For an invalid property value.
*/
private PropertyValue createShorthandValue(final String value) throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
final PdBackgroundPosition property =
@@ -249,7 +249,7 @@
public int getShorthandValue(final FoContext context, final FoObj fobj,
final AbsoluteAxis axis, final int paddingRectangleDimension,
final int backgroundImageDimension) {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
final PdBackgroundPosition bpProperty =
(PdBackgroundPosition) collection
.getItem(0);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderColor.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -33,8 +33,8 @@
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -154,7 +154,7 @@
private Color getCollectionValue(final RelativeCompass direction,
final FoObj fobj, final FoContext context) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue insideProperty = collection.getItem(whichElement);
return insideProperty.evalColor();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderStyle.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtBorderStyle;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -152,7 +152,7 @@
private org.axsl.value.BorderStyle getCollectionValue(
final FoContext context, final Compass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue insideValue = collection.getItem(whichElement);
final DtBorderStyle borderStyleProperty = (DtBorderStyle)
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBorderWidth.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -36,8 +36,8 @@
import org.foray.fotree.fo.FoPropertyKeyword;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtBorderWidth;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.fotree.FoContext;
@@ -144,7 +144,7 @@
private int getCollectionValue(final FoContext context,
final RelativeCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalLength()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFont.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
import org.foray.fotree.value.DtPercentage;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import java.util.ArrayList;
import java.util.List;
@@ -85,7 +85,7 @@
*/
private PropertyValue createPropertyValue(final String propertyFullName, final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdFontStyle(pv));
@@ -250,7 +250,7 @@
* @return The "font-style" component from this compound property.
*/
public PdFontStyle getStyle() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontStyle) collection.findProperty(FoPropertyId.FONT_STYLE);
}
@@ -259,7 +259,7 @@
* @return The "font-variant" component from this compound property.
*/
public PdFontVariant getVariant() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontVariant) collection.findProperty(
FoPropertyId.FONT_VARIANT);
}
@@ -269,7 +269,7 @@
* @return The "font-weight" component from this compound property.
*/
public PdFontWeight getWeight() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontWeight) collection.findProperty(
FoPropertyId.FONT_WEIGHT);
}
@@ -279,7 +279,7 @@
* @return The "font-size" component from this compound property.
*/
public PdFontSize getSize() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontSize) collection.findProperty(FoPropertyId.FONT_SIZE);
}
@@ -288,7 +288,7 @@
* @return The "line-height" component from this compound property.
*/
public PdLineHeight getLineHeight() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdLineHeight) collection.findProperty(
FoPropertyId.LINE_HEIGHT);
}
@@ -298,7 +298,7 @@
* @return The "font-family" component from this compound property.
*/
public PdFontFamily getFamily() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdFontFamily) collection.findProperty(
FoPropertyId.FONT_FAMILY);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.SimplePageMaster4a;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.constants.NumericConstants;
@@ -126,7 +126,7 @@
private int getCollectionValue(final FoContext context,
final AbsoluteCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalPercentage()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -34,8 +34,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.fo.obj.SimplePageMaster4a;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.value.ValueCollection;
import org.axsl.constants.NumericConstants;
@@ -126,7 +126,7 @@
private int getCollectionValue(final FoContext context,
final AbsoluteCompass direction, final FoObj fobj) {
final ValueCollection collection = (ValueCollection) value();
- final int whichElement = PropertyCollection.whichElementForDirectional(
+ final int whichElement = PvShorthandSubproperties.whichElementForDirectional(
direction, collection.getCount());
final PropertyValue value = collection.getItem(whichElement);
if (value.canEvalPercentage()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSize.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.DtLength;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -93,7 +93,7 @@
if (st.countTokens() < 1 || st.countTokens() > 2) {
throw unexpectedValue(value);
}
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
while (st.hasMoreTokens()) {
final String token = st.nextToken();
final DtLength length = DtLength.procureInstance(token);
@@ -115,9 +115,9 @@
*/
public int getValue(final FoContext context, final FoObj fobj,
final AbsoluteAxis axis) {
- if (value() instanceof PropertyCollection) {
- final PropertyCollection collection =
- (PropertyCollection) value();
+ if (value() instanceof PvShorthandSubproperties) {
+ final PvShorthandSubproperties collection =
+ (PvShorthandSubproperties) value();
if (collection.getCount() < 1) {
return getValueNoInstance(axis);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/package-info.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -27,10 +27,9 @@
*/
/**
- * <p>Classes representing XSL-FO properties (See Section 7 of the XSL-FO 1.0 Standard).</p>
- *
- * <p>The classes in this package that represent concrete FO properties are named with "Pd" at the beginning of the
- * class name, meaning "property description", to distinguish them from the property value enumerations in aXSL.</p>
+ * <p>Classes representing XSL-FO properties.</p>
+ * @see "XSL-FO Recommendation 1.0, Section 7."
+ * @see "XSL-FO Recommendation 1.1, Section 7."
*/
package org.foray.fotree.fo.prop;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/package-info.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -30,6 +30,17 @@
* <p>Classes for parsing and representing the XSL-FO document input objects and properties in the various
* namespaces.</p>
*
+ * <p>Abbreviations used in foray-fotree:</p>
+ * <ul>
+ * <li>Types whose names begin with "Dt" are XSL-FO data types.</li>
+ * <li>Types whose names begin with "Expr" are XSL-FO expressions.</li>
+ * <li>Types whose names begin with "Fn" are XSL-FO functions.</li>
+ * <li>Types whose names begin with "Pv" are property value types.</li>
+ * <li>Types whose names begin with "Pd" are property descriptor types. They serve as conceptual (but not actual)
+ * concrete implementations of property interfaces in aXSL, but are actually helper classes to the property/trait
+ * resolution process whose root is in {@link FoObj}.</li>
+ * </ul>
+ *
* <p>Design considerations:</p>
* <ul>
* <li>The FO Tree faces two directions. First, it faces the incoming document. The guiding document for this process
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -1,213 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.value;
-
-import org.foray.fotree.Property;
-import org.foray.fotree.fo.FoPropertyId;
-
-import org.axsl.value.AbsoluteCompass;
-import org.axsl.value.Compass;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class is odd because it is a <em>PropertyValue</em> subclass that
- * encapsulates one or more <em>Property</em> instances. It is useful for
- * properties like "border-style" which can contain 1, 2, 3 or 4 values,
- * and which must be wrapped up and unwrapped in some orderly way.
- */
-public class PropertyCollection implements PropertyValue {
-
- /** Constant indicating that this collection contains one property. */
- private static final byte SIZE_1 = 1;
-
- /** Constant indicating that this collection contains two properties. */
- private static final byte SIZE_2 = 2;
-
- /** Constant indicating that this collection contains three properties. */
- private static final byte SIZE_3 = 3;
-
- /** Constant indicating that this collection contains four properties. */
- private static final byte SIZE_4 = 4;
-
- /** Constant indicating that the number of properties in this collection
- * does not allow conversion into a specific property value based on a
- * directional constant. */
- private static final byte INDEX_INVALID = -1;
-
- /** Constant indicating that the first (index 0) item in the collection is
- * the one requested. */
- private static final byte INDEX_0 = 0;
-
- /** Constant indicating that the second (index 1) item in the collection is
- * the one requested. */
- private static final byte INDEX_1 = 1;
-
- /** Constant indicating that the third (index 2) item in the collection is
- * the one requested. */
- private static final byte INDEX_2 = 2;
-
- /** Constant indicating that the fourth (index 3) item in the collection is
- * the one requested. */
- private static final byte INDEX_3 = 3;
-
- /**
- * Contains the collection of Properties that are stored in this
- * PropertyValue.
- */
- private List<Property> value = new ArrayList<Property>();
-
- /**
- * Constructor.
- */
- public PropertyCollection() {
- }
-
- /**
- * Add an item to the collection.
- * @param property The property to add to the collection.
- */
- public void addItem(final Property property) {
- this.value.add(property);
- }
-
- /**
- * Returns the list of properties in this collection.
- * @return The list of properties in this collection.
- */
- public List<Property> getValue() {
- return this.value;
- }
-
- /**
- * Returns the number of items in this collection.
- * @return The number of items in this collection.
- */
- public int getCount() {
- return this.value.size();
- }
-
- /**
- * Returns a specific property from the collection.
- * @param index The index to the property needed.
- * @return The property at index.
- */
- public Property getItem(final int index) {
- if (index < 0 || index >= this.value.size()) {
- return null;
- }
- final Object object = this.value.get(index);
- return (Property) object;
- }
-
- /**
- * Determines which of the elements in this PropertyCollection should be
- * used for the given direction that is supplied. From the XSL-FO Standard
- * 1.0, Section 7.29.11:
- *
- * <p>"If there is only one value, it applies to all sides. If there are
- * two values, the top and bottom borders are set to the first value and
- * the right and left are set to the second. If there are three values, the
- * top is set to the first value, the left and right are set to the second,
- * and the bottom is set to the third. If there are four values, they apply
- * to the top, right, bottom, and left, respectively."</p>
- *
- * @param direction One of the integral direction identifiers (e.g.
- * ABSOLUTE_DIR_LEFT).
- * @param size The number of elements that exist in the collection.
- * @return The index (starts at 0) to the appropriate element to use for
- * the direction given.
- */
- public static byte whichElementForDirectional(final Compass direction,
- final int size) {
- switch (size) {
- case PropertyCollection.SIZE_1: {
- return PropertyCollection.INDEX_0;
- }
- case PropertyCollection.SIZE_2: {
- if (direction == AbsoluteCompass.TOP
- || direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.LEFT
- || direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- case PropertyCollection.SIZE_3: {
- if (direction == AbsoluteCompass.TOP) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.LEFT
- || direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- if (direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_2;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- case PropertyCollection.SIZE_4: {
- if (direction == AbsoluteCompass.TOP) {
- return PropertyCollection.INDEX_0;
- }
- if (direction == AbsoluteCompass.RIGHT) {
- return PropertyCollection.INDEX_1;
- }
- if (direction == AbsoluteCompass.BOTTOM) {
- return PropertyCollection.INDEX_2;
- }
- if (direction == AbsoluteCompass.LEFT) {
- return PropertyCollection.INDEX_3;
- }
- return PropertyCollection.INDEX_INVALID;
- }
- }
- return PropertyCollection.INDEX_INVALID;
- }
-
- /**
- * Returns the first occurrence of a Property in the collection that is of
- * the type propertyType.
- * @param propertyType The propertyType which is being sought.
- * @return The first Property matching propertyType, or null if none is
- * found.
- */
- public Property findProperty(final FoPropertyId propertyType) {
- for (Property property : this.value) {
- if (property.getPropertyType() == propertyType) {
- return property;
- }
- }
- return null;
- }
-
-}
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java (from rev 12987, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PropertyCollection.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/PvShorthandSubproperties.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.value;
+
+import org.foray.fotree.Property;
+import org.foray.fotree.fo.FoPropertyId;
+
+import org.axsl.value.AbsoluteCompass;
+import org.axsl.value.Compass;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is odd because it is a <em>PropertyValue</em> subclass that
+ * encapsulates one or more <em>Property</em> instances. It is useful for
+ * properties like "border-style" which can contain 1, 2, 3 or 4 values,
+ * and which must be wrapped up and unwrapped in some orderly way.
+ */
+public class PvShorthandSubproperties implements PropertyValue {
+
+ /** Constant indicating that this collection contains one property. */
+ private static final byte SIZE_1 = 1;
+
+ /** Constant indicating that this collection contains two properties. */
+ private static final byte SIZE_2 = 2;
+
+ /** Constant indicating that this collection contains three properties. */
+ private static final byte SIZE_3 = 3;
+
+ /** Constant indicating that this collection contains four properties. */
+ private static final byte SIZE_4 = 4;
+
+ /** Constant indicating that the number of properties in this collection
+ * does not allow conversion into a specific property value based on a
+ * directional constant. */
+ private static final byte INDEX_INVALID = -1;
+
+ /** Constant indicating that the first (index 0) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_0 = 0;
+
+ /** Constant indicating that the second (index 1) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_1 = 1;
+
+ /** Constant indicating that the third (index 2) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_2 = 2;
+
+ /** Constant indicating that the fourth (index 3) item in the collection is
+ * the one requested. */
+ private static final byte INDEX_3 = 3;
+
+ /**
+ * Contains the collection of Properties that are stored in this
+ * PropertyValue.
+ */
+ private List<Property> value = new ArrayList<Property>();
+
+ /**
+ * Constructor.
+ */
+ public PvShorthandSubproperties() {
+ }
+
+ /**
+ * Add an item to the collection.
+ * @param property The property to add to the collection.
+ */
+ public void addItem(final Property property) {
+ this.value.add(property);
+ }
+
+ /**
+ * Returns the list of properties in this collection.
+ * @return The list of properties in this collection.
+ */
+ public List<Property> getValue() {
+ return this.value;
+ }
+
+ /**
+ * Returns the number of items in this collection.
+ * @return The number of items in this collection.
+ */
+ public int getCount() {
+ return this.value.size();
+ }
+
+ /**
+ * Returns a specific property from the collection.
+ * @param index The index to the property needed.
+ * @return The property at index.
+ */
+ public Property getItem(final int index) {
+ if (index < 0 || index >= this.value.size()) {
+ return null;
+ }
+ final Object object = this.value.get(index);
+ return (Property) object;
+ }
+
+ /**
+ * Determines which of the elements in this PropertyCollection should be
+ * used for the given direction that is supplied. From the XSL-FO Standard
+ * 1.0, Section 7.29.11:
+ *
+ * <p>"If there is only one value, it applies to all sides. If there are
+ * two values, the top and bottom borders are set to the first value and
+ * the right and left are set to the second. If there are three values, the
+ * top is set to the first value, the left and right are set to the second,
+ * and the bottom is set to the third. If there are four values, they apply
+ * to the top, right, bottom, and left, respectively."</p>
+ *
+ * @param direction One of the integral direction identifiers (e.g.
+ * ABSOLUTE_DIR_LEFT).
+ * @param size The number of elements that exist in the collection.
+ * @return The index (starts at 0) to the appropriate element to use for
+ * the direction given.
+ */
+ public static byte whichElementForDirectional(final Compass direction,
+ final int size) {
+ switch (size) {
+ case PvShorthandSubproperties.SIZE_1: {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ case PvShorthandSubproperties.SIZE_2: {
+ if (direction == AbsoluteCompass.TOP
+ || direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.LEFT
+ || direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ case PvShorthandSubproperties.SIZE_3: {
+ if (direction == AbsoluteCompass.TOP) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.LEFT
+ || direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ if (direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_2;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ case PvShorthandSubproperties.SIZE_4: {
+ if (direction == AbsoluteCompass.TOP) {
+ return PvShorthandSubproperties.INDEX_0;
+ }
+ if (direction == AbsoluteCompass.RIGHT) {
+ return PvShorthandSubproperties.INDEX_1;
+ }
+ if (direction == AbsoluteCompass.BOTTOM) {
+ return PvShorthandSubproperties.INDEX_2;
+ }
+ if (direction == AbsoluteCompass.LEFT) {
+ return PvShorthandSubproperties.INDEX_3;
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+ }
+ return PvShorthandSubproperties.INDEX_INVALID;
+ }
+
+ /**
+ * Returns the first occurrence of a Property in the collection that is of
+ * the type propertyType.
+ * @param propertyType The propertyType which is being sought.
+ * @return The first Property matching propertyType, or null if none is
+ * found.
+ */
+ public Property findProperty(final FoPropertyId propertyType) {
+ for (Property property : this.value) {
+ if (property.getPropertyType() == propertyType) {
+ return property;
+ }
+ }
+ return null;
+ }
+
+}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java 2023-01-02 13:16:45 UTC (rev 13001)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/prop/Lang.java 2023-01-02 14:48:23 UTC (rev 13002)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.prop.PdCountry;
import org.foray.fotree.fo.prop.PdLanguage;
import org.foray.fotree.fo.prop.PdScript;
-import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.foray.fotree.value.PvShorthandSubproperties;
import org.foray.fotree.xml.AbstractXmlProperty;
import org.foray.fotree.xml.XmlPropertyId;
@@ -70,7 +70,7 @@
*/
private PropertyValue createPropertyValue(final String value)
throws PropertyException {
- final PropertyCollection collection = new PropertyCollection();
+ final PvShorthandSubproperties collection = new PvShorthandSubproperties();
final PropertyValue pv = checkKeywords(this.getValidKeywords(), value);
if (pv != null) {
collection.addItem(new PdCountry(pv));
@@ -172,7 +172,7 @@
* embedded.
*/
public PdCountry getCountry() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdCountry) collection.findProperty(FoPropertyId.COUNTRY);
}
@@ -182,7 +182,7 @@
* embedded.
*/
public PdLanguage getLanguage() {
- final PropertyCollection collection = (PropertyCollection) value();
+ final PvShorthandSubproperties collection = (PvShorthandSubproperties) value();
return (PdLanguage) collection.findProperty(FoPropertyId.LANGUAGE);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2023-01-02 02:24:27
|
Revision: 13000
http://sourceforge.net/p/foray/code/13000
Author: victormote
Date: 2023-01-02 02:24:24 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
Rename standard property test methods for consistency and clarity.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontFamilyTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NameTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RoleTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/StringTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SwitchToTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TextAlignTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/VoiceFamilyTests.java
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -228,7 +228,7 @@
* @throws PropertyException For errors during parsing.
*/
@Test
- public void testNullInput() throws PropertyException {
+ public void nullInputTest() throws PropertyException {
try {
testNullInputSetup();
fail("Expected PropertyException for invalid keyword.");
@@ -251,7 +251,7 @@
* @throws PropertyException For errors during parsing.
*/
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
try {
testName001Setup();
fail("Expected PropertyException for invalid keyword.");
@@ -268,7 +268,7 @@
* @throws PropertyException For errors during parsing.
*/
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
try {
createProperty("abc xyz");
fail("Expected PropertyException for invalid keyword.");
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontFamilyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontFamilyTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontFamilyTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -57,7 +57,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -67,7 +67,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NameTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NameTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NameTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -40,7 +40,7 @@
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
testName001Setup();
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RoleTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RoleTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RoleTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -57,7 +57,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -67,7 +67,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/StringTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/StringTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/StringTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -45,7 +45,7 @@
*/
@Override
@Test
- public void testNullInput() throws PropertyException {
+ public void nullInputTest() throws PropertyException {
createProperty("");
}
@@ -55,7 +55,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -65,7 +65,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SwitchToTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SwitchToTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SwitchToTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -57,7 +57,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -67,7 +67,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TextAlignTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TextAlignTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TextAlignTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -57,7 +57,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -67,7 +67,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/VoiceFamilyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/VoiceFamilyTests.java 2023-01-02 02:10:45 UTC (rev 12999)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/VoiceFamilyTests.java 2023-01-02 02:24:24 UTC (rev 13000)
@@ -57,7 +57,7 @@
*/
@Override
@Test
- public void testName001() throws PropertyException {
+ public void nameTest001() throws PropertyException {
createProperty("bhxbt");
}
@@ -67,7 +67,7 @@
*/
@Override
@Test
- public void testString001() throws PropertyException {
+ public void stringTest001() throws PropertyException {
createProperty("abc xyz");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|