foray-commit Mailing List for FOray
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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(7) |
2
(8) |
|
3
(10) |
4
|
5
(2) |
6
|
7
(2) |
8
(1) |
9
|
|
10
(5) |
11
(8) |
12
(19) |
13
(8) |
14
(8) |
15
(8) |
16
(7) |
|
17
(12) |
18
(13) |
19
(6) |
20
(11) |
21
(4) |
22
|
23
(6) |
|
24
(1) |
25
(5) |
26
(2) |
27
(5) |
28
(5) |
29
(7) |
30
|
|
31
|
|
|
|
|
|
|
|
From: <vic...@us...> - 2021-01-29 19:11:53
|
Revision: 11882
http://sourceforge.net/p/foray/code/11882
Author: victormote
Date: 2021-01-29 19:11:51 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Fix some font encoding-related problems.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-29 18:17:41 UTC (rev 11881)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-29 19:11:51 UTC (rev 11882)
@@ -274,6 +274,14 @@
private Encoding getBestEncoding(final int codePoint) {
Encoding trialEncoding = null;
final Encoding internalEncoding = this.font.getInternalEncoding();
+ if (internalEncoding.canEncode(codePoint)) {
+ return internalEncoding;
+ }
+
+
+
+
+
if (! (internalEncoding instanceof PsEncoding)) {
/* Cmap4a encodings should be able to handle any character in the
* font's character set. */
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 2021-01-29 18:17:41 UTC (rev 11881)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-29 19:11:51 UTC (rev 11882)
@@ -143,13 +143,10 @@
final String encodingName = this.metricsFile.getEncoding();
PsEncoding encoding = null;
final PsServer psServer = this.getRegisteredFont().getFontServer().getPsServer();
- if (encodingName.equals("StandardEncoding")
- || encodingName.equals("AdobeStandardEncoding")) {
- encoding = psServer.getPredefinedEncoding(PsEncoding.Predefined.WIN_ANSI);
+ final PsEncoding.Predefined predefined = PsEncoding.Predefined.findByName(encodingName);
+ if (predefined != null) {
+ encoding = psServer.getPredefinedEncoding(predefined);
}
- if (getRegisteredFont().getConfiguredFontName().equals("Symbol")) {
- encoding = psServer.getPredefinedEncoding(PsEncoding.Predefined.SYMBOL);
- }
this.setInternalEncoding(encoding);
}
this.setCharSet(this.metricsFile.getCharSet());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 18:17:48
|
Revision: 11881
http://sourceforge.net/p/foray/code/11881
Author: victormote
Date: 2021-01-29 18:17:41 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Another attempt to get svn:keywords automated.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
Property Changed:
----------------
trunk/
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
Index: trunk
===================================================================
--- trunk 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk
___________________________________________________________________
Modified: svn:auto-props
## -1 +1 ##
-* svn:keywords=Author Date Id Rev
+* = svn:keywords=Author Date Id Rev
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11873 $
- * $LastChangedDate: 2021-01-28 10:32:18 -0700 (Thu, 28 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.data;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11871 $
- * $LastChangedDate: 2021-01-28 07:52:03 -0700 (Thu, 28 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.data;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11870 $
- * $LastChangedDate: 2021-01-27 16:21:31 -0700 (Wed, 27 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
package org.foray.common.primitive;
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Index: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-29 18:17:41 UTC (rev 11881)
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java 2021-01-29 17:41:37 UTC (rev 11880)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java 2021-01-29 18:17:41 UTC (rev 11881)
@@ -21,9 +21,9 @@
*/
/*
- * $LastChangedRevision: 11858 $
- * $LastChangedDate: 2021-01-24 14:21:20 -0700 (Sun, 24 Jan 2021) $
- * $LastChangedBy: victormote $
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
*/
/**
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1,4 ##
+Author
+Date
+Id
+Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 17:41:39
|
Revision: 11880
http://sourceforge.net/p/foray/code/11880
Author: victormote
Date: 2021-01-29 17:41:37 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Update Base-14 parsed metrics as they now have glyph bounding boxes included.
Modified Paths:
--------------
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
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)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 17:16:49
|
Revision: 11879
http://sourceforge.net/p/foray/code/11879
Author: victormote
Date: 2021-01-29 17:16:47 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Fix bug in canEncode(int).
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
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 2021-01-29 15:14:39 UTC (rev 11878)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 17:16:47 UTC (rev 11879)
@@ -414,7 +414,7 @@
@Override
public boolean canEncode(final int codePoint) {
- return this.encodeCharacter(codePoint) != 0;
+ return this.encodeCharacter(codePoint) > -1;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 15:14:42
|
Revision: 11878
http://sourceforge.net/p/foray/code/11878
Author: victormote
Date: 2021-01-29 15:14:39 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Add test of encoding vector.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
Added Paths:
-----------
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
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 2021-01-29 14:36:16 UTC (rev 11877)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 15:14:39 UTC (rev 11878)
@@ -109,7 +109,14 @@
for (int index = 0; index < tempCodePoints.length(); index ++) {
final int codePoint = tempCodePoints.intAt(index);
+ if (codePoint < 0
+ || codePoint > Character.MAX_CODE_POINT) {
+ throw new IllegalArgumentException("Code point out out of range: " + codePoint);
+ }
final int codePointIndex = tempCodePointIndexes.intAt(index);
+ if (codePointIndex < 0) {
+ throw new IllegalArgumentException("Code point index out of range: " + codePointIndex);
+ }
if (codePoint > Character.MAX_VALUE) {
codePoints2Builder.append(codePoint);
codePointIndexes2Builder.append((char) codePointIndex);
@@ -132,6 +139,10 @@
@Override
public int encodeCharacter(final int codePoint) {
+ if (codePoint < 0) {
+ return -1;
+ }
+
int index = -1;
if (codePoint > Character.MAX_VALUE) {
index = this.codePoints2.binarySearch(codePoint);
Added: trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java (rev 0)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java 2021-01-29 15:14:39 UTC (rev 11878)
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2021 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.sequence.IntArray;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Tests of {@link EncodingVector4a}.
+ */
+public class EncodingVector4aTests {
+
+ /** A sequence of code points for testing. */
+ private static final IntArray CODE_POINTS_1 = new IntArray(14, Character.MAX_CODE_POINT, 0, 64_000, 28, 14_561);
+
+ /** A sequence of indexes for testing. */
+ private static final IntArray INDEXES_1 = new IntArray(0, 1, 2, 3, 4, 5);
+
+ @Test
+ public void negativeCodePointTest() {
+ final IntArray codePoints = new IntArray(14, 18, -1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, 2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void codePointTooHighTest() {
+ final IntArray codePoints = new IntArray(14, 18, Character.MAX_CODE_POINT + 1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, 2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void negativeIndexTest() {
+ final IntArray codePoints = new IntArray(14, 18, 1, 24, 15);
+ final IntArray indexes = new IntArray(0, 1, -2, 3, 4);
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void quantityMismatchTest() {
+ final IntArray codePoints = new IntArray(14, 18, 1, 24, 15); // 5 elements.
+ final IntArray indexes = new IntArray(0, 1, -2, 3); // 4 elements.
+ try {
+ new EncodingCustom("TestEncoding", null, codePoints, indexes);
+ Assert.fail("Expected Illegal Argument Exception");
+ } catch (final IllegalArgumentException e) {
+ /* This is the expected path. */
+ }
+ }
+
+ @Test
+ public void encodingTest01() {
+ final EncodingVector4a out = new EncodingCustom("Test Encoding", null, CODE_POINTS_1, INDEXES_1);
+
+ /* Test the ones that are in the encoding. */
+ Assert.assertEquals(5, out.encodeCharacter(14_561));
+ Assert.assertEquals(4, out.encodeCharacter(28));
+ Assert.assertEquals(3, out.encodeCharacter(64_000));
+ Assert.assertEquals(2, out.encodeCharacter(0));
+ Assert.assertEquals(1, out.encodeCharacter(Character.MAX_CODE_POINT));
+ Assert.assertEquals(0, out.encodeCharacter(14));
+
+ /* Now test some that aren't. */
+ Assert.assertEquals(-1, out.encodeCharacter(Integer.MIN_VALUE));
+ Assert.assertEquals(-1, out.encodeCharacter(-200));
+ Assert.assertEquals(-1, out.encodeCharacter(-1));
+ Assert.assertEquals(-1, out.encodeCharacter(1));
+ Assert.assertEquals(-1, out.encodeCharacter(200));
+ Assert.assertEquals(-1, out.encodeCharacter(Integer.MAX_VALUE));
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 14:36:19
|
Revision: 11877
http://sourceforge.net/p/foray/code/11877
Author: victormote
Date: 2021-01-29 14:36:16 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Make the codepoint indexes an int sequence instead of char, to handle future changes, and to avoid confusion.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
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 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -30,7 +30,6 @@
import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
@@ -532,7 +531,7 @@
* Array parallel to {@link #internalCodePoints} and containing the
* encoded indexes that correspond to the elements therein.
*/
- private transient CharArrayBuilder internalCodePointIndexes;
+ private transient IntArrayBuilder internalCodePointIndexes;
/** The number of internalCodePoint elements parsed so far. */
private transient int internalCodePointCount = 0;
@@ -1048,7 +1047,7 @@
this.metrics.setGlyphBoundingBoxes(glyphBoundingBoxes);
// 256 is the maximum size needed. The actual encoding may be less.
this.internalCodePoints = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
- this.internalCodePointIndexes = new CharArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
+ this.internalCodePointIndexes = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -247,7 +247,7 @@
@Override
public PsEncoding makeEncodingVector(final String name, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
return new EncodingCustom(name, null, codePoints, codePointIndexes);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -279,7 +278,7 @@
super(Encoding4aLatinExtra.NAME,
GlyphList4a.standardSourceGlyphLists(),
new IntArray(Encoding4aLatinExtra.CODE_POINTS),
- new CharArray(Encoding4aLatinExtra.CODE_POINT_INDEXES));
+ new IntArray(Encoding4aLatinExtra.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -948,7 +947,7 @@
super(PsEncoding.Predefined.CE.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingCe.CODE_POINTS),
- new CharArray(EncodingCe.CODE_POINT_INDEXES));
+ new IntArray(EncodingCe.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -57,7 +57,7 @@
* {@code codePoints[n]}.
*/
public EncodingCustom(final String name, final List<GlyphList> sourceGlyphLists, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
super(name, sourceGlyphLists, codePoints, codePointIndexes);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -747,7 +746,7 @@
super(PsEncoding.Predefined.EXPERT.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingExpert.CODE_POINTS),
- new CharArray(EncodingExpert.CODE_POINT_INDEXES));
+ new IntArray(EncodingExpert.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -432,7 +431,7 @@
super(PsEncoding.Predefined.EXPERT_SUBSET.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingExpertSubset.CODE_POINTS),
- new CharArray(EncodingExpertSubset.CODE_POINT_INDEXES));
+ new IntArray(EncodingExpertSubset.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -887,7 +886,7 @@
super(PsEncoding.Predefined.ISO_LATIN_1.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingIsoLatin1.CODE_POINTS),
- new CharArray(EncodingIsoLatin1.CODE_POINT_INDEXES));
+ new IntArray(EncodingIsoLatin1.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -747,7 +746,7 @@
super(PsEncoding.Predefined.MAC_EXPERT.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacExpert.CODE_POINTS),
- new CharArray(EncodingMacExpert.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacExpert.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -915,7 +914,7 @@
super(PsEncoding.Predefined.MAC_ROMAN.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacRoman.CODE_POINTS),
- new CharArray(EncodingMacRoman.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacRoman.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -1126,7 +1125,7 @@
super(PsEncoding.Predefined.STANDARD_MACINTOSH_ORDERING.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingMacStandard.CODE_POINTS),
- new CharArray(EncodingMacStandard.CODE_POINT_INDEXES));
+ new IntArray(EncodingMacStandard.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -31,11 +31,9 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharacterUtils;
import org.foray.common.primitive.StringUtils;
-import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.common.url.UrlFactory;
-import org.axsl.common.sequence.CharSequenceMutable;
import org.axsl.common.sequence.IntSequenceMutable;
import org.axsl.ps.GlyphList;
import org.axsl.ps.PsException;
@@ -157,7 +155,7 @@
private IntArrayBuilder codePoints = new IntArrayBuilder();
/** The parsed encoded indexes. */
- private CharArrayBuilder codePointIndexes = new CharArrayBuilder();
+ private IntArrayBuilder codePointIndexes = new IntArrayBuilder();
/**
* Create a new EncodingParser instance.
@@ -353,11 +351,11 @@
if (codePoint != Character.MAX_VALUE) {
this.codePoints.setIntAt(i, codePoint);
final char glyphIndex = this.glyphIndexes.get(i);
- this.codePointIndexes.setCharAt(i, glyphIndex);
+ this.codePointIndexes.setIntAt(i, glyphIndex);
break;
}
}
- if (this.codePointIndexes.charAt(i) == 0
+ if (this.codePointIndexes.intAt(i) == 0
&& ! glyphName.equals(EncodingVector4a.NOTDEF)) {
throw new PsException("Glyph name not found: " + glyphName);
}
@@ -456,9 +454,9 @@
s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_1, 2);
s = s + "// " + formatArrayIndex(i);
s = padSpaces(s, EncodingParser.CODE_POINTS_COLUMN_2, 2);
- s = s + " glyph: 0x" + StringUtils.charToHexString(this.codePointIndexes.charAt(i), true,
+ s = s + " glyph: 0x" + StringUtils.charToHexString((char) this.codePointIndexes.intAt(i), true,
EncodingParser.HEX_STRING_SIZE);
- s = s + " \\" + StringUtils.charToOctalString(this.codePointIndexes.charAt(i),
+ s = s + " \\" + StringUtils.charToOctalString((char) this.codePointIndexes.intAt(i),
EncodingParser.HEX_STRING_SIZE);
s = s + "\n";
out.write(s.getBytes());
@@ -472,7 +470,7 @@
s = " public static final char[] codePointIndexes = {\n";
out.write(s.getBytes());
for (int i = 0; i < this.codePointIndexes.length(); i++) {
- final char index = this.codePointIndexes.charAt(i);
+ final int index = this.codePointIndexes.intAt(i);
s = " ";
s = s + "0x";
s = s + StringUtils.charToHexString((char) index, true, EncodingParser.HEX_STRING_SIZE);
@@ -523,7 +521,7 @@
* Returns the codepoint indexes.
* @return The codepoint indexes.
*/
- public CharSequenceMutable getCodePointIndexes() {
+ public IntSequenceMutable getCodePointIndexes() {
return this.codePointIndexes;
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -1003,7 +1002,7 @@
super(PsEncoding.Predefined.PDF_DOC.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingPdfDoc.CODE_POINTS),
- new CharArray(EncodingPdfDoc.CODE_POINT_INDEXES));
+ new IntArray(EncodingPdfDoc.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -686,7 +685,7 @@
super(PsEncoding.Predefined.STANDARD.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingStandard.CODE_POINTS),
- new CharArray(EncodingStandard.CODE_POINT_INDEXES));
+ new IntArray(EncodingStandard.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -851,7 +850,7 @@
super(PsEncoding.Predefined.SYMBOL.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingSymbol.CODE_POINTS),
- new CharArray(EncodingSymbol.CODE_POINT_INDEXES));
+ new IntArray(EncodingSymbol.CODE_POINT_INDEXES));
}
/**
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 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -33,7 +33,6 @@
import org.foray.common.sequence.IntArray;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.common.sequence.CharSequenceMutable;
import org.axsl.common.sequence.IntSequence;
import org.axsl.common.sequence.IntSequenceMutable;
import org.axsl.ps.Encoding;
@@ -89,13 +88,13 @@
* {@code codePoints[n]}.
*/
public EncodingVector4a(final String name, final List<GlyphList> sourceGlyphLists, final IntSequence codePoints,
- final CharSequence codePointIndexes) {
+ final IntSequence codePointIndexes) {
this.name = name;
this.sourceGlyphLists = sourceGlyphLists;
/* Get mutable instances. */
final IntSequenceMutable tempCodePoints = IntArrayBuilder.fromIntSequence(codePoints);
- final CharSequenceMutable tempCodePointIndexes = CharArrayBuilder.fromCharSequence(codePointIndexes);
+ final IntSequenceMutable tempCodePointIndexes = IntArrayBuilder.fromIntSequence(codePointIndexes);
if (tempCodePoints.length() != tempCodePointIndexes.length()) {
throw new IllegalArgumentException("codePoints and codePointIndexes must be of the same length.");
@@ -110,20 +109,20 @@
for (int index = 0; index < tempCodePoints.length(); index ++) {
final int codePoint = tempCodePoints.intAt(index);
- final char codePointIndex = tempCodePointIndexes.charAt(index);
+ final int codePointIndex = tempCodePointIndexes.intAt(index);
if (codePoint > Character.MAX_VALUE) {
codePoints2Builder.append(codePoint);
- codePointIndexes2Builder.append(codePointIndex);
+ codePointIndexes2Builder.append((char) codePointIndex);
} else {
codePointsBuilder.append((char) codePoint);
- codePointIndexesBuilder.append(codePointIndex);
+ codePointIndexesBuilder.append((char) codePointIndex);
}
}
- this.codePoints = new CharArray(codePointsBuilder);
- this.codePointIndexes = new CharArray(codePointIndexesBuilder);
- this.codePoints2 = new IntArray(codePoints2Builder);
- this.codePointIndexes2 = new CharArray(codePointIndexes2Builder);
+ this.codePoints = codePointsBuilder.toCharArray();
+ this.codePointIndexes = codePointIndexesBuilder.toCharArray();
+ this.codePoints2 = codePoints2Builder.toIntArray();
+ this.codePointIndexes2 = codePointIndexes2Builder.toCharArray();
}
@Override
@@ -236,7 +235,7 @@
* @param codePoints The array of Unicode code points to be sorted.
* @param codePointIndexes The array of encoding indexes that whose elements correspond to elements in codePoints.
*/
- public void sortCodePoints(final IntSequenceMutable codePoints, final CharSequenceMutable codePointIndexes) {
+ public void sortCodePoints(final IntSequenceMutable codePoints, final IntSequenceMutable codePointIndexes) {
boolean anyChanges = true;
while (anyChanges) {
anyChanges = false;
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.PsEncoding;
@@ -951,7 +950,7 @@
super(PsEncoding.Predefined.WIN_ANSI.getName(),
GlyphList4a.standardSourceGlyphLists(),
new IntArray(EncodingWinAnsi.CODE_POINTS),
- new CharArray(EncodingWinAnsi.CODE_POINT_INDEXES));
+ new IntArray(EncodingWinAnsi.CODE_POINT_INDEXES));
}
/**
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-01-29 12:17:24 UTC (rev 11876)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java 2021-01-29 14:36:16 UTC (rev 11877)
@@ -29,7 +29,6 @@
package org.foray.ps.encode;
-import org.foray.common.sequence.CharArray;
import org.foray.common.sequence.IntArray;
import org.axsl.ps.GlyphList;
@@ -914,7 +913,7 @@
super(PsEncoding.Predefined.ZAPF_DINGBATS.getName(),
EncodingZapfDingbats.GLYPH_LISTS_USED,
new IntArray(EncodingZapfDingbats.CODE_POINTS),
- new CharArray(EncodingZapfDingbats.CODE_POINT_INDEXES));
+ new IntArray(EncodingZapfDingbats.CODE_POINT_INDEXES));
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-29 12:17:27
|
Revision: 11876
http://sourceforge.net/p/foray/code/11876
Author: victormote
Date: 2021-01-29 12:17:24 +0000 (Fri, 29 Jan 2021)
Log Message:
-----------
1. Conform to aXSL change: Add method to return the bounding box for a single glyph. 2. Rewrite TrueTypeFont.convertFunitsToMillipoints & add a test.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.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/SystemFont.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/ttf/TtfMtxEntry.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.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/util/MockFont.java
Added Paths:
-----------
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -73,7 +73,7 @@
* @param bBox The bounding box whose width should be computed.
* @return The width of the bounding box.
*/
- public static float computeWidthAsInt(final BoundingBox bBox) {
+ public static int computeWidthAsInt(final BoundingBox bBox) {
final int urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
final int llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
return urx - llx;
@@ -84,7 +84,7 @@
* @param bBox The bounding box whose width should be computed.
* @return The width of the bounding box.
*/
- public static float computeHeightAsInt(final BoundingBox bBox) {
+ public static int computeHeightAsInt(final BoundingBox bBox) {
final int ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
final int lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
return ury - lly;
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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -440,10 +440,10 @@
/**
* Set the widths for this font.
- * @param width The width array to set.
+ * @param widths The width array to set.
*/
- protected void setWidths(final short[] width) {
- this.width = width;
+ protected void setWidths(final short[] 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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -30,6 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
@@ -263,4 +264,14 @@
return this.getInternalEncoding().encodeCharacter(codePoint);
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ final BoundingBox raw = this.ttf.getHmtxTable().getMtxEntry(glyphIndex).getBoundingBox();
+ final short[] scaled = new short[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ scaled[index] = this.ttf.convertFunitsToMillipoints(raw.getCoordinateAsInt(index));
+ }
+ return new BoundingBoxShort(scaled);
+ }
+
}
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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -29,6 +29,7 @@
package org.foray.font;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.FontParser;
import org.foray.font.format.type1.Type1Font;
@@ -413,4 +414,17 @@
return metricIndex;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ final BoundingBox raw = this.metricsFile.getGlyphBoundingBoxes()[glyphIndex];
+ if (fontSize == WellKnownConstants.MILLIPOINTS_PER_POINT) {
+ return raw;
+ }
+ final float[] scaled = new float[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / WellKnownConstants.MILLIPOINTS_PER_POINT;
+ }
+ return BoundingBoxUtils.makeBoundingBox(scaled);
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -30,6 +30,7 @@
import org.foray.common.Environment;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.FontParser;
import org.foray.font.format.Kerning;
@@ -573,4 +574,10 @@
return 0;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ /* TODO: Not sure what to do here. */
+ return BoundingBoxUtils.ZEROES;
+ }
+
}
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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -50,7 +50,7 @@
* The TrueType spec can be found at the Microsoft
* Typography site: http://www.microsoft.com/truetype/
*/
-public final class TrueTypeFont {
+public class TrueTypeFont {
/** The parent offset table. */
private TtfOffsetTable ttfTableDir = null;
@@ -135,7 +135,7 @@
* Note: To get an instance of TTFFont, use {@link TrueTypeFont#makeTTFFont(TtfOffsetTable)}.
* @param ttfTableDir The table directory from which this font should be created.
*/
- private TrueTypeFont(final TtfOffsetTable ttfTableDir) {
+ TrueTypeFont(final TtfOffsetTable ttfTableDir) {
this.ttfTableDir = ttfTableDir;
}
@@ -298,6 +298,14 @@
}
/**
+ * Package-visible setter, intended for testing.
+ * @param headTable The headTable value to set.
+ */
+ void setHeadTable(final TtfTableHead headTable) {
+ this.headTable = headTable;
+ }
+
+ /**
* Returns the "head" table.
* @return The "head" table.
*/
@@ -503,28 +511,38 @@
}
/**
- * Converts from a TrueType text space unit value to millipoints, based on
- * the "unitsPerEm" field in the "head" table.
- * @param ttfUnit The TrueType text space unit value to be converted.
- * @return The equivalent millipoint value.
+ * Converts a TrueType Funits value to millipoints, based on the "unitsPerEm" field in the "head" table.
+ * Note that no consideration of font size is used here: the returned value is scaled to 1 point.
+ * Multiply the returned value by the font size, in points, to get the number of millipoints scaled to that size.
+ * @param fUnits The TrueType FUnit value to be converted to millipoints.
+ * @return The size, in millipoints, of {@code fUnits} when the font size is 1 point.
+ * @see "https://docs.microsoft.com/en-us/typography/opentype/spec/ttch01#digitizing-a-design"
*/
- short getTTFFunit(final int ttfUnit) {
- final int ret;
- if (ttfUnit < 0) {
- final long rest1 = ttfUnit % this.headTable.unitsPerEm();
- final long storrest = 1000 * rest1;
- final long ledd2 = rest1 / storrest;
- ret = -((-WellKnownConstants.MILLIPOINTS_PER_POINT * ttfUnit)
- / this.headTable.unitsPerEm() - (int) ledd2);
- } else {
- ret = (ttfUnit / this.headTable.unitsPerEm())
- * WellKnownConstants.MILLIPOINTS_PER_POINT
- + ((ttfUnit % this.headTable.unitsPerEm())
- * WellKnownConstants.MILLIPOINTS_PER_POINT)
- / this.headTable.unitsPerEm();
+ public short convertFunitsToMillipoints(final int fUnits) {
+ /* Per the TrueType documentation, the conversion scale is:
+ * pointSize * resolution / ( 72 points per inch * units_per_em )
+ * We are explicitly factoring out the consideration of point size in this method, effectively making the point
+ * size 1. So we are left with:
+ * resolution / ( 72 points per inch * units_per_em )
+ * Since the resolution of the text space that we are computing for is also 72 points per inch, the resolution
+ * in the numerator and that in the denominator cancel each other. We are left then with:
+ * / units_per_em
+ * which makes intuitive sense.
+ */
+
+ /* Use the getter here to facilitate testing with a mock object. */
+ final TtfTableHead headTable = this.getHeadTable();
+ final int unitsPerEm = headTable.unitsPerEm();
+
+ final double result = ((float) fUnits) * WellKnownConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
+ final long roundedResult = Math.round(result);
+ /* This cast from a long to a short looks horrible, but should be safe. The results should almost always be in
+ * the range +/- 1500. Log an error if there is any truncation. */
+ if (roundedResult < Short.MIN_VALUE
+ || roundedResult > Short.MAX_VALUE) {
+ getLogger().error("Glyph space metric outside range of a \"short\", actual: " + roundedResult);
}
-
- return (short) ret;
+ return (short) roundedResult;
}
/**
@@ -651,7 +669,7 @@
* @return The lowercase ascent value for this font.
*/
public int getLowerCaseAscent() {
- return getTTFFunit(getAscender());
+ return convertFunitsToMillipoints(getAscender());
}
/**
@@ -659,7 +677,7 @@
* @return The lowercase descent value for this font.
*/
public int getLowerCaseDescent() {
- return getTTFFunit(getDescender());
+ return convertFunitsToMillipoints(getDescender());
}
/**
@@ -669,7 +687,7 @@
public short[] getWidths() {
final short[] wx = new short[this.hmtxTable.numMtxEntries()];
for (int i = 0; i < wx.length; i++) {
- wx[i] = getTTFFunit(this.hmtxTable.getMtxEntry(i).getWidth());
+ wx[i] = convertFunitsToMillipoints(this.hmtxTable.getMtxEntry(i).getWidth());
}
return wx;
}
@@ -789,7 +807,7 @@
*/
public int strikeoutSize() {
final int dsStrikeoutSize = this.os2Table.getStrikeoutSize();
- final int mpStrikeoutSize = this.getTTFFunit(dsStrikeoutSize);
+ final int mpStrikeoutSize = this.convertFunitsToMillipoints(dsStrikeoutSize);
return mpStrikeoutSize;
}
@@ -799,7 +817,7 @@
*/
public int strikeoutPosition() {
final int dsStrikeoutPosition = this.os2Table.getStrikeoutPosition();
- final int mpStrikeoutPosition = this.getTTFFunit(dsStrikeoutPosition);
+ final int mpStrikeoutPosition = this.convertFunitsToMillipoints(dsStrikeoutPosition);
return mpStrikeoutPosition;
}
@@ -809,7 +827,7 @@
*/
public int underlineSize() {
final int dsUnderlineSize = this.postTable.getUnderlineThickness();
- final int mpUnderlineSize = this.getTTFFunit(dsUnderlineSize);
+ final int mpUnderlineSize = this.convertFunitsToMillipoints(dsUnderlineSize);
return mpUnderlineSize;
}
@@ -819,7 +837,7 @@
*/
public int underlinePosition() {
final int dsUnderlinePosition = this.postTable.getUnderlinePosition();
- final int mpUnderlinePosition = this.getTTFFunit(dsUnderlinePosition);
+ final int mpUnderlinePosition = this.convertFunitsToMillipoints(dsUnderlinePosition);
return mpUnderlinePosition;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -28,12 +28,14 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxUtils;
+
import org.axsl.common.data.BoundingBox;
/**
* A TTF Font Mtx entry.
*/
-class TtfMtxEntry {
+public class TtfMtxEntry {
/** The glyph width. */
private int wx;
@@ -42,7 +44,7 @@
private int lsb;
/** The glyph bounding box. */
- private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox bbox;
/** Obtained from the "loca" table. */
private long offset;
@@ -61,8 +63,7 @@
if (this.bbox == null) {
return 0;
}
- return this.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
- - this.bbox[BoundingBox.LOWER_LEFT_Y_INDEX];
+ return BoundingBoxUtils.computeHeightAsInt(this.bbox);
}
/**
@@ -114,29 +115,19 @@
}
/**
- * Returns a specific bbox value for this entry.
- * @param index The index into the bbox array that is sought.
- * @return The bbox value for {@code index}.
+ * Returns the bounding box for this entry.
+ * @return The bounding box.
*/
- public int getBBoxValue(final int index) {
- if (index < 0
- || index > BoundingBox.QTY_ENTRIES - 1) {
- return Integer.MIN_VALUE;
- }
- return this.bbox[index];
+ public BoundingBox getBoundingBox() {
+ return this.bbox;
}
/**
- * Sets a specific bbox value for this entry.
- * @param index The index into the bbox array that should be set.
- * @param value The new bbox value that should be set.
+ * Sets the bounding box for this entry.
+ * @param boundingBox The new bounding box.
*/
- public void setBBoxValue(final int index, final int value) {
- if (index < 0
- || index > BoundingBox.QTY_ENTRIES - 1) {
- return;
- }
- this.bbox[index] = value;
+ public void setBoundingBox(final BoundingBox boundingBox) {
+ this.bbox = boundingBox;
}
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -28,6 +28,7 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.io.RandomAccessInput;
import org.foray.common.primitive.BitUtils;
@@ -102,15 +103,13 @@
raInput.seek(dirEntry.getOffset()
+ thisMetric.getOffset());
raInput.skipBytes(2);
+ final short[] bboxEntries = new short[BoundingBox.QTY_ENTRIES];
for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = raInput.readShort();
- thisMetric.setBBoxValue(j, bboxValue);
+ bboxEntries[j] = raInput.readShort();
}
+ thisMetric.setBoundingBox(new BoundingBoxShort(bboxEntries));
} else {
- for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = firstMetric.getBBoxValue(j);
- thisMetric.setBBoxValue(j, bboxValue);
- }
+ thisMetric.setBoundingBox(firstMetric.getBoundingBox());
}
}
@@ -122,15 +121,13 @@
|| thisMetric.getOffset() != nextMetric.getOffset()) {
raInput.seek(n + thisMetric.getOffset());
raInput.skipBytes(2);
+ final short[] bboxEntries = new short[BoundingBox.QTY_ENTRIES];
for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = raInput.readShort();
- thisMetric.setBBoxValue(j, bboxValue);
+ bboxEntries[j] = raInput.readShort();
}
+ thisMetric.setBoundingBox(new BoundingBoxShort(bboxEntries));
} else {
- for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
- final int bboxValue = firstMetric.getBBoxValue(0);
- thisMetric.setBBoxValue(j, bboxValue);
- }
+ thisMetric.setBoundingBox(firstMetric.getBoundingBox());
}
}
return glyf;
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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -158,6 +158,9 @@
/** The parsed extent table. */
private short[] extentTable;
+ /** The parsed bounding boxes. */
+ private BoundingBox[] glyphBoundingBoxes;
+
/** The parsed kerning table. */
private Kerning kerning;
@@ -669,6 +672,22 @@
}
/**
+ * Sets the glyph bounding boxes.
+ * @param glyphBoundingBoxes The new glyph bounding boxes.
+ */
+ public void setGlyphBoundingBoxes(final BoundingBox[] glyphBoundingBoxes) {
+ this.glyphBoundingBoxes = glyphBoundingBoxes;
+ }
+
+ /**
+ * Returns the glyph bounding boxes.
+ * @return The glyph bounding boxes.
+ */
+ public BoundingBox[] getGlyphBoundingBoxes() {
+ return this.glyphBoundingBoxes;
+ }
+
+ /**
* Sets the underline thickness.
* @param underlineThickness The underlineThickness to set.
*/
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 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -509,6 +509,9 @@
/** The glyph width parsed from the "WX" token. */
private transient short charWidth = Short.MIN_VALUE;
+ /** The bounding box parsed from the "B" token. */
+ private transient BoundingBox glyphBoundingBox = BoundingBoxUtils.ZEROES;
+
/** If we need to build a CharSet for this font, this array is where the
* characters are accumulated, then later sorted, and eventually is used
* to create the CharSet instance. */
@@ -1041,6 +1044,8 @@
}
final short[] extentTable = new short[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.
this.internalCodePoints = new IntArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
this.internalCodePointIndexes = new CharArrayBuilder(Type1MetricsParserAfm.MAX_CODE_POINTS);
@@ -1207,10 +1212,11 @@
* Process a "B" keyword.
*/
private void b() {
- /* Ignore bounding box for now. */
+ final float[] entries = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- burnToken();
+ entries[i] = getFloat();
}
+ this.glyphBoundingBox = BoundingBoxUtils.makeBoundingBox(entries);
}
/**
@@ -1395,16 +1401,6 @@
}
/**
- * "Burns" the current token by ignoring it and advaning to the next one.
- */
- private void burnToken() {
- if (! this.currentTokenizer.hasMoreTokens()) {
- return;
- }
- this.currentTokenizer.nextToken();
- }
-
- /**
* Indicates whether the current key makes sense with the current context.
* @return True if the context matches the current key.
*/
@@ -1470,6 +1466,7 @@
+ this.currentLineNumber);
}
extentTable[charIndex] = this.charWidth;
+ this.metrics.getGlyphBoundingBoxes()[charIndex] = this.glyphBoundingBox;
if (this.glyphIndex > -1) {
/* Accumulate the information needed to create the internal
* Encoding. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-28 21:12:30 UTC (rev 11875)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -271,4 +271,10 @@
return 0;
}
+ @Override
+ public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Added: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java (rev 0)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontTests.java 2021-01-29 12:17:24 UTC (rev 11876)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 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.format.ttf;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+/**
+ * Tests of {@link TrueTypeFont}.
+ */
+public class TrueTypeFontTests {
+
+ /**
+ * Test of {@link TrueTypeFont#convertFunitsToMillipoints(int)}.
+ * This test loosely based on example given in the Microsoft TrueType documention.
+ * @see "https://docs.microsoft.com/en-us/typography/opentype/spec/ttch01#scaling-a-glyph"
+ */
+ @Test
+ public void convertFunitsToMillipointsTest01() {
+
+ /* From the documentation: "For example, assume that a glyph feature is 550 FUnits in length on a 72 dpi screen
+ * at 18 point. There are 2048 units per em. The following calculation reveals that the feature is 4.83 pixels
+ * long." We are not converting to pixels, but to a more abstract calculation of millipoints. Nevertheless, we
+ * will use this example in this test. */
+
+ final TtfTableHead headTable = Mockito.mock(TtfTableHead.class);
+ Mockito.when(headTable.unitsPerEm()).thenReturn(2048);
+
+ final TrueTypeFont out = new TrueTypeFont(null);
+ out.setHeadTable(headTable);
+
+ short actual = out.convertFunitsToMillipoints(550);
+ /* 550 * 1000 / 2048 = 268.5546875. */
+ Assert.assertEquals(269, actual);
+
+ /* Check the same value as a negative. */
+ actual = out.convertFunitsToMillipoints(-550);
+ Assert.assertEquals(-269, actual);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 21:12:33
|
Revision: 11875
http://sourceforge.net/p/foray/code/11875
Author: victormote
Date: 2021-01-28 21:12:30 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Change some array return values to sequences.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.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 2021-01-28 18:58:50 UTC (rev 11874)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-01-28 21:12:30 UTC (rev 11875)
@@ -270,31 +270,18 @@
}
@Override
- public int[] unavailableChars(final CharSequence charSequence,
- final int beginIndex) {
- int count = 0;
- /* Count them first. */
+ public IntSequence unavailableChars(final CharSequence charSequence, final int beginIndex) {
+ IntArrayBuilder builder = null;
for (int i = 0; i < charSequence.length(); i++) {
final char c = charSequence.charAt(i);
if (! glyphAvailable(c)) {
- count++;
+ if (builder == null) {
+ builder = new IntArrayBuilder();
+ }
+ builder.append(i);
}
}
- if (count < 1) {
- return null;
- }
- /* Create empty array. */
- final int[] returnArray = new int[count];
- /* Read through them again, completing the array. */
- count = 0;
- for (int i = 0; i < charSequence.length(); i++) {
- final char c = charSequence.charAt(i);
- if (! glyphAvailable(c)) {
- returnArray[count] = i;
- count++;
- }
- }
- return returnArray;
+ return builder;
}
@Override
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java 2021-01-28 18:58:50 UTC (rev 11874)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/Word4a.java 2021-01-28 21:12:30 UTC (rev 11875)
@@ -37,6 +37,7 @@
import org.axsl.common.para.ParaConfig;
import org.axsl.common.para.ParaLeaf;
import org.axsl.common.para.ParaNode;
+import org.axsl.common.sequence.ByteSequence;
import org.axsl.hyphen.Word;
import org.axsl.hyphen.WordSegment;
@@ -166,7 +167,7 @@
}
@Override
- public int[] getHeinousPoints() {
+ public ByteSequence getHeinousPoints() {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 18:58:54
|
Revision: 11874
http://sourceforge.net/p/foray/code/11874
Author: victormote
Date: 2021-01-28 18:58:50 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
1. Add BoundingBox implementation that uses short. Add factory method that picks the most compact BoundingBox implementation.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.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/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/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -39,9 +39,6 @@
*/
public class BoundingBoxFloat implements BoundingBox, Serializable {
- /** An bounding box whose values are all zero, useful for initializing. */
- public static final BoundingBoxFloat ZEROES = new BoundingBoxFloat(0, 0, 0, 0);
-
/** Constant needed for serialization. */
private static final long serialVersionUID = 1176678668590516253L;
Added: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -0,0 +1,114 @@
+/*
+ * 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: 11873 $
+ * $LastChangedDate: 2021-01-28 10:32:18 -0700 (Thu, 28 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+import java.io.Serializable;
+
+/**
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
+ */
+public class BoundingBoxShort implements BoundingBox, Serializable {
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = -1721304270800103728L;
+
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+
+ /** The lower-left X value. */
+ private short llx;
+
+ /** The lower-left Y value. */
+ private short lly;
+
+ /** The upper-right X value. */
+ private short urx;
+
+ /** The upper-right Y value. */
+ private short ury;
+
+ /**
+ * Constructor.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ */
+ public BoundingBoxShort(final int lowerLeftX, final int lowerLeftY, final int upperRightX, final int upperRightY) {
+ this.llx = (short) lowerLeftX;
+ this.lly = (short) lowerLeftY;
+ this.urx = (short) upperRightX;
+ this.ury = (short) upperRightY;
+ }
+
+ /**
+ * Constructor for a pre-existing array.
+ * @param array The array containing the bounds.
+ * This array must have exactly four elements.
+ */
+ public BoundingBoxShort(final short[] array) {
+ if (array.length != BoundingBox.QTY_ENTRIES) {
+ throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
+ }
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
+ }
+
+ @Override
+ public float getCoordinateAsFloat(final int index) {
+ return getCoordinateAsShort(index);
+ }
+
+ @Override
+ public int getCoordinateAsInt(final int index) {
+ return getCoordinateAsShort(index);
+ }
+
+ @Override
+ public short getCoordinateAsShort(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
+ }
+
+ @Override
+ public Class<? extends Number> getNativeType() {
+ return Short.TYPE;
+ }
+
+}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,6 +28,8 @@
package org.foray.common.data;
+import org.foray.common.primitive.FloatUtils;
+
import org.axsl.common.data.BoundingBox;
/**
@@ -35,6 +37,9 @@
*/
public final class BoundingBoxUtils {
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBoxShort ZEROES = new BoundingBoxShort((short) 0, (short) 0, (short) 0, (short) 0);
+
/**
* Private constructor.
* This is a utility class, and should never be instantiated.
@@ -115,4 +120,55 @@
return true;
}
+ /**
+ * Factory method that creates an instance of the best {@link BoundingBox} implementation for a given set of
+ * coordinates.
+ * This is useful in cases where the expected values may not conform to a set of criteria needed for a specific
+ * implementation.
+ * @param array The array containing the coordinates.
+ * @return A {@link BoundingBox} instance that stores the coordinates most efficiently.
+ */
+ public static BoundingBox makeBoundingBox(final float[] array) {
+ /* Our most compact implementation is {@link BoundingBoxShort}, so we attempt that first. */
+ boolean isShortOk = true;
+ final short[] shorts = new short[BoundingBox.QTY_ENTRIES];
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float value = array[index];
+ if (FloatUtils.isShort(value)) {
+ shorts[index] = (short) value;
+ } else {
+ isShortOk = false;
+ break;
+ }
+ }
+
+ if (isShortOk) {
+ return new BoundingBoxShort(shorts);
+ }
+
+ /* Use the default/fallback implementation. */
+ return new BoundingBoxFloat(array);
+ }
+
+ /**
+ * Factory method that creates an instance of the best {@link BoundingBox} implementation for a given set of
+ * coordinates.
+ * This is useful in cases where the expected values may not conform to a set of criteria needed for a specific
+ * implementation.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ * @return A {@link BoundingBox} instance that stores the coordinates most efficiently.
+ */
+ public static BoundingBox makeBoundingBox(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
+ final float upperRightY) {
+ final float[] array = new float[BoundingBox.QTY_ENTRIES];
+ array[BoundingBox.LOWER_LEFT_X_INDEX] = lowerLeftX;
+ array[BoundingBox.LOWER_LEFT_Y_INDEX] = lowerLeftY;
+ array[BoundingBox.UPPER_RIGHT_X_INDEX] = upperRightX;
+ array[BoundingBox.UPPER_RIGHT_Y_INDEX] = upperRightY;
+ return makeBoundingBox(array);
+ }
+
}
Added: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2021 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: 11870 $
+ * $LastChangedDate: 2021-01-27 16:21:31 -0700 (Wed, 27 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.primitive;
+
+/**
+ * Utilities for the {@link java.lang.Float} and {@link java.lang.Float#TYPE}.
+ */
+public final class FloatUtils {
+
+ /**
+ * Private constructor. This is a utility class, and should never be instantiated.
+ */
+ private FloatUtils() { }
+
+ /**
+ * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Integer#TYPE} without losing
+ * any data.
+ * @param input The value to be tested.
+ * @return True if and only if the float can be cast to {@link java.lang.Integer#TYPE} with no loss of data.
+ */
+ public static boolean isInteger(final float input) {
+ final int asInt = (int) input;
+ return asInt == input;
+ }
+
+ /**
+ * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Short#TYPE} without losing
+ * any data.
+ * @param input The value to be tested.
+ * @return True if and only if the float can be cast to {@link java.lang.Short#TYPE} with no loss of data.
+ */
+ public static boolean isShort(final float input) {
+ final short asShort = (short) input;
+ return asShort == input;
+ }
+
+}
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 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -30,7 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
@@ -58,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxUtils.ZEROES;
/** The stemV value. */
private int stemV = 0;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,8 @@
package org.foray.font.format.ttf;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxShort;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
import org.axsl.common.data.BoundingBox;
@@ -53,7 +54,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private BoundingBox bbox = BoundingBoxFloat.ZEROES;
+ private BoundingBox bbox = BoundingBoxUtils.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -97,7 +98,7 @@
final short bblly = raInput.readShort();
final short bburx = raInput.readShort();
final short bbury = raInput.readShort();
- head.bbox = new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
+ head.bbox = new BoundingBoxShort(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
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 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.primitive.BitUtils;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -134,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxUtils.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -734,7 +734,7 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private BoundingBoxFloat computeFontBBox() {
+ private BoundingBox computeFontBBox() {
// Just guessing....
final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
EST_BBOX_LL_X_FIXED;
@@ -741,7 +741,7 @@
final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
- return new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
+ return BoundingBoxUtils.makeBoundingBox(bbllx, bblly, bburx, bbury);
}
/**
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 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.io.RandomAccessInput;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
@@ -1119,7 +1119,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
floats[i] = getFloat();
}
- final BoundingBoxFloat boundingBox = new BoundingBoxFloat(floats);
+ final BoundingBox boundingBox = BoundingBoxUtils.makeBoundingBox(floats);
this.metrics.setFontBBox(boundingBox);
}
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/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.font.format.ttf;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxShort;
import org.foray.common.io.SimpleDataSource;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
@@ -86,7 +86,7 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final BoundingBox expected = new BoundingBoxFloat(-1501, -550, 3398, 2262);
+ final BoundingBox expected = new BoundingBoxShort(-1501, -550, 3398, 2262);
final BoundingBox actual = ttfFont.getFontBBox();
Assert.assertEquals(expected, actual);
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -30,7 +30,7 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.common.WellKnownConstants;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -269,7 +269,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
index += readBBoxString(fileStart, i, index, bboxArray);
}
- this.bbox = new BoundingBoxFloat(bboxArray);
+ this.bbox = BoundingBoxUtils.makeBoundingBox(bboxArray);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -29,7 +29,6 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
-import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.pdf.util.PdfGraphics2D;
@@ -108,7 +107,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBoxFloat(box);
+ return BoundingBoxUtils.makeBoundingBox(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -29,7 +29,6 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
-import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.pdf.util.PdfGraphics2D;
@@ -108,7 +107,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBoxFloat(box);
+ return BoundingBoxUtils.makeBoundingBox(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.pdf.object;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
@@ -101,7 +101,7 @@
@Override
protected BoundingBox getBoundingBox() {
/* TODO: Implement this. */
- return new BoundingBoxFloat(0, 0, 0, 0);
+ return BoundingBoxUtils.ZEROES;
}
@Override
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:32:18 UTC (rev 11873)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 18:58:50 UTC (rev 11874)
@@ -28,7 +28,7 @@
package org.foray.ps.type1;
-import org.foray.common.data.BoundingBoxFloat;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -124,7 +124,7 @@
return null;
}
}
- return new BoundingBoxFloat(fontBBox);
+ return BoundingBoxUtils.makeBoundingBox(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 17:32:21
|
Revision: 11873
http://sourceforge.net/p/foray/code/11873
Author: victormote
Date: 2021-01-28 17:32:18 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Move and rename the existing BoundingBox implementation.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.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/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/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
Copied: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java (from rev 11872, trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java)
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxFloat.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -0,0 +1,118 @@
+/*
+ * 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.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+import java.io.Serializable;
+
+/**
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
+ */
+public class BoundingBoxFloat implements BoundingBox, Serializable {
+
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBoxFloat ZEROES = new BoundingBoxFloat(0, 0, 0, 0);
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 1176678668590516253L;
+
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+
+ /** The lower-left X value. */
+ private float llx;
+
+ /** The lower-left Y value. */
+ private float lly;
+
+ /** The upper-right X value. */
+ private float urx;
+
+ /** The upper-right Y value. */
+ private float ury;
+
+ /**
+ * Constructor.
+ * @param lowerLeftX The lower-left X coordinate for the bounding box.
+ * @param lowerLeftY The lower-left Y coordinate for the bounding box.
+ * @param upperRightX The upper-right X coordinate for the bounding box.
+ * @param upperRightY The upper-right Y coordinate for the bounding box.
+ */
+ public BoundingBoxFloat(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
+ final float upperRightY) {
+ this.llx = lowerLeftX;
+ this.lly = lowerLeftY;
+ this.urx = upperRightX;
+ this.ury = upperRightY;
+ }
+
+ /**
+ * Constructor for a pre-existing float array.
+ * @param array The array containing the bounds.
+ * This array must have exactly four elements.
+ */
+ public BoundingBoxFloat(final float[] array) {
+ if (array.length != BoundingBox.QTY_ENTRIES) {
+ throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
+ }
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
+ }
+
+ @Override
+ public float getCoordinateAsFloat(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
+ }
+
+ @Override
+ public int getCoordinateAsInt(final int index) {
+ return (int) getCoordinateAsFloat(index);
+ }
+
+ @Override
+ public short getCoordinateAsShort(final int index) {
+ return (short) getCoordinateAsFloat(index);
+ }
+
+ @Override
+ public Class<? extends Number> getNativeType() {
+ return Float.TYPE;
+ }
+
+}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -1,118 +0,0 @@
-/*
- * 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.common.ps;
-
-import org.axsl.common.data.BoundingBox;
-
-import java.io.Serializable;
-
-/**
- * <p>A bounding box, as commonly used in graphical applications.</p>
- *
- * <p>Instances of this class are immutable.</p>
- */
-public class BoundingBox4a implements BoundingBox, Serializable {
-
- /** An bounding box whose values are all zero, useful for initializing. */
- public static final BoundingBox4a ZEROES = new BoundingBox4a(0, 0, 0, 0);
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = 1176678668590516253L;
-
- /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
-
- /** The lower-left X value. */
- private float llx;
-
- /** The lower-left Y value. */
- private float lly;
-
- /** The upper-right X value. */
- private float urx;
-
- /** The upper-right Y value. */
- private float ury;
-
- /**
- * Constructor.
- * @param lowerLeftX The lower-left X coordinate for the bounding box.
- * @param lowerLeftY The lower-left Y coordinate for the bounding box.
- * @param upperRightX The upper-right X coordinate for the bounding box.
- * @param upperRightY The upper-right Y coordinate for the bounding box.
- */
- public BoundingBox4a(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
- final float upperRightY) {
- this.llx = lowerLeftX;
- this.lly = lowerLeftY;
- this.urx = upperRightX;
- this.ury = upperRightY;
- }
-
- /**
- * Constructor for a pre-existing float array.
- * @param array The array containing the bounds.
- * This array must have exactly four elements.
- */
- public BoundingBox4a(final float[] array) {
- if (array.length != BoundingBox.QTY_ENTRIES) {
- throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
- }
- this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
- this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
- this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
- this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
- }
-
- @Override
- public float getCoordinateAsFloat(final int index) {
- switch(index) {
- case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
- case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
- case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
- case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
- }
- throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
- }
-
- @Override
- public int getCoordinateAsInt(final int index) {
- return (int) getCoordinateAsFloat(index);
- }
-
- @Override
- public short getCoordinateAsShort(final int index) {
- return (short) getCoordinateAsFloat(index);
- }
-
- @Override
- public Class<? extends Number> getNativeType() {
- return Float.TYPE;
- }
-
-}
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 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -30,7 +30,7 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
@@ -58,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private BoundingBox fontBBox = BoundingBox4a.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
/** The stemV value. */
private int stemV = 0;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.ps.BoundingBox4a;
import org.axsl.common.data.BoundingBox;
@@ -53,7 +53,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private BoundingBox bbox = BoundingBox4a.ZEROES;
+ private BoundingBox bbox = BoundingBoxFloat.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -97,7 +97,7 @@
final short bblly = raInput.readShort();
final short bburx = raInput.readShort();
final short bbury = raInput.readShort();
- head.bbox = new BoundingBox4a(bbllx, bblly, bburx, bbury);
+ head.bbox = new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
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 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.type1;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.primitive.BitUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -134,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private BoundingBox fontBBox = BoundingBox4a.ZEROES;
+ private BoundingBox fontBBox = BoundingBoxFloat.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -734,7 +734,7 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private BoundingBox4a computeFontBBox() {
+ private BoundingBoxFloat computeFontBBox() {
// Just guessing....
final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
EST_BBOX_LL_X_FIXED;
@@ -741,7 +741,7 @@
final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
- return new BoundingBox4a(bbllx, bblly, bburx, bbury);
+ return new BoundingBoxFloat(bbllx, bblly, bburx, bbury);
}
/**
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 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.type1;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.RandomAccessInput;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
@@ -1119,7 +1119,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
floats[i] = getFloat();
}
- final BoundingBox4a boundingBox = new BoundingBox4a(floats);
+ final BoundingBoxFloat boundingBox = new BoundingBoxFloat(floats);
this.metrics.setFontBBox(boundingBox);
}
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/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,8 +28,8 @@
package org.foray.font.format.ttf;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.io.SimpleDataSource;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
import org.foray.font.format.FontParser;
@@ -86,7 +86,7 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final BoundingBox expected = new BoundingBox4a(-1501, -550, 3398, 2262);
+ final BoundingBox expected = new BoundingBoxFloat(-1501, -550, 3398, 2262);
final BoundingBox actual = ttfFont.getFontBBox();
Assert.assertEquals(expected, actual);
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -30,7 +30,7 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.common.WellKnownConstants;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -269,7 +269,7 @@
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
index += readBBoxString(fileStart, i, index, bboxArray);
}
- this.bbox = new BoundingBox4a(bboxArray);
+ this.bbox = new BoundingBoxFloat(bboxArray);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -29,8 +29,8 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
import org.axsl.common.data.BoundingBox;
@@ -108,7 +108,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBox4a(box);
+ return new BoundingBoxFloat(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -29,8 +29,8 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.common.data.BoundingBoxUtils;
-import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
import org.axsl.common.data.BoundingBox;
@@ -108,7 +108,7 @@
box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
- return new BoundingBox4a(box);
+ return new BoundingBoxFloat(box);
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,7 +28,7 @@
package org.foray.pdf.object;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
@@ -101,7 +101,7 @@
@Override
protected BoundingBox getBoundingBox() {
/* TODO: Implement this. */
- return new BoundingBox4a(0, 0, 0, 0);
+ return new BoundingBoxFloat(0, 0, 0, 0);
}
@Override
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:20:59 UTC (rev 11872)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 17:32:18 UTC (rev 11873)
@@ -28,7 +28,7 @@
package org.foray.ps.type1;
-import org.foray.common.ps.BoundingBox4a;
+import org.foray.common.data.BoundingBoxFloat;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -124,7 +124,7 @@
return null;
}
}
- return new BoundingBox4a(fontBBox);
+ return new BoundingBoxFloat(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 17:21:02
|
Revision: 11872
http://sourceforge.net/p/foray/code/11872
Author: victormote
Date: 2021-01-28 17:20:59 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Simplify BoundingBox interface: 1. Get all values using an index instead of explicit methods. 2. Provide methods to retrieve values as int and short, to provide potential performance improvements.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
Added: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2021 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: 11871 $
+ * $LastChangedDate: 2021-01-28 07:52:03 -0700 (Thu, 28 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.common.data;
+
+import org.axsl.common.data.BoundingBox;
+
+/**
+ * Utilities related to bounding boxes.
+ */
+public final class BoundingBoxUtils {
+
+ /**
+ * Private constructor.
+ * This is a utility class, and should never be instantiated.
+ */
+ private BoundingBoxUtils() { }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeWidthAsFloat(final BoundingBox bBox) {
+ final float urx = bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float llx = bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ return urx - llx;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeHeightAsFloat(final BoundingBox bBox) {
+ final float ury = bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float lly = bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ return ury - lly;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeWidthAsInt(final BoundingBox bBox) {
+ final int urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final int llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
+ return urx - llx;
+ }
+
+ /**
+ * Computes the width of a given bounding box.
+ * @param bBox The bounding box whose width should be computed.
+ * @return The width of the bounding box.
+ */
+ public static float computeHeightAsInt(final BoundingBox bBox) {
+ final int ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final int lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
+ return ury - lly;
+ }
+
+ /**
+ * Tests the equality of the values in two {@link BoundingBox} instances.
+ * @param box1 The first box to test.
+ * @param box2 The second box to test.
+ * @return True if and only if each corresponding element in one box is equal to the other.
+ */
+ public static boolean equals(final BoundingBox box1, final BoundingBox box2) {
+ /* First, check for equality by float values. */
+ boolean floatEquals = true;
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float value1 = box1.getCoordinateAsFloat(index);
+ final float value2 = box2.getCoordinateAsFloat(index);
+ if (value1 != value2) {
+ floatEquals = false;
+ break;
+ }
+ }
+ if (floatEquals) {
+ return true;
+ }
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final int value1 = box1.getCoordinateAsInt(index);
+ final int value2 = box2.getCoordinateAsInt(index);
+ if (value1 != value2) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -45,9 +45,20 @@
/** Constant needed for serialization. */
private static final long serialVersionUID = 1176678668590516253L;
- /** The array storing the elements of the bounding box. */
- private float[] array;
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+ /** The lower-left X value. */
+ private float llx;
+
+ /** The lower-left Y value. */
+ private float lly;
+
+ /** The upper-right X value. */
+ private float urx;
+
+ /** The upper-right Y value. */
+ private float ury;
+
/**
* Constructor.
* @param lowerLeftX The lower-left X coordinate for the bounding box.
@@ -57,11 +68,10 @@
*/
public BoundingBox4a(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
final float upperRightY) {
- this.array = new float[BoundingBox.QTY_ENTRIES];
- this.array[BoundingBox.LOWER_LEFT_X_INDEX] = lowerLeftX;
- this.array[BoundingBox.LOWER_LEFT_Y_INDEX] = lowerLeftY;
- this.array[BoundingBox.UPPER_RIGHT_X_INDEX] = upperRightX;
- this.array[BoundingBox.UPPER_RIGHT_Y_INDEX] = upperRightY;
+ this.llx = lowerLeftX;
+ this.lly = lowerLeftY;
+ this.urx = upperRightX;
+ this.ury = upperRightY;
}
/**
@@ -73,66 +83,36 @@
if (array.length != BoundingBox.QTY_ENTRIES) {
throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
}
- this.array = array;
+ this.llx = array[BoundingBox.LOWER_LEFT_X_INDEX];
+ this.lly = array[BoundingBox.LOWER_LEFT_Y_INDEX];
+ this.urx = array[BoundingBox.UPPER_RIGHT_X_INDEX];
+ this.ury = array[BoundingBox.UPPER_RIGHT_Y_INDEX];
}
@Override
- public float getWidth() {
- return this.array[UPPER_RIGHT_X_INDEX] - this.array[LOWER_LEFT_X_INDEX];
-
+ public float getCoordinateAsFloat(final int index) {
+ switch(index) {
+ case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
+ case BoundingBox.LOWER_LEFT_Y_INDEX: return this.lly;
+ case BoundingBox.UPPER_RIGHT_X_INDEX: return this.urx;
+ case BoundingBox.UPPER_RIGHT_Y_INDEX: return this.ury;
+ }
+ throw new IndexOutOfBoundsException("BoundingBox index must be between 0 and 3 inclusive.");
}
@Override
- public float getHeight() {
- return this.array[UPPER_RIGHT_Y_INDEX] - this.array[LOWER_LEFT_Y_INDEX];
+ public int getCoordinateAsInt(final int index) {
+ return (int) getCoordinateAsFloat(index);
}
@Override
- public float getLowerLeftX() {
- return this.array[LOWER_LEFT_X_INDEX];
+ public short getCoordinateAsShort(final int index) {
+ return (short) getCoordinateAsFloat(index);
}
@Override
- public float getLowerLeftY() {
- return this.array[LOWER_LEFT_Y_INDEX];
+ public Class<? extends Number> getNativeType() {
+ return Float.TYPE;
}
- @Override
- public float getUpperRightX() {
- return this.array[UPPER_RIGHT_X_INDEX];
- }
-
- @Override
- public float getUpperRightY() {
- return this.array[UPPER_RIGHT_Y_INDEX];
- }
-
- @Override
- public float getCoordinate(final int index) {
- return this.array[index];
- }
-
- @Override
- public float[] getArray() {
- final float[] returnValue = new float[BoundingBox.QTY_ENTRIES];
- System.arraycopy(this.array, 0, returnValue, 0, BoundingBox.QTY_ENTRIES);
- return returnValue;
- }
-
- @Override
- public boolean equals(final Object other) {
- if (! (other instanceof BoundingBox)) {
- return false;
- }
- final BoundingBox bbOther = (BoundingBox) other;
- for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
- final float valueThis = getCoordinate(index);
- final float valueOther = bbOther.getCoordinate(index);
- if (valueThis != valueOther) {
- return false;
- }
- }
- return true;
- }
-
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -141,7 +141,7 @@
final StringBuilder buffer = new StringBuilder();
buffer.append("FontBBox: [");
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- buffer.append((int) bbox.getCoordinate(i));
+ buffer.append(bbox.getCoordinateAsInt(i));
if (i < BoundingBox.QTY_ENTRIES - 1) {
buffer.append(" ");
} else {
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -89,10 +89,10 @@
Assert.assertEquals("Utopia-Regular", fontDict.getFontName());
final BoundingBox fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(-158, fontBBox.getCoordinate(0), 0);
- Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
- Assert.assertEquals(1158, fontBBox.getCoordinate(2), 0);
- Assert.assertEquals(890, fontBBox.getCoordinate(3), 0);
+ Assert.assertEquals(-158, fontBBox.getCoordinateAsInt(0));
+ Assert.assertEquals(-250, fontBBox.getCoordinateAsInt(1));
+ Assert.assertEquals(1158, fontBBox.getCoordinateAsInt(2));
+ Assert.assertEquals(890, fontBBox.getCoordinateAsInt(3));
Assert.assertEquals("Regular", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -89,10 +89,10 @@
Assert.assertEquals("CMR10", fontDict.getFontName());
final BoundingBox fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(-251, fontBBox.getCoordinate(0), 0);
- Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
- Assert.assertEquals(1009, fontBBox.getCoordinate(2), 0);
- Assert.assertEquals(969, fontBBox.getCoordinate(3), 0);
+ Assert.assertEquals(-251, fontBBox.getCoordinateAsInt(0));
+ Assert.assertEquals(-250, fontBBox.getCoordinateAsInt(1));
+ Assert.assertEquals(1009, fontBBox.getCoordinateAsInt(2));
+ Assert.assertEquals(969, fontBBox.getCoordinateAsInt(3));
Assert.assertEquals("Medium", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -203,12 +203,12 @@
}
readBBox(fileStart);
if (this.bbox != null) {
- final float xUR = this.bbox.getUpperRightX();
- final float xLL = this.bbox.getLowerLeftX();
+ final float xUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float xLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
final float pixelWidth = xUR - xLL;
this.pixelWidth = Math.round(pixelWidth);
- final float yUR = this.bbox.getUpperRightY();
- final float yLL = this.bbox.getLowerLeftY();
+ final float yUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float yLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
final float pixelHeight = yUR - yLL;
this.pixelHeight = Math.round(pixelHeight);
} else {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -103,10 +103,10 @@
@Override
protected String specialXObjectDictEntries(final PdfDocument4a doc) throws GraphicException {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getLowerLeftX();
- final float lly = boundingBox.getLowerLeftY();
- final float urx = boundingBox.getUpperRightX();
- final float ury = boundingBox.getUpperRightY();
+ final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ final float urx = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float ury = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
final StringBuilder buffer = new StringBuilder();
buffer.append("/FormType 1" + EOL);
buffer.append("/BBox [");
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -85,10 +85,10 @@
* @param bBox A bounding box.
*/
public PdfRectangle(final BoundingBox bBox) {
- this.llx = (int) bBox.getLowerLeftX();
- this.lly = (int) bBox.getLowerLeftY();
- this.urx = (int) bBox.getUpperRightX();
- this.ury = (int) bBox.getUpperRightY();
+ this.llx = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_X_INDEX);
+ this.lly = bBox.getCoordinateAsInt(BoundingBox.LOWER_LEFT_Y_INDEX);
+ this.urx = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_X_INDEX);
+ this.ury = bBox.getCoordinateAsInt(BoundingBox.UPPER_RIGHT_Y_INDEX);
}
/**
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -28,6 +28,7 @@
package org.foray.pdf.object;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.data.BoundingBox;
@@ -91,7 +92,7 @@
public float getHorizontalScaling(
final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicWidth = eps.getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(eps.getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@@ -98,7 +99,7 @@
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicHeight = eps.getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(eps.getBoundingBox());
return contentRectangle.height / graphicHeight;
}
@@ -120,8 +121,8 @@
@Override
protected AffineTransform getUserSpaceTransform() {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getLowerLeftX();
- final float lly = boundingBox.getLowerLeftY();
+ final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
float xTranslate = 0;
if (llx < 0) {
/* If the bounding box of the graphic is negative, adjust it up to
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -29,6 +29,7 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
@@ -85,13 +86,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(getBoundingBox());
return contentRectangle.height / graphicHeight;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -29,6 +29,7 @@
package org.foray.pdf.object;
import org.foray.common.Mime;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
@@ -85,13 +86,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().getWidth();
+ final float graphicWidth = BoundingBoxUtils.computeWidthAsFloat(getBoundingBox());
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().getHeight();
+ final float graphicHeight = BoundingBoxUtils.computeHeightAsFloat(getBoundingBox());
return contentRectangle.height / graphicHeight;
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-28 14:52:03 UTC (rev 11871)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-28 17:20:59 UTC (rev 11872)
@@ -37,6 +37,7 @@
import org.foray.common.CharacterOutputStream;
import org.foray.common.Mime;
import org.foray.common.WellKnownConstants;
+import org.foray.common.data.BoundingBoxUtils;
import org.foray.common.primitive.StringUtils;
import org.foray.common.sequence.ByteArray;
import org.foray.render.PrintRenderer;
@@ -672,8 +673,8 @@
public byte[] epsToPostScript(final EpsGraphic image, final int x,
final int y, final int w, final int h) throws GraphicException {
final BoundingBox bbox = image.getBoundingBox();
- final float bboxw = bbox.getWidth();
- final float bboxh = bbox.getHeight();
+ final float bboxw = BoundingBoxUtils.computeWidthAsFloat(bbox);
+ final float bboxh = BoundingBoxUtils.computeHeightAsFloat(bbox);
StringBuilder buffer = new StringBuilder();
buffer.append("%%BeginDocument: " + image.getName());
@@ -682,9 +683,18 @@
buffer.append(x + " " + (y - h) + " translate");
buffer.append("0.0 rotate");
buffer.append((long) (w / bboxw) + " " + (long) (h / bboxh) + " scale");
- buffer.append(-bbox.getLowerLeftX() + " " + (-bbox.getLowerLeftY()) + " translate");
- buffer.append(bbox.getLowerLeftX() + " " + bbox.getLowerLeftY() + " " + bboxw + " " + bboxh
- + " rectclip");
+ buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(" ");
+ buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(" translate");
+ buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(" ");
+ buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(" ");
+ buffer.append(bboxw);
+ buffer.append(" ");
+ buffer.append(bboxh);
+ buffer.append(" rectclip");
buffer.append("newpath");
final String string1 = buffer.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-28 14:52:15
|
Revision: 11871
http://sourceforge.net/p/foray/code/11871
Author: victormote
Date: 2021-01-28 14:52:03 +0000 (Thu, 28 Jan 2021)
Log Message:
-----------
Conform to aXSL changes: Convert use of bounding box arrays to BoundingBox.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.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/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.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/ttf/TtfTableHead.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/util/MockFont.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/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -30,11 +30,21 @@
import org.axsl.common.data.BoundingBox;
+import java.io.Serializable;
+
/**
- * A PostScript bounding box.
+ * <p>A bounding box, as commonly used in graphical applications.</p>
+ *
+ * <p>Instances of this class are immutable.</p>
*/
-public class BoundingBox4a implements BoundingBox {
+public class BoundingBox4a implements BoundingBox, Serializable {
+ /** An bounding box whose values are all zero, useful for initializing. */
+ public static final BoundingBox4a ZEROES = new BoundingBox4a(0, 0, 0, 0);
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 1176678668590516253L;
+
/** The array storing the elements of the bounding box. */
private float[] array;
@@ -109,4 +119,20 @@
return returnValue;
}
+ @Override
+ public boolean equals(final Object other) {
+ if (! (other instanceof BoundingBox)) {
+ return false;
+ }
+ final BoundingBox bbOther = (BoundingBox) other;
+ for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
+ final float valueThis = getCoordinate(index);
+ final float valueOther = bbOther.getCoordinate(index);
+ if (valueThis != valueOther) {
+ return false;
+ }
+ }
+ return true;
+ }
+
}
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -34,6 +34,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
@@ -201,7 +202,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public abstract int[] getFontBBox();
+ public abstract BoundingBox getFontBBox();
@Override
public int getFlags() {
@@ -573,7 +574,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
return getFontBBox();
}
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -30,11 +30,13 @@
import org.foray.common.IoUtil;
import org.foray.common.WellKnownConstants;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.config.RegisteredFont;
import org.foray.font.format.ttf.TrueTypeContainer;
import org.foray.font.format.ttf.TrueTypeFont;
import org.foray.font.format.ttf.TtfSubSetFile;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
@@ -56,7 +58,7 @@
private TrueTypeFont ttf;
/** The font bbox. */
- private int[] fontBBox = {0, 0, 0, 0};
+ private BoundingBox fontBBox = BoundingBox4a.ZEROES;
/** The stemV value. */
private int stemV = 0;
@@ -155,7 +157,7 @@
}
@Override
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
return this.fontBBox;
}
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -38,6 +38,7 @@
import org.foray.font.format.type1.Type1Metrics;
import org.foray.font.format.type1.Type1MetricsParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
import org.axsl.ps.PsEncoding;
@@ -207,8 +208,8 @@
}
@Override
- public int[] getFontBBox() {
- int[] bbox = null;
+ public BoundingBox getFontBBox() {
+ BoundingBox bbox = null;
/* Check the AFM file first as that is the cleanest and most
* efficient. */
if (this.metricsFile.getFormat() == Type1Metrics.Format.AFM) {
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -35,6 +35,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
@@ -563,7 +564,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
return null;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -35,6 +35,7 @@
import org.foray.font.format.FontParserClient;
import org.foray.font.format.type1.Type1MetricsSerializer;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.apache.commons.cli.CommandLine;
@@ -136,12 +137,12 @@
logger.info("");
logger.info("Ascender: " + font.getAscender());
logger.info("Descender: " + font.getDescender());
- final int[] bbox = font.getFontBBox();
+ final BoundingBox bbox = font.getFontBBox();
final StringBuilder buffer = new StringBuilder();
buffer.append("FontBBox: [");
- for (int i = 0; i < bbox.length; i++) {
- buffer.append(bbox[i]);
- if (i < bbox.length - 1) {
+ for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
+ buffer.append((int) bbox.getCoordinate(i));
+ if (i < BoundingBox.QTY_ENTRIES - 1) {
buffer.append(" ");
} else {
buffer.append("]");
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -36,6 +36,7 @@
import org.foray.font.format.Panose4a;
import org.foray.font.output.FontPdfUtilities;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.ps.Cmap;
@@ -641,7 +642,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
return this.headTable.getBbox();
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.ttf;
import org.foray.common.io.RandomAccessInput;
+import org.foray.common.ps.BoundingBox4a;
import org.axsl.common.data.BoundingBox;
@@ -52,7 +53,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox bbox = BoundingBox4a.ZEROES;
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -92,14 +93,11 @@
/* Skip modified date. */
raInput.skipBytes(LONG_DATE_TIME_BYTES);
/* Read the bounding box. */
- head.bbox[BoundingBox.LOWER_LEFT_X_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.LOWER_LEFT_Y_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.UPPER_RIGHT_X_INDEX]
- = raInput.readShort();
- head.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
- = raInput.readShort();
+ final short bbllx = raInput.readShort();
+ final short bblly = raInput.readShort();
+ final short bburx = raInput.readShort();
+ final short bbury = raInput.readShort();
+ head.bbox = new BoundingBox4a(bbllx, bblly, bburx, bbury);
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
/* Skip lowestRecPPEM. */
@@ -138,7 +136,7 @@
* Returns the bounding box for this font.
* @return The bounding box for this font.
*/
- public int[] getBbox() {
+ public BoundingBox getBbox() {
return this.bbox;
}
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.type1;
import org.foray.common.primitive.BitUtils;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
@@ -133,7 +134,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
+ private BoundingBox fontBBox = BoundingBox4a.ZEROES;
/** The parsed cap height. */
private int etmCapHeight;
@@ -378,24 +379,18 @@
/**
* Set the bounding box.
- * @param index The fontBBox index to set.
- * @param value The value to set.
+ * @param newBoundingBox The fontBBox index to set.
*/
- public void setFontBBox(final int index, final int value) {
- if (index < 0
- || index >= BoundingBox.QTY_ENTRIES) {
- return;
- }
- this.fontBBox[index] = value;
+ public void setFontBBox(final BoundingBox newBoundingBox) {
+ this.fontBBox = newBoundingBox;
}
/**
* Returns the bounding box for the font.
- * Note: this value is just an approximation, it does not really exist in
- * the PFM file.
+ * Note: this value is just an approximation, it does not really exist in the PFM file.
* @return The calculated Font BBox.
*/
- public int[] getFontBBox() {
+ public BoundingBox getFontBBox() {
if (this.fontBBox == null) {
this.fontBBox = computeFontBBox();
}
@@ -739,23 +734,14 @@
* Computes the font bounding box.
* @return The font bounding box.
*/
- private int[] computeFontBBox() {
- final int[] bbox = new int[BoundingBox.QTY_ENTRIES];
-
+ private BoundingBox4a computeFontBBox() {
// Just guessing....
- if (!getIsProportional() && (getAverageWidth() == getMaxWidth())) {
- bbox[BoundingBox.LOWER_LEFT_X_INDEX] = EST_BBOX_LL_X_FIXED;
- } else {
- bbox[BoundingBox.LOWER_LEFT_X_INDEX] =
- EST_BBOX_LL_X_PROPORTIONAL;
- }
- bbox[BoundingBox.LOWER_LEFT_Y_INDEX] = -(getLowerCaseDescent()
- + EST_BBOX_LL_Y_ADJUST);
- bbox[BoundingBox.UPPER_RIGHT_X_INDEX] = getMaxWidth()
- + EST_BBOX_UR_X_ADJUST;
- bbox[BoundingBox.UPPER_RIGHT_Y_INDEX] = getLowerCaseAscent()
- + EST_BBOX_UR_Y_ADJUST;
- return bbox;
+ final int bbllx = getIsProportional() && getAverageWidth() == getMaxWidth() ? EST_BBOX_LL_X_PROPORTIONAL :
+ EST_BBOX_LL_X_FIXED;
+ final int bblly = -(getLowerCaseDescent() + EST_BBOX_LL_Y_ADJUST);
+ final int bburx = getMaxWidth() + EST_BBOX_UR_X_ADJUST;
+ final int bbury = getLowerCaseAscent() + EST_BBOX_UR_Y_ADJUST;
+ return new BoundingBox4a(bbllx, bblly, bburx, bbury);
}
/**
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 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,6 +29,7 @@
package org.foray.font.format.type1;
import org.foray.common.io.RandomAccessInput;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.common.sequence.CharArrayBuilder;
import org.foray.common.sequence.IntArrayBuilder;
import org.foray.font.FontServer4a;
@@ -1114,9 +1115,12 @@
* Process a "FontBBox" keyword.
*/
private void fontBBox() {
+ final float[] floats = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
- this.metrics.setFontBBox(i, Math.round(getFloat()));
+ floats[i] = getFloat();
}
+ final BoundingBox4a boundingBox = new BoundingBox4a(floats);
+ this.metrics.setFontBBox(boundingBox);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -31,6 +31,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.IntArray;
+import org.axsl.common.data.BoundingBox;
import org.axsl.common.i18n.Orthography;
import org.axsl.common.sequence.IntSequence;
import org.axsl.font.Font;
@@ -259,7 +260,7 @@
}
@Override
- public int[] getBoundingBox() {
+ public BoundingBox getBoundingBox() {
// TODO Auto-generated method stub
return null;
}
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/ttf/TrueTypeFontParserTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -29,10 +29,12 @@
package org.foray.font.format.ttf;
import org.foray.common.io.SimpleDataSource;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.font.FontServer4a;
import org.foray.font.format.FontContent;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.junit.Assert;
@@ -84,14 +86,10 @@
*/
public static void assertionsForDejaVuSansExtraLightSet2(final TrueTypeFont ttfFont) {
/* The following values were obtained by opening the TTF file (not the TTC) in FontLab Studio 5.0.4. */
- final int[] expectedBbox = {-1501, -550, 3398, 2262};
+ final BoundingBox expected = new BoundingBox4a(-1501, -550, 3398, 2262);
- final int[] bbox = ttfFont.getFontBBox();
- Assert.assertEquals(4, bbox.length);
- Assert.assertEquals(expectedBbox[0], bbox[0]);
- Assert.assertEquals(expectedBbox[1], bbox[1]);
- Assert.assertEquals(expectedBbox[2], bbox[2]);
- Assert.assertEquals(expectedBbox[3], bbox[3]);
+ final BoundingBox actual = ttfFont.getFontBBox();
+ Assert.assertEquals(expected, actual);
}
/**
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -32,6 +32,7 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.PsCharStringsDictionary;
import org.axsl.ps.PsFontDictionary;
@@ -87,12 +88,11 @@
Assert.assertEquals("Utopia-Regular", fontDict.getFontName());
- final int[] fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(4, fontBBox.length);
- Assert.assertEquals(-158, fontBBox[0]);
- Assert.assertEquals(-250, fontBBox[1]);
- Assert.assertEquals(1158, fontBBox[2]);
- Assert.assertEquals(890, fontBBox[3]);
+ final BoundingBox fontBBox = fontDict.getFontBbox();
+ Assert.assertEquals(-158, fontBBox.getCoordinate(0), 0);
+ Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
+ Assert.assertEquals(1158, fontBBox.getCoordinate(2), 0);
+ Assert.assertEquals(890, fontBBox.getCoordinate(3), 0);
Assert.assertEquals("Regular", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -32,6 +32,7 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.FontParser;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontException;
import org.axsl.ps.PsCharStringsDictionary;
import org.axsl.ps.PsFontDictionary;
@@ -87,12 +88,11 @@
Assert.assertEquals("CMR10", fontDict.getFontName());
- final int[] fontBBox = fontDict.getFontBbox();
- Assert.assertEquals(4, fontBBox.length);
- Assert.assertEquals(-251, fontBBox[0]);
- Assert.assertEquals(-250, fontBBox[1]);
- Assert.assertEquals(1009, fontBBox[2]);
- Assert.assertEquals(969, fontBBox[3]);
+ final BoundingBox fontBBox = fontDict.getFontBbox();
+ Assert.assertEquals(-251, fontBBox.getCoordinate(0), 0);
+ Assert.assertEquals(-250, fontBBox.getCoordinate(1), 0);
+ Assert.assertEquals(1009, fontBBox.getCoordinate(2), 0);
+ Assert.assertEquals(969, fontBBox.getCoordinate(3), 0);
Assert.assertEquals("Medium", fontInfoDict.getWeight());
Assert.assertEquals(BigDecimal.ZERO, fontInfoDict.getItalicAngle());
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfRectangle.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -28,6 +28,8 @@
package org.foray.pdf.object;
+import org.axsl.common.data.BoundingBox;
+
import java.io.UnsupportedEncodingException;
/**
@@ -79,6 +81,17 @@
}
/**
+ * Create a rectangle from a bounding box.
+ * @param bBox A bounding box.
+ */
+ public PdfRectangle(final BoundingBox bBox) {
+ this.llx = (int) bBox.getLowerLeftX();
+ this.lly = (int) bBox.getLowerLeftY();
+ this.urx = (int) bBox.getUpperRightX();
+ this.ury = (int) bBox.getUpperRightY();
+ }
+
+ /**
* Produce the PDF representation for the object.
* @return the PDF
*/
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-27 23:21:31 UTC (rev 11870)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-28 14:52:03 UTC (rev 11871)
@@ -28,6 +28,7 @@
package org.foray.ps.type1;
+import org.foray.common.ps.BoundingBox4a;
import org.foray.ps.PsArray;
import org.foray.ps.PsDictionary;
import org.foray.ps.PsDictionaryWrapper;
@@ -103,7 +104,7 @@
}
@Override
- public int[] getFontBbox() {
+ public BoundingBox getFontBbox() {
final Object object = this.getWrappedDictionary().getItem(PsFontDictionary4a.FONT_BBOX_KEY);
if (! (object instanceof PsArray)) {
return null;
@@ -112,7 +113,7 @@
if (psarray.size() != BoundingBox.QTY_ENTRIES) {
return null;
}
- final int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
+ final float[] fontBBox = new float[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < psarray.size(); i++) {
final Object arrayItem = psarray.get(i);
if (arrayItem instanceof PsInteger) {
@@ -123,7 +124,7 @@
return null;
}
}
- return fontBBox;
+ return new BoundingBox4a(fontBBox);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-27 23:21:34
|
Revision: 11870
http://sourceforge.net/p/foray/code/11870
Author: victormote
Date: 2021-01-27 23:21:31 +0000 (Wed, 27 Jan 2021)
Log Message:
-----------
Conform to aXSL changes to BoundingBox: Move the PsBoundingBox interface to axsl-common, and rename it accordingly. Revise constant and method names and add a convenience method to expose the contents as an array.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.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-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -28,12 +28,12 @@
package org.foray.common.ps;
-import org.axsl.ps.PsBoundingBox;
+import org.axsl.common.data.BoundingBox;
/**
* A PostScript bounding box.
*/
-public class BoundingBox4a implements PsBoundingBox {
+public class BoundingBox4a implements BoundingBox {
/** The array storing the elements of the bounding box. */
private float[] array;
@@ -47,11 +47,11 @@
*/
public BoundingBox4a(final float lowerLeftX, final float lowerLeftY, final float upperRightX,
final float upperRightY) {
- this.array = new float[PsBoundingBox.BBOX_ENTRIES];
- this.array[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX] = lowerLeftX;
- this.array[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX] = lowerLeftY;
- this.array[PsBoundingBox.BBOX_UPPER_RIGHT_X_INDEX] = upperRightX;
- this.array[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX] = upperRightY;
+ this.array = new float[BoundingBox.QTY_ENTRIES];
+ this.array[BoundingBox.LOWER_LEFT_X_INDEX] = lowerLeftX;
+ this.array[BoundingBox.LOWER_LEFT_Y_INDEX] = lowerLeftY;
+ this.array[BoundingBox.UPPER_RIGHT_X_INDEX] = upperRightX;
+ this.array[BoundingBox.UPPER_RIGHT_Y_INDEX] = upperRightY;
}
/**
@@ -60,7 +60,7 @@
* This array must have exactly four elements.
*/
public BoundingBox4a(final float[] array) {
- if (array.length != PsBoundingBox.BBOX_ENTRIES) {
+ if (array.length != BoundingBox.QTY_ENTRIES) {
throw new IllegalArgumentException("Parameter \"array\" must have exactly four elements.");
}
this.array = array;
@@ -67,34 +67,46 @@
}
@Override
- public float width() {
- return this.array[BBOX_UPPER_RIGHT_X_INDEX] - this.array[BBOX_LOWER_LEFT_X_INDEX];
+ public float getWidth() {
+ return this.array[UPPER_RIGHT_X_INDEX] - this.array[LOWER_LEFT_X_INDEX];
}
@Override
- public float height() {
- return this.array[BBOX_UPPER_RIGHT_Y_INDEX] - this.array[BBOX_LOWER_LEFT_Y_INDEX];
+ public float getHeight() {
+ return this.array[UPPER_RIGHT_Y_INDEX] - this.array[LOWER_LEFT_Y_INDEX];
}
@Override
- public float lowerLeftX() {
- return this.array[BBOX_LOWER_LEFT_X_INDEX];
+ public float getLowerLeftX() {
+ return this.array[LOWER_LEFT_X_INDEX];
}
@Override
- public float lowerLeftY() {
- return this.array[BBOX_LOWER_LEFT_Y_INDEX];
+ public float getLowerLeftY() {
+ return this.array[LOWER_LEFT_Y_INDEX];
}
@Override
- public float upperRightX() {
- return this.array[BBOX_UPPER_RIGHT_X_INDEX];
+ public float getUpperRightX() {
+ return this.array[UPPER_RIGHT_X_INDEX];
}
@Override
- public float upperRightY() {
- return this.array[BBOX_UPPER_RIGHT_Y_INDEX];
+ public float getUpperRightY() {
+ return this.array[UPPER_RIGHT_Y_INDEX];
}
+ @Override
+ public float getCoordinate(final int index) {
+ return this.array[index];
+ }
+
+ @Override
+ public float[] getArray() {
+ final float[] returnValue = new float[BoundingBox.QTY_ENTRIES];
+ System.arraycopy(this.array, 0, returnValue, 0, BoundingBox.QTY_ENTRIES);
+ return returnValue;
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -28,7 +28,7 @@
package org.foray.font.format.ttf;
-import org.axsl.ps.PsBoundingBox;
+import org.axsl.common.data.BoundingBox;
/**
* A TTF Font Mtx entry.
@@ -42,7 +42,7 @@
private int lsb;
/** The glyph bounding box. */
- private int[] bbox = new int[PsBoundingBox.BBOX_ENTRIES];
+ private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
/** Obtained from the "loca" table. */
private long offset;
@@ -61,8 +61,8 @@
if (this.bbox == null) {
return 0;
}
- return this.bbox[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX]
- - this.bbox[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX];
+ return this.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
+ - this.bbox[BoundingBox.LOWER_LEFT_Y_INDEX];
}
/**
@@ -120,7 +120,7 @@
*/
public int getBBoxValue(final int index) {
if (index < 0
- || index > PsBoundingBox.BBOX_ENTRIES - 1) {
+ || index > BoundingBox.QTY_ENTRIES - 1) {
return Integer.MIN_VALUE;
}
return this.bbox[index];
@@ -133,7 +133,7 @@
*/
public void setBBoxValue(final int index, final int value) {
if (index < 0
- || index > PsBoundingBox.BBOX_ENTRIES - 1) {
+ || index > BoundingBox.QTY_ENTRIES - 1) {
return;
}
this.bbox[index] = value;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -31,7 +31,7 @@
import org.foray.common.io.RandomAccessInput;
import org.foray.common.primitive.BitUtils;
-import org.axsl.ps.PsBoundingBox;
+import org.axsl.common.data.BoundingBox;
import java.io.IOException;
@@ -102,12 +102,12 @@
raInput.seek(dirEntry.getOffset()
+ thisMetric.getOffset());
raInput.skipBytes(2);
- for (int j = 0; j < PsBoundingBox.BBOX_ENTRIES; j++) {
+ for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
final int bboxValue = raInput.readShort();
thisMetric.setBBoxValue(j, bboxValue);
}
} else {
- for (int j = 0; j < PsBoundingBox.BBOX_ENTRIES; j++) {
+ for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
final int bboxValue = firstMetric.getBBoxValue(j);
thisMetric.setBBoxValue(j, bboxValue);
}
@@ -122,12 +122,12 @@
|| thisMetric.getOffset() != nextMetric.getOffset()) {
raInput.seek(n + thisMetric.getOffset());
raInput.skipBytes(2);
- for (int j = 0; j < PsBoundingBox.BBOX_ENTRIES; j++) {
+ for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
final int bboxValue = raInput.readShort();
thisMetric.setBBoxValue(j, bboxValue);
}
} else {
- for (int j = 0; j < PsBoundingBox.BBOX_ENTRIES; j++) {
+ for (int j = 0; j < BoundingBox.QTY_ENTRIES; j++) {
final int bboxValue = firstMetric.getBBoxValue(0);
thisMetric.setBBoxValue(j, bboxValue);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -30,7 +30,7 @@
import org.foray.common.io.RandomAccessInput;
-import org.axsl.ps.PsBoundingBox;
+import org.axsl.common.data.BoundingBox;
import java.io.IOException;
@@ -52,7 +52,7 @@
private int unitsPerEm;
/** The bounding box for this font. */
- private int[] bbox = new int[PsBoundingBox.BBOX_ENTRIES];
+ private int[] bbox = new int[BoundingBox.QTY_ENTRIES];
/** The parsed "indexToLocFormat" value from this table. */
private int indexToLocFormat;
@@ -92,13 +92,13 @@
/* Skip modified date. */
raInput.skipBytes(LONG_DATE_TIME_BYTES);
/* Read the bounding box. */
- head.bbox[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX]
+ head.bbox[BoundingBox.LOWER_LEFT_X_INDEX]
= raInput.readShort();
- head.bbox[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX]
+ head.bbox[BoundingBox.LOWER_LEFT_Y_INDEX]
= raInput.readShort();
- head.bbox[PsBoundingBox.BBOX_UPPER_RIGHT_X_INDEX]
+ head.bbox[BoundingBox.UPPER_RIGHT_X_INDEX]
= raInput.readShort();
- head.bbox[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX]
+ head.bbox[BoundingBox.UPPER_RIGHT_Y_INDEX]
= raInput.readShort();
/* Skip macStyle. */
raInput.skipBytes(USHORT_BYTES);
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 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -32,8 +32,8 @@
import org.foray.font.format.Kerning;
import org.foray.font.output.FontPdfUtilities;
+import org.axsl.common.data.BoundingBox;
import org.axsl.ps.CharSet;
-import org.axsl.ps.PsBoundingBox;
import org.axsl.ps.PsEncoding;
import java.io.Serializable;
@@ -133,7 +133,7 @@
private int dfMinWidth;
/** The parsed bounding box. */
- private int[] fontBBox = new int[PsBoundingBox.BBOX_ENTRIES];
+ private int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
/** The parsed cap height. */
private int etmCapHeight;
@@ -383,7 +383,7 @@
*/
public void setFontBBox(final int index, final int value) {
if (index < 0
- || index >= PsBoundingBox.BBOX_ENTRIES) {
+ || index >= BoundingBox.QTY_ENTRIES) {
return;
}
this.fontBBox[index] = value;
@@ -740,20 +740,20 @@
* @return The font bounding box.
*/
private int[] computeFontBBox() {
- final int[] bbox = new int[PsBoundingBox.BBOX_ENTRIES];
+ final int[] bbox = new int[BoundingBox.QTY_ENTRIES];
// Just guessing....
if (!getIsProportional() && (getAverageWidth() == getMaxWidth())) {
- bbox[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX] = EST_BBOX_LL_X_FIXED;
+ bbox[BoundingBox.LOWER_LEFT_X_INDEX] = EST_BBOX_LL_X_FIXED;
} else {
- bbox[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX] =
+ bbox[BoundingBox.LOWER_LEFT_X_INDEX] =
EST_BBOX_LL_X_PROPORTIONAL;
}
- bbox[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX] = -(getLowerCaseDescent()
+ bbox[BoundingBox.LOWER_LEFT_Y_INDEX] = -(getLowerCaseDescent()
+ EST_BBOX_LL_Y_ADJUST);
- bbox[PsBoundingBox.BBOX_UPPER_RIGHT_X_INDEX] = getMaxWidth()
+ bbox[BoundingBox.UPPER_RIGHT_X_INDEX] = getMaxWidth()
+ EST_BBOX_UR_X_ADJUST;
- bbox[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX] = getLowerCaseAscent()
+ bbox[BoundingBox.UPPER_RIGHT_Y_INDEX] = getLowerCaseAscent()
+ EST_BBOX_UR_Y_ADJUST;
return bbox;
}
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 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -34,11 +34,11 @@
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.Font;
import org.axsl.font.FontException;
import org.axsl.ps.CharSet;
import org.axsl.ps.GlyphList;
-import org.axsl.ps.PsBoundingBox;
import org.axsl.ps.PsEncoding;
import org.axsl.ps.PsServer;
@@ -1114,7 +1114,7 @@
* Process a "FontBBox" keyword.
*/
private void fontBBox() {
- for (int i = 0; i < PsBoundingBox.BBOX_ENTRIES; i++) {
+ for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
this.metrics.setFontBBox(i, Math.round(getFloat()));
}
}
@@ -1204,7 +1204,7 @@
*/
private void b() {
/* Ignore bounding box for now. */
- for (int i = 0; i < PsBoundingBox.BBOX_ENTRIES; i++) {
+ for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
burnToken();
}
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -33,10 +33,10 @@
import org.foray.common.ps.BoundingBox4a;
import org.foray.common.sequence.ByteArray;
+import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.ps.PsBoundingBox;
import java.awt.Color;
import java.awt.color.ColorSpace;
@@ -81,8 +81,8 @@
/** The name of this EPS graphic. */
private String docName;
- /** Array containing the bounding box. */
- private PsBoundingBox bbox;
+ /** The bounding box. */
+ private BoundingBox bbox;
/** Indicates whether this EPS is in ASCII format (true) or in binary format
* (false). */
@@ -203,12 +203,12 @@
}
readBBox(fileStart);
if (this.bbox != null) {
- final float xUR = this.bbox.upperRightX();
- final float xLL = this.bbox.lowerLeftX();
+ final float xUR = this.bbox.getUpperRightX();
+ final float xLL = this.bbox.getLowerLeftX();
final float pixelWidth = xUR - xLL;
this.pixelWidth = Math.round(pixelWidth);
- final float yUR = this.bbox.upperRightY();
- final float yLL = this.bbox.lowerLeftY();
+ final float yUR = this.bbox.getUpperRightY();
+ final float yLL = this.bbox.getLowerLeftY();
final float pixelHeight = yUR - yLL;
this.pixelHeight = Math.round(pixelHeight);
} else {
@@ -265,8 +265,8 @@
}
// i now holds the index of the *start* of bbxName + 1. Skip past it.
index += bbxName.length - 1;
- final float[] bboxArray = new float[PsBoundingBox.BBOX_ENTRIES];
- for (int i = 0; i < PsBoundingBox.BBOX_ENTRIES; i++) {
+ final float[] bboxArray = new float[BoundingBox.QTY_ENTRIES];
+ for (int i = 0; i < BoundingBox.QTY_ENTRIES; i++) {
index += readBBoxString(fileStart, i, index, bboxArray);
}
this.bbox = new BoundingBox4a(bboxArray);
@@ -320,7 +320,7 @@
}
@Override
- public PsBoundingBox getBoundingBox() {
+ public BoundingBox getBoundingBox() {
return this.bbox;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfFormXobject.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -28,10 +28,10 @@
package org.foray.pdf.object;
+import org.axsl.common.data.BoundingBox;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.pdf.PdfException;
-import org.axsl.ps.PsBoundingBox;
import java.awt.geom.AffineTransform;
@@ -102,11 +102,11 @@
@Override
protected String specialXObjectDictEntries(final PdfDocument4a doc) throws GraphicException {
- final PsBoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.lowerLeftX();
- final float lly = boundingBox.lowerLeftY();
- final float urx = boundingBox.upperRightX();
- final float ury = boundingBox.upperRightY();
+ final BoundingBox boundingBox = this.getBoundingBox();
+ final float llx = boundingBox.getLowerLeftX();
+ final float lly = boundingBox.getLowerLeftY();
+ final float urx = boundingBox.getUpperRightX();
+ final float ury = boundingBox.getUpperRightY();
final StringBuilder buffer = new StringBuilder();
buffer.append("/FormType 1" + EOL);
buffer.append("/BBox [");
@@ -134,7 +134,7 @@
* @return The bounding box for this graphic.
* @exception GraphicException For errors during parsing of the graphic content.
*/
- protected abstract PsBoundingBox getBoundingBox() throws GraphicException;
+ protected abstract BoundingBox getBoundingBox() throws GraphicException;
/**
* Returns any special entries that should be added to the XForm dictionary.
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -30,9 +30,9 @@
import org.foray.common.sequence.ByteArray;
+import org.axsl.common.data.BoundingBox;
import org.axsl.graphic.EpsGraphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.ps.PsBoundingBox;
import org.axsl.ps.PsException;
import org.axsl.ps.PsInput;
import org.axsl.ps.PsInterpreter;
@@ -91,7 +91,7 @@
public float getHorizontalScaling(
final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicWidth = eps.getBoundingBox().width();
+ final float graphicWidth = eps.getBoundingBox().getWidth();
return contentRectangle.width / graphicWidth;
}
@@ -98,7 +98,7 @@
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) {
final EpsGraphic eps = this.getGraphic();
- final float graphicHeight = eps.getBoundingBox().height();
+ final float graphicHeight = eps.getBoundingBox().getHeight();
return contentRectangle.height / graphicHeight;
}
@@ -108,7 +108,7 @@
}
@Override
- protected PsBoundingBox getBoundingBox() {
+ protected BoundingBox getBoundingBox() {
return this.graphic.getBoundingBox();
}
@@ -119,9 +119,9 @@
@Override
protected AffineTransform getUserSpaceTransform() {
- final PsBoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.lowerLeftX();
- final float lly = boundingBox.lowerLeftY();
+ final BoundingBox boundingBox = this.getBoundingBox();
+ final float llx = boundingBox.getLowerLeftX();
+ final float lly = boundingBox.getLowerLeftY();
float xTranslate = 0;
if (llx < 0) {
/* If the bounding box of the graphic is negative, adjust it up to
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -32,12 +32,12 @@
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontConsumer;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.MathGraphic;
import org.axsl.graphic.output.GraphicOutput;
import org.axsl.graphic.output.GraphicPdf;
-import org.axsl.ps.PsBoundingBox;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
@@ -85,13 +85,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().width();
+ final float graphicWidth = getBoundingBox().getWidth();
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().height();
+ final float graphicHeight = getBoundingBox().getHeight();
return contentRectangle.height / graphicHeight;
}
@@ -101,14 +101,12 @@
}
@Override
- protected PsBoundingBox getBoundingBox() throws GraphicException {
- final float[] box = new float[PsBoundingBox.BBOX_ENTRIES];
- box[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX] = 0;
- box[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX] = 0;
- box[PsBoundingBox.BBOX_UPPER_RIGHT_X_INDEX] =
- this.getGraphic().pixelWidth();
- box[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX] =
- this.getGraphic().pixelHeight();
+ protected BoundingBox getBoundingBox() throws GraphicException {
+ final float[] box = new float[BoundingBox.QTY_ENTRIES];
+ box[BoundingBox.LOWER_LEFT_X_INDEX] = 0;
+ box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
+ box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
+ box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
return new BoundingBox4a(box);
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -32,12 +32,12 @@
import org.foray.common.ps.BoundingBox4a;
import org.foray.pdf.util.PdfGraphics2D;
+import org.axsl.common.data.BoundingBox;
import org.axsl.font.FontConsumer;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
import org.axsl.graphic.output.GraphicOutput;
import org.axsl.graphic.output.GraphicPdf;
-import org.axsl.ps.PsBoundingBox;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
@@ -85,13 +85,13 @@
@Override
public float getHorizontalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicWidth = getBoundingBox().width();
+ final float graphicWidth = getBoundingBox().getWidth();
return contentRectangle.width / graphicWidth;
}
@Override
public float getVerticalScaling(final Rectangle2D.Float contentRectangle) throws GraphicException {
- final float graphicHeight = getBoundingBox().height();
+ final float graphicHeight = getBoundingBox().getHeight();
return contentRectangle.height / graphicHeight;
}
@@ -101,14 +101,12 @@
}
@Override
- protected PsBoundingBox getBoundingBox() throws GraphicException {
- final float[] box = new float[PsBoundingBox.BBOX_ENTRIES];
- box[PsBoundingBox.BBOX_LOWER_LEFT_X_INDEX] = 0;
- box[PsBoundingBox.BBOX_LOWER_LEFT_Y_INDEX] = 0;
- box[PsBoundingBox.BBOX_UPPER_RIGHT_X_INDEX] =
- this.getGraphic().pixelWidth();
- box[PsBoundingBox.BBOX_UPPER_RIGHT_Y_INDEX] =
- this.getGraphic().pixelHeight();
+ protected BoundingBox getBoundingBox() throws GraphicException {
+ final float[] box = new float[BoundingBox.QTY_ENTRIES];
+ box[BoundingBox.LOWER_LEFT_X_INDEX] = 0;
+ box[BoundingBox.LOWER_LEFT_Y_INDEX] = 0;
+ box[BoundingBox.UPPER_RIGHT_X_INDEX] = this.getGraphic().pixelWidth();
+ box[BoundingBox.UPPER_RIGHT_Y_INDEX] = this.getGraphic().pixelHeight();
return new BoundingBox4a(box);
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXreference.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -30,11 +30,11 @@
import org.foray.common.ps.BoundingBox4a;
+import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.pdf.PdfException;
-import org.axsl.ps.PsBoundingBox;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
@@ -99,7 +99,7 @@
}
@Override
- protected PsBoundingBox getBoundingBox() {
+ protected BoundingBox getBoundingBox() {
/* TODO: Implement this. */
return new BoundingBox4a(0, 0, 0, 0);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/type1/PsFontDictionary4a.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -34,7 +34,7 @@
import org.foray.ps.PsInteger;
import org.foray.ps.PsObject;
-import org.axsl.ps.PsBoundingBox;
+import org.axsl.common.data.BoundingBox;
import org.axsl.ps.PsFontDictionary;
/**
@@ -109,10 +109,10 @@
return null;
}
final PsArray psarray = (PsArray) object;
- if (psarray.size() != PsBoundingBox.BBOX_ENTRIES) {
+ if (psarray.size() != BoundingBox.QTY_ENTRIES) {
return null;
}
- final int[] fontBBox = new int[PsBoundingBox.BBOX_ENTRIES];
+ final int[] fontBBox = new int[BoundingBox.QTY_ENTRIES];
for (int i = 0; i < psarray.size(); i++) {
final Object arrayItem = psarray.get(i);
if (arrayItem instanceof PsInteger) {
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-27 17:45:47 UTC (rev 11869)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2021-01-27 23:21:31 UTC (rev 11870)
@@ -42,6 +42,7 @@
import org.foray.render.PrintRenderer;
import org.axsl.common.Gradient;
+import org.axsl.common.data.BoundingBox;
import org.axsl.common.sequence.ByteSequence;
import org.axsl.common.sequence.IntSequence;
import org.axsl.common.value.RuleStyle;
@@ -67,7 +68,6 @@
import org.axsl.output.DocumentConfiguration;
import org.axsl.output.OutputException;
import org.axsl.ps.Encoding;
-import org.axsl.ps.PsBoundingBox;
import org.axsl.ps.PsEncoding;
import org.axsl.ps.PsFilterType;
import org.axsl.ps.PsServer;
@@ -671,9 +671,9 @@
*/
public byte[] epsToPostScript(final EpsGraphic image, final int x,
final int y, final int w, final int h) throws GraphicException {
- final PsBoundingBox bbox = image.getBoundingBox();
- final float bboxw = bbox.width();
- final float bboxh = bbox.height();
+ final BoundingBox bbox = image.getBoundingBox();
+ final float bboxw = bbox.getWidth();
+ final float bboxh = bbox.getHeight();
StringBuilder buffer = new StringBuilder();
buffer.append("%%BeginDocument: " + image.getName());
@@ -682,8 +682,8 @@
buffer.append(x + " " + (y - h) + " translate");
buffer.append("0.0 rotate");
buffer.append((long) (w / bboxw) + " " + (long) (h / bboxh) + " scale");
- buffer.append(-bbox.lowerLeftX() + " " + (-bbox.lowerLeftY()) + " translate");
- buffer.append(bbox.lowerLeftX() + " " + bbox.lowerLeftY() + " " + bboxw + " " + bboxh
+ buffer.append(-bbox.getLowerLeftX() + " " + (-bbox.getLowerLeftY()) + " translate");
+ buffer.append(bbox.getLowerLeftX() + " " + bbox.getLowerLeftY() + " " + bboxw + " " + bboxh
+ " rectclip");
buffer.append("newpath");
final String string1 = buffer.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-27 17:45:49
|
Revision: 11869
http://sourceforge.net/p/foray/code/11869
Author: victormote
Date: 2021-01-27 17:45:47 +0000 (Wed, 27 Jan 2021)
Log Message:
-----------
Conform to aXSL change adding method to select a font that can encode a specific code point.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
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 2021-01-27 17:43:34 UTC (rev 11868)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2021-01-27 17:45:47 UTC (rev 11869)
@@ -348,6 +348,12 @@
}
@Override
+ public FontUse selectFontFallback(final int codePoint) {
+ /* TODO: Implement this. */
+ return null;
+ }
+
+ @Override
public FontUse4a selectFontFallback() {
final RegisteredFontFamilyMember fontDescSelected = selectDefaultFont();
if (fontDescSelected == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-27 17:43:37
|
Revision: 11868
http://sourceforge.net/p/foray/code/11868
Author: victormote
Date: 2021-01-27 17:43:34 +0000 (Wed, 27 Jan 2021)
Log Message:
-----------
Rename RegisteredFontDesc to RegisteredFontFamilyMember for clarity.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.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/ConfigParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.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/RegisteredFontFamilyMember.java
Removed Paths:
-------------
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -28,7 +28,7 @@
package org.foray.font;
-import org.foray.font.config.RegisteredFontDesc;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.axsl.ps.Encoding;
import org.axsl.ps.PsEncoding;
@@ -174,7 +174,7 @@
* returned font use.
* @return The best font use.
*/
- public FontUse4a selectFontUse(final RegisteredFontDesc rfd,
+ public FontUse4a selectFontUse(final RegisteredFontFamilyMember rfd,
final int codePoint) {
if (rfd == null) {
return null;
@@ -229,7 +229,7 @@
* or created.
* @return The selected or created font use.
*/
- public FontUse4a getFontUse(final RegisteredFontDesc rfd,
+ public FontUse4a getFontUse(final RegisteredFontFamilyMember rfd,
final Encoding encoding) {
for (int i = 0; i < this.fontUses.size(); i++) {
final FontUse4a fontUse = this.fontUses.get(i);
@@ -250,7 +250,7 @@
* @param codePoint The Unicode code point.
* @return The appropriate encoding.
*/
- public Encoding findEncoding(final RegisteredFontDesc rfd,
+ public Encoding findEncoding(final RegisteredFontFamilyMember rfd,
final int codePoint) {
switch (this.consumer.getEncodingLatitude()) {
case FontConsumer4a.ENCODING_SPECIFIED_ONLY: {
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 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -29,8 +29,8 @@
package org.foray.font;
import org.foray.font.config.RegisteredFont;
-import org.foray.font.config.RegisteredFontDesc;
import org.foray.font.config.RegisteredFontFamily;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.foray.font.format.Panose4a;
import org.axsl.font.Font;
@@ -65,7 +65,7 @@
/**
* Constant indicating that only the encoding specified in the
- * {@link RegisteredFontDesc} (from the font-configuration) should be used
+ * {@link RegisteredFontFamilyMember} (from the font-configuration) should be used
* during the font selection process.
*/
public static final byte ENCODING_SPECIFIED_ONLY = 2;
@@ -287,7 +287,7 @@
final Font.Weight weight, final Font.Variant variant,
final Font.Stretch stretch, final int size, final int codePoint) {
final FontSelector selector = getFontSelector(selectionStrategy);
- final RegisteredFontDesc fontDescSelected;
+ final RegisteredFontFamilyMember fontDescSelected;
try {
fontDescSelected = selector.selectFont(familyList, style, weight, variant, stretch, size, codePoint);
} catch (final FontException e) {
@@ -323,7 +323,7 @@
* @throws FontException For errors in font selection.
*/
private org.axsl.font.FontUse getFontUse(
- final RegisteredFontDesc fontDescSelected, final int codePoint)
+ final RegisteredFontFamilyMember fontDescSelected, final int codePoint)
throws FontException {
Font4a fontSelected = null;
if (fontDescSelected != null) {
@@ -349,7 +349,7 @@
@Override
public FontUse4a selectFontFallback() {
- final RegisteredFontDesc fontDescSelected = selectDefaultFont();
+ final RegisteredFontFamilyMember fontDescSelected = selectDefaultFont();
if (fontDescSelected == null) {
return null;
}
@@ -367,7 +367,7 @@
}
/**
- * <p>Since {@link RegisteredFont} and {@link RegisteredFontDesc} instances
+ * <p>Since {@link RegisteredFont} and {@link RegisteredFontFamilyMember} instances
* can encapsulate either a FreeStandingFont or a SystemFont, or both,
* this method selects which one should be used, based on the FontConsumer
* instances parameters.</p>
@@ -385,7 +385,7 @@
* that it can be encoded.
* @return The FontUse instance dictated by the parameters of consumer.
*/
- protected Font4a whichUse(final RegisteredFontDesc rfd,
+ protected Font4a whichUse(final RegisteredFontFamilyMember rfd,
final int codePoint) {
final RegisteredFont rf = rfd.getRegisteredFont();
@@ -423,7 +423,7 @@
* eligible, or null otherwise.
*/
private FreeStandingFont eligibleFreeStandingFont(
- final RegisteredFontDesc rfd, final int codePoint) {
+ final RegisteredFontFamilyMember rfd, final int codePoint) {
if (! isUsingFreeStandingFonts()) {
return null;
}
@@ -471,8 +471,8 @@
* Returns the default font.
* @return The default font.
*/
- private RegisteredFontDesc selectDefaultFont() {
- RegisteredFontDesc defaultFont = null;
+ private RegisteredFontFamilyMember selectDefaultFont() {
+ RegisteredFontFamilyMember defaultFont = null;
if (isUsingFreeStandingFonts()) {
defaultFont = this.server.getDefaultFreeStandingFont();
}
@@ -621,11 +621,11 @@
} catch (final FontException e) {
return null;
}
- RegisteredFontDesc bestFit = null;
+ RegisteredFontFamilyMember bestFit = null;
long bestDifference = Long.MAX_VALUE;
for (RegisteredFontFamily rff : this.server.registeredFontFamilies()) {
for (int i = 0; i < rff.getFontDescriptions().size(); i++) {
- final RegisteredFontDesc rfd = rff.getFontDescriptions().get(i);
+ final RegisteredFontFamilyMember rfd = rff.getFontDescriptions().get(i);
final Panose4a panoseInstance = rfd.getRegisteredFont()
.getPanose();
final long difference = panoseInstance.difference(desiredPanose, null);
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontSelector.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontSelector.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontSelector.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -28,7 +28,7 @@
package org.foray.font;
-import org.foray.font.config.RegisteredFontDesc;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.axsl.font.Font;
import org.axsl.font.FontException;
@@ -68,7 +68,7 @@
* criteria.
* @throws FontException For invalid input.
*/
- public abstract RegisteredFontDesc selectFont(List<String> familyList,
+ public abstract RegisteredFontFamilyMember selectFont(List<String> familyList,
Font.Style style, Font.Weight weight, Font.Variant variant,
Font.Stretch stretch, int size, int codePoint) throws FontException;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -28,8 +28,8 @@
package org.foray.font;
-import org.foray.font.config.RegisteredFontDesc;
import org.foray.font.config.RegisteredFontFamily;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.axsl.font.Font;
import org.axsl.font.FontException;
@@ -59,12 +59,12 @@
}
@Override
- public RegisteredFontDesc selectFont(final List<String> familyList,
+ public RegisteredFontFamilyMember selectFont(final List<String> familyList,
final Font.Style style, final Font.Weight weight,
final Font.Variant variant, final Font.Stretch stretch,
final int size, final int codePoint) throws FontException {
Font4a fontSelected = null;
- RegisteredFontDesc fontDescSelected = null;
+ RegisteredFontFamilyMember fontDescSelected = null;
if (familyList != null) {
for (int i = 0; i < familyList.size(); i++) {
final String familyToUse = familyList.get(i);
@@ -101,7 +101,7 @@
* @return The registered font description matching the selection criteria,
* or null if there is none.
*/
- private RegisteredFontDesc selectFont(final String familyToTry,
+ private RegisteredFontFamilyMember selectFont(final String familyToTry,
final Font.Style style, final Font.Weight weight,
final Font.Variant variant, final Font.Stretch stretch,
final int size) {
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 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -32,8 +32,8 @@
import org.foray.common.url.classpath.Handler;
import org.foray.font.config.ConfigParser;
import org.foray.font.config.RegisteredFont;
-import org.foray.font.config.RegisteredFontDesc;
import org.foray.font.config.RegisteredFontFamily;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.foray.font.format.FontParserClient;
import org.axsl.font.FontException;
@@ -129,11 +129,11 @@
/** This is the FreeStandingFont that should be used when a FreeStandingFont
* is required and all other fallback options fail. */
- private RegisteredFontDesc defaultFreeStandingFont = null;
+ private RegisteredFontFamilyMember defaultFreeStandingFont = null;
/** This is the SystemFont that should be used when a SystemFont
* is required and all other fallback options fail. */
- private RegisteredFontDesc defaultSystemFont = null;
+ private RegisteredFontFamilyMember defaultSystemFont = null;
/** An EntityResolver to be used by XML parsers (for handling DTD catalogs,
* etc.). */
@@ -198,7 +198,7 @@
* Returns the fallback free-standing font when no other font can be used.
* @return The fallback free-standing font.
*/
- public RegisteredFontDesc getDefaultFreeStandingFont() {
+ public RegisteredFontFamilyMember getDefaultFreeStandingFont() {
if (this.defaultFreeStandingFont != null) {
return this.defaultFreeStandingFont;
}
@@ -214,7 +214,7 @@
* Returns the fallback system font when no other font can be used.
* @return The fallback system font.
*/
- protected RegisteredFontDesc getDefaultSystemFont() {
+ protected RegisteredFontFamilyMember getDefaultSystemFont() {
if (this.defaultSystemFont != null) {
return this.defaultSystemFont;
}
@@ -242,9 +242,9 @@
* sought or system fonts (mutually exclusive).
* @return A default registered font description.
*/
- protected RegisteredFontDesc getDefaultFont(
+ protected RegisteredFontFamilyMember getDefaultFont(
final boolean freeStandingFont) {
- RegisteredFontDesc defaultFont = null;
+ RegisteredFontFamilyMember defaultFont = null;
final RegisteredFontFamily rff = getRegisteredFontFamily("any");
if (rff != null) {
/* Try to find one with normal characteristics. */
@@ -658,7 +658,7 @@
= org.axsl.font.Font.Variant.NORMAL;
final org.axsl.font.Font.Stretch fontStretch
= org.axsl.font.Font.Stretch.NORMAL;
- new RegisteredFontDesc(rf, rff, null, fontStyle, fontWeight,
+ new RegisteredFontFamilyMember(rf, rff, null, fontStyle, fontWeight,
fontVariant, fontStretch);
try {
rff.registerFontDesc(rf,
@@ -857,11 +857,11 @@
public List<Font4a> getAllFonts(final boolean freeStandingFonts, final boolean systemFonts) {
final List<Font4a> fontList = new ArrayList<Font4a>();
for (RegisteredFontFamily family : this.fontFamilies.values()) {
- final List<RegisteredFontDesc> rfdList
+ final List<RegisteredFontFamilyMember> rfdList
= family.getFontDescriptions();
if (rfdList != null) {
for (int i = 0; i < rfdList.size(); i++) {
- final RegisteredFontDesc rfd = rfdList.get(i);
+ final RegisteredFontFamilyMember rfd = rfdList.get(i);
final RegisteredFont rf = rfd.getRegisteredFont();
if (freeStandingFonts
&& rf.getFreeStandingFont() != null) {
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 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -33,7 +33,7 @@
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.sequence.ByteArray;
import org.foray.common.sequence.IntArrayBuilder;
-import org.foray.font.config.RegisteredFontDesc;
+import org.foray.font.config.RegisteredFontFamilyMember;
import org.foray.font.format.ttf.TrueTypeFont;
import org.foray.font.format.ttf.TtfTableGsub;
import org.foray.font.format.type1.Type1Font;
@@ -82,7 +82,7 @@
private Encoding encoding;
/** The encapsulated registeredFontDesc. */
- private RegisteredFontDesc registeredFontDesc;
+ private RegisteredFontFamilyMember registeredFontDesc;
/** Indicates whether this has been used at all. */
private boolean anyCharsUsed = false;
@@ -94,7 +94,7 @@
* @param encoding The specific encoding for this font use.
*/
public FontUse4a(final ConsumerFont4a consumerFont,
- final RegisteredFontDesc rfd, final Encoding encoding) {
+ final RegisteredFontFamilyMember rfd, final Encoding encoding) {
this.consumerFont = consumerFont;
this.registeredFontDesc = rfd;
this.encoding = encoding;
@@ -207,7 +207,7 @@
@Override
public Font.Weight nextBolderWeight() {
- final RegisteredFontDesc desc =
+ final RegisteredFontFamilyMember desc =
this.registeredFontDesc.nextBolderFont();
if (desc != null) {
return desc.getFontWeight();
@@ -217,7 +217,7 @@
@Override
public Font.Weight nextLighterWeight() {
- final RegisteredFontDesc desc =
+ final RegisteredFontFamilyMember desc =
this.registeredFontDesc.nextLighterFont();
if (desc != null) {
return desc.getFontWeight();
@@ -227,7 +227,7 @@
@Override
public org.axsl.font.FontUse nextBolderFont() {
- final RegisteredFontDesc desc =
+ final RegisteredFontFamilyMember desc =
this.registeredFontDesc.nextBolderFont();
return fontUseForDesc(desc);
}
@@ -234,7 +234,7 @@
@Override
public org.axsl.font.FontUse nextLighterFont() {
- final RegisteredFontDesc desc =
+ final RegisteredFontFamilyMember desc =
this.registeredFontDesc.nextLighterFont();
return fontUseForDesc(desc);
}
@@ -241,13 +241,13 @@
/**
* Finds the FontUse instance that should be used for a given
- * {@link RegisteredFontDesc} instance.
+ * {@link RegisteredFontFamilyMember} instance.
* @param desc The registered font description for which a FontUse is
* needed.
* @return The appropriate FontUse instance.
*/
private org.axsl.font.FontUse fontUseForDesc(
- final RegisteredFontDesc desc) {
+ final RegisteredFontFamilyMember desc) {
if (desc == null) {
return null;
}
@@ -474,7 +474,7 @@
* Returns the parent registered font description.
* @return The parent registered font description.
*/
- public RegisteredFontDesc getRegisteredFontDesc() {
+ public RegisteredFontFamilyMember getRegisteredFontDesc() {
return this.registeredFontDesc;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfigParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfigParser.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfigParser.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -476,22 +476,22 @@
encoding = this.fontServer.getPsServer().getPredefinedEncoding(encodingName);
}
final String[] simulateStretch
- = new String[RegisteredFontDesc.QTY_SIMULATED_STRETCH];
- simulateStretch[RegisteredFontDesc.SIMULATE_ULTRA_CONDENSED_INDEX]
+ = new String[RegisteredFontFamilyMember.QTY_SIMULATED_STRETCH];
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_ULTRA_CONDENSED_INDEX]
= attributes.getValue("simulate-ultra-condensed");
- simulateStretch[RegisteredFontDesc.SIMULATE_EXTRA_CONDENSED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_EXTRA_CONDENSED_INDEX]
= attributes.getValue("simulate-extra-condensed");
- simulateStretch[RegisteredFontDesc.SIMULATE_CONDENSED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_CONDENSED_INDEX]
= attributes.getValue("simulate-condensed");
- simulateStretch[RegisteredFontDesc.SIMULATE_SEMI_CONDENSED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_SEMI_CONDENSED_INDEX]
= attributes.getValue("simulate-semi-condensed");
- simulateStretch[RegisteredFontDesc.SIMULATE_SEMI_EXPANDED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_SEMI_EXPANDED_INDEX]
= attributes.getValue("simulate-semi-expanded");
- simulateStretch[RegisteredFontDesc.SIMULATE_EXPANDED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_EXPANDED_INDEX]
= attributes.getValue("simulate-expanded");
- simulateStretch[RegisteredFontDesc.SIMULATE_EXTRA_EXPANDED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_EXTRA_EXPANDED_INDEX]
= attributes.getValue("simulate-extra-expanded");
- simulateStretch[RegisteredFontDesc.SIMULATE_ULTRA_EXPANDED_INDEX]
+ simulateStretch[RegisteredFontFamilyMember.SIMULATE_ULTRA_EXPANDED_INDEX]
= attributes.getValue("simulate-ultra-expanded");
this.currentFontFamilyMember = new FontFamilyMember(
encoding,
Deleted: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -1,807 +0,0 @@
-/*
- * 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.font.config;
-
-import org.foray.common.WellKnownConstants;
-import org.foray.font.Font4a;
-
-import org.axsl.font.Font;
-import org.axsl.font.FontServer;
-import org.axsl.ps.Encoding;
-
-/**
- * <p>RegisteredFontDesc encapsulates the set of characteristics about how a
- * font is used.
- * An RFD instance has one {@link RegisteredFontFamily} parent, which provides
- * the font-family context in which it can be selected, and one
- * {@link RegisteredFont} parent, which provides the link to the actual font.
- * It is analogous to the font-description element in the font configuration,
- * and is typically created directly as that is parsed.</p>
- *
- * <p>An RFD instance is primarily in font resolution, where its
- * characteristics are comapared, in the context of the parent
- * RegisteredFontFamily font family, to those requested by the font selection
- * process.
- */
-public class RegisteredFontDesc {
-
- /** Constant indicating the number of simulated "stretch" components. */
- public static final byte QTY_SIMULATED_STRETCH = 8;
-
- /** Constant indicating the index for the "ultra-condensed" simulated
- * stretch bucket. */
- public static final byte SIMULATE_ULTRA_CONDENSED_INDEX = 0;
-
- /** Constant indicating the index for the "extra-condensed" simulated
- * stretch bucket. */
- public static final byte SIMULATE_EXTRA_CONDENSED_INDEX = 1;
-
- /** Constant indicating the index for the "condensed" simulated
- * stretch bucket. */
- public static final byte SIMULATE_CONDENSED_INDEX = 2;
-
- /** Constant indicating the index for the "semi-condensed" simulated
- * stretch bucket. */
- public static final byte SIMULATE_SEMI_CONDENSED_INDEX = 3;
-
- /** Constant indicating the index for the "semi-expanded" simulated
- * stretch bucket. */
- public static final byte SIMULATE_SEMI_EXPANDED_INDEX = 4;
-
- /** Constant indicating the index for the "expanded" simulated
- * stretch bucket. */
- public static final byte SIMULATE_EXPANDED_INDEX = 5;
-
- /** Constant indicating the index for the "extra-expanded" simulated
- * stretch bucket. */
- public static final byte SIMULATE_EXTRA_EXPANDED_INDEX = 6;
-
- /** Constant indicating the index for the "ultra-expanded" simulated
- * stretch bucket. */
- public static final byte SIMULATE_ULTRA_EXPANDED_INDEX = 7;
-
- /** The parent RegisteredFont instance. */
- private RegisteredFont registeredFont;
-
- /** The parent RegisteredFontFamily instance. */
- private RegisteredFontFamily registeredFontFamily;
-
- /** The encoding to be used. */
- private Encoding encoding;
-
- /** The style of this description. */
- private Font.Style fontStyle;
-
- /** The weight of this description. */
- private Font.Weight fontWeight;
-
- /** The variant value of this description. */
- private Font.Variant fontVariant;
-
- /** 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;
-
- /**
- * 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[RegisteredFontDesc.QTY_SIMULATED_STRETCH];
- {
- for (int i = 0; i < this.simulateStretch.length; i++) {
- this.simulateStretch[i] = FontServer.STRETCH_SIMULATION_INVALID;
- }
- }
-
- /**
- * Construct a FontDescription instance.
- * @param rf The parent registered font.
- * @param rff The parent registered font family.
- * @param encoding The specified encoding.
- * @param fontStyle The font style (normal, italic, etc.)
- * @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.)
- */
- public RegisteredFontDesc(final RegisteredFont rf,
- final RegisteredFontFamily rff, final Encoding encoding,
- final Font.Style fontStyle, final Font.Weight fontWeight,
- final Font.Variant fontVariant, final Font.Stretch fontStretch) {
- this.registeredFont = rf;
- this.registeredFontFamily = rff;
- this.encoding = encoding;
- this.fontStyle = fontStyle;
- this.fontWeight = fontWeight;
- this.fontVariant = fontVariant;
- this.fontStretch = fontStretch;
- }
-
- /**
- * Returns the font style.
- * @return The font style.
- */
- public Font.Style getFontStyle() {
- return this.fontStyle;
- }
-
- /**
- * Returns the font weight.
- * @return The font weight.
- */
- public Font.Weight getFontWeight() {
- return this.fontWeight;
- }
-
- /**
- * Return the font-variant for this registered description.
- * @return The font-variant value.
- */
- public Font.Variant getFontVariant() {
- return this.fontVariant;
- }
-
- /**
- * Return the font-stretch for this registered description.
- * @return The font-stretch value.
- */
- public Font.Stretch getFontStretch() {
- return this.fontStretch;
- }
-
- /**
- * 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(WellKnownConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps /= font.getAscender(WellKnownConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps *= WellKnownConstants.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(
- RegisteredFontDesc.SIMULATE_ULTRA_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "ultra-condensed" percentage.
- * @return The simulated "ultra-condensed" percentage.
- */
- public float getSimulateUltraCondensed() {
- return this.getSimulateStretch(
- RegisteredFontDesc.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(
- RegisteredFontDesc.SIMULATE_EXTRA_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "extra-condensed" percentage.
- * @return The simulated "extra-condensed" percentage.
- */
- public float getSimulateExtraCondensed() {
- return this.getSimulateStretch(
- RegisteredFontDesc.SIMULATE_EXTRA_CONDENSED_INDEX);
- }
-
- /**
- * Sets the simulated "condensed" percentage.
- * @param value The new simulated "condensed" percentage.
- */
- public void setSimulateCondensed(final float value) {
- this.setSimulateStretch(
- RegisteredFontDesc.SIMULATE_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "condensed" percentage.
- * @return The simulated "condensed" percentage.
- */
- public float getSimulateCondensed() {
- return this.getSimulateStretch(
- RegisteredFontDesc.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(
- RegisteredFontDesc.SIMULATE_SEMI_CONDENSED_INDEX, value);
- }
-
- /**
- * Returns the simulated "semi-condensed" percentage.
- * @return The simulated "semi-condensed" percentage.
- */
- public float getSimulateSemiCondensed() {
- return this.getSimulateStretch(
- RegisteredFontDesc.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(
- RegisteredFontDesc.SIMULATE_SEMI_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "semi-expanded" percentage.
- * @return The simulated "semi-expanded" percentage.
- */
- public float getSimulateSemiExpanded() {
- return this.getSimulateStretch(
- RegisteredFontDesc.SIMULATE_SEMI_EXPANDED_INDEX);
- }
-
- /**
- * Sets the simulated "expanded" percentage.
- * @param value The new simulated "expanded" percentage.
- */
- public void setSimulateExpanded(final float value) {
- this.setSimulateStretch(
- RegisteredFontDesc.SIMULATE_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "expanded" percentage.
- * @return The simulated "expanded" percentage.
- */
- public float getSimulateExpanded() {
- return this.getSimulateStretch(
- RegisteredFontDesc.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(
- RegisteredFontDesc.SIMULATE_EXTRA_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "extra-expanded" percentage.
- * @return The simulated "extra-expanded" percentage.
- */
- public float getSimulateExtraExpanded() {
- return this.getSimulateStretch(
- RegisteredFontDesc.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(
- RegisteredFontDesc.SIMULATE_ULTRA_EXPANDED_INDEX, value);
- }
-
- /**
- * Returns the simulated "ultra-expanded" percentage.
- * @return The simulated "ultra-expanded" percentage.
- */
- public float getSimulateUltraExpanded() {
- return this.getSimulateStretch(
- RegisteredFontDesc.SIMULATE_ULTRA_EXPANDED_INDEX);
- }
-
- /**
- * Returns the related registered font instance.
- * @return The related registered font instance.
- */
- public RegisteredFont getRegisteredFont() {
- return this.registeredFont;
- }
-
- /**
- * Returns the related registered font family instance.
- * @return The related registered font family instance.
- */
- public RegisteredFontFamily getRegisteredFontFamily() {
- return this.registeredFontFamily;
- }
-
- /**
- * Return the prescribed encoding for this description.
- * @return The prescribed encoding for this description.
- */
- public Encoding getEncoding() {
- return this.encoding;
- }
-
- /**
- * Returns the next bolder font in the font-family than this font.
- * @return The next bolder font in the font-family than this one.
- */
- public RegisteredFontDesc nextBolderFont() {
- return this.registeredFontFamily.nextBolderFont(this);
- }
-
- /**
- * Returns the next lighter font in the font-family than this font.
- * @return The next lighter font in the font-family than this one.
- */
- public RegisteredFontDesc nextLighterFont() {
- return this.registeredFontFamily.nextLighterFont(this);
- }
-
- /**
- * Determine whether two RegisteredFontDesc instances have the same set of
- * characteristics (font-weight, font-style, etc).
- * Note that, for purposes of this method, the encoding is not
- * considered to be a characteristic.
- * @param otherDesc A RegisteredFontDesc instance which should be compared
- * to this one.
- * @return True iff otherDesc has the same set of characteristics as this.
- */
- public boolean equivalent(final RegisteredFontDesc otherDesc) {
- return matchPerfect(otherDesc.getRegisteredFontFamily(),
- false,
- otherDesc.getFontStyle(),
- otherDesc.getFontWeight(),
- otherDesc.getFontVariant(),
- otherDesc.getFontStretch(),
- true,
- true);
- }
-
- /**
- * Determine whether two RegisteredFontDesc instances have the same set of
- * characteristics (font-family, font-style, etc), but without regard to
- * font-weight.
- * Note that, for purposes of this method, the encoding is not
- * considered to be a characteristic.
- * @param otherDesc A RegisteredFontDesc instance which should be compared
- * to this one.
- * @return True iff otherDesc has the same set of characteristics as this,
- * but without regard to font-weight.
- * In other words, if all other characteristics are equal, true will be
- * returned, regardless of whether font-weight is equal or not.
- */
- public boolean equivalentExceptWeight(final RegisteredFontDesc otherDesc) {
- return matchIgnoreWeight(otherDesc.getRegisteredFontFamily(),
- false,
- otherDesc.getFontStyle(),
- otherDesc.getFontVariant(),
- otherDesc.getFontStretch(),
- true,
- true);
- }
-
- /**
- * Indicates whether this font description matches a given style.
- * @param inputDesiredStyle The style to match.
- * @param considerSimulated Indicates whether simulated features should be
- * considered in the test.
- * @return True iff the style of this font description matches the criteria.
- */
- public boolean styleMatches(final Font.Style inputDesiredStyle,
- final boolean considerSimulated) {
- if (inputDesiredStyle == Font.Style.ANY) {
- return true;
- }
- if (considerSimulated) {
- if (this.simulateOblique != FontServer.OBLIQUE_SIMULATION_INVALID) {
- /* If it can simulate oblique, it can be used for either
- * oblique or italic or normal. */
- switch (inputDesiredStyle) {
- case NORMAL:
- case ITALIC:
- case OBLIQUE:
- case ANY: {
- return true;
- }
- case BACKSLANT:
- break;
- default:
- break;
- }
- }
- }
-
- Font.Style actualStyle = getFontStyle();
- /* Check the easy case first. */
- if (actualStyle == inputDesiredStyle) {
- return true;
- }
- /* If they are not equal, we need to treat "oblique" and "italic" as
- * equivalent. */
- if (actualStyle == Font.Style.OBLIQUE) {
- actualStyle = Font.Style.ITALIC;
- }
- Font.Style desiredStyle = inputDesiredStyle;
- if (inputDesiredStyle == Font.Style.OBLIQUE) {
- desiredStyle = Font.Style.ITALIC;
- }
- /* Test it again. */
- if (actualStyle == desiredStyle) {
- return true;
- }
- return false;
- }
-
- /**
- * Indicates whether this font description matches a given variant.
- * @param desiredVariant The variant to match.
- * @param considerSimulated Indicates whether simulated features should be
- * considered in the test.
- * @return True iff the style of this font description matches the criteria.
- */
- public boolean variantMatches(final Font.Variant desiredVariant,
- final boolean considerSimulated) {
- if (desiredVariant == Font.Variant.ANY) {
- return true;
- }
- if (considerSimulated) {
- if (this.simulateSmallCaps != FontServer.SMALL_CAP_SIMULATION_INVALID) {
- /* If it can simulate small-caps, it can be used for either
- * small-caps or normal. */
- return true;
- }
- }
- final Font.Variant actualVariant = getFontVariant();
- if (actualVariant == desiredVariant) {
- return true;
- }
- return false;
- }
-
- /**
- * Indicates whether this font description matches a given stretch.
- * @param desiredStretch The stretch to match.
- * @param considerSimulated Indicates whether simulated features should be
- * considered in the test.
- * @return True iff the style of this font description matches the criteria.
- */
- public boolean stretchMatches(final Font.Stretch desiredStretch,
- final boolean considerSimulated) {
- if (desiredStretch == Font.Stretch.ANY) {
- return true;
- }
- final Font.Stretch actualStretch = getFontStretch();
- if (actualStretch == desiredStretch) {
- 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 false;
- }
-
- /**
- * Indicates whether this font description matches a given weight.
- * @param desiredWeight The weight to match.
- * @return True iff the style of this font description matches the criteria.
- */
- public boolean weightMatches(final Font.Weight desiredWeight) {
- if (desiredWeight == Font.Weight.ANY) {
- return true;
- }
- final Font.Weight actualWeight = getFontWeight();
- if (actualWeight == desiredWeight) {
- return true;
- }
- return false;
- }
-
- /**
- * Indicates whether this font description perfectly matches a given set of
- * criteria.
- * @param family The desired font-family.
- * @param considerSimulated Indicates whether simulated features should be
- * considered in this selection.
- * @param style The desired style.
- * @param weight The desired weight.
- * @param variant The desired variant.
- * @param stretch The desired stretch.
- * @param freeStandingFonts Indicates whether free-standing fonts can be
- * considered in this selection.
- * @param systemFonts Indicates whether system fonts can be consdidered in
- * this selection.
- * @return True iff this font descriptions perfectly matches all of the
- * selection criteria.
- */
- public boolean matchPerfect(final RegisteredFontFamily family,
- final boolean considerSimulated, final Font.Style style,
- final Font.Weight weight, final Font.Variant variant,
- final Font.Stretch stretch, final boolean freeStandingFonts,
- final boolean systemFonts) {
- if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
- return false;
- }
- if (! matchIgnoreWeight(family, considerSimulated, style, variant,
- stretch, freeStandingFonts, systemFonts)) {
- return false;
- }
- if (! weightMatches(weight)) {
- return false;
- }
- return true;
- }
-
- /**
- * Indicates whether this font description matches a given set of criteria,
- * withour regard to the font-weight.
- * @param family The desired font-family.
- * @param considerSimulated Indicates whether simulated features should be
- * considered in this selection.
- * @param style The desired style.
- * @param variant The desired variant.
- * @param stretch The desired stretch.
- * @param freeStandingFonts Indicates whether free-standing fonts can be
- * considered in this selection.
- * @param systemFonts Indicates whether system fonts can be consdidered in
- * this selection.
- * @return True iff this font descriptions perfectly matches all of the
- * selection criteria.
- */
- public boolean matchIgnoreWeight(final RegisteredFontFamily family,
- final boolean considerSimulated, final Font.Style style,
- final Font.Variant variant, final Font.Stretch stretch,
- final boolean freeStandingFonts, final boolean systemFonts) {
- if (! generalTypeMatches(freeStandingFonts, systemFonts)) {
- return false;
- }
- /* First, make sure desc is in this font-family. */
- if (family != this.registeredFontFamily) {
- return false;
- }
- if (! styleMatches(style, considerSimulated)) {
- return false;
- }
- if (! variantMatches(variant, considerSimulated)) {
- return false;
- }
- if (! stretchMatches(stretch, considerSimulated)) {
- return false;
- }
- return true;
- }
-
- /**
- * Determines whether this registered font can return a Font instance that
- * matches the general type requested.
- * @param freeStandingFonts True iff the returned font can be a
- * FreeStandingFont.
- * @param systemFonts True iff the returned font can be a SystemFont.
- * @return True iff this registered font is able to return a Font instance
- * that matches the needs described by freeStandingFonts and systemFonts.
- */
- public boolean generalTypeMatches(final boolean freeStandingFonts,
- final boolean systemFonts) {
- if (freeStandingFonts && this.registeredFont.hasFreeStandingFont()) {
- return true;
- }
- if (systemFonts && this.registeredFont.hasSystemFont()) {
- return true;
- }
- 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 RegisteredFontDesc.SIMULATE_ULTRA_CONDENSED_INDEX;
- case EXTRA_CONDENSED:
- return RegisteredFontDesc.SIMULATE_EXTRA_CONDENSED_INDEX;
- case CONDENSED:
- return RegisteredFontDesc.SIMULATE_CONDENSED_INDEX;
- case SEMI_CONDENSED:
- return RegisteredFontDesc.SIMULATE_SEMI_CONDENSED_INDEX;
- case SEMI_EXPANDED:
- return RegisteredFontDesc.SIMULATE_SEMI_EXPANDED_INDEX;
- case EXPANDED:
- return RegisteredFontDesc.SIMULATE_EXPANDED_INDEX;
- case EXTRA_EXPANDED:
- return RegisteredFontDesc.SIMULATE_EXTRA_EXPANDED_INDEX;
- case ULTRA_EXPANDED:
- return RegisteredFontDesc.SIMULATE_ULTRA_EXPANDED_INDEX;
- default: return -1;
- }
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append(this.registeredFont.getConfiguredFontName());
- builder.append(", ");
- builder.append(this.registeredFontFamily.getName());
- builder.append(", ");
- final String encodingString = this.encoding == null ? "unspecified" : this.encoding.toString();
- builder.append(encodingString);
- builder.append(", ");
- builder.append(this.fontStyle.toString());
- builder.append(", ");
- builder.append(this.fontWeight.toString());
- builder.append(", ");
- builder.append(this.fontVariant.toString());
- builder.append(", ");
- builder.append(this.fontStretch.toString());
- builder.append("]");
- return builder.toString();
- }
-
-}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.java 2021-01-27 17:02:26 UTC (rev 11867)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -61,10 +61,10 @@
* in the font configuration. **/
private String name;
- /** Collection of {@link RegisteredFontDesc} instances that are associated
+ /** Collection of {@link RegisteredFontFamilyMember} instances that are associated
* with this family. */
- private List<RegisteredFontDesc> fontDescriptions
- = new ArrayList<RegisteredFontDesc>();
+ private List<RegisteredFontFamilyMember> fontDescriptions
+ = new ArrayList<RegisteredFontFamilyMember>();
/**
* Constructor.
@@ -134,7 +134,7 @@
final float simBackslant = convertPercent(simulatedBackslant,
FontServer.OBLIQUE_SIMULATION_INVALID);
final float[] simStretch
- = new float[RegisteredFontDesc.QTY_SIMULATED_STRETCH];
+ = new float[RegisteredFontFamilyMember.QTY_SIMULATED_STRETCH];
for (int i = 0; i < simStretch.length; i++) {
simStretch[i] = FontServer.STRETCH_SIMULATION_INVALID;
}
@@ -173,7 +173,7 @@
final float simulatedSmallCaps, final float simulatedOblique,
final float simulatedBackslant, final float[] simulatedStretch)
throws FontException {
- final RegisteredFontDesc description = new RegisteredFontDesc(
+ final RegisteredFontFamilyMember description = new RegisteredFontFamilyMember(
registeredFont, this, encoding, style, weight, variant,
stretch);
description.setSimulateSmallCaps(simulatedSmallCaps);
@@ -181,7 +181,7 @@
description.setSimulateBackslant(simulatedBackslant);
description.setSimulateStretch(simulatedStretch);
for (int i = 0; i < this.fontDescriptions.size(); i++) {
- final RegisteredFontDesc registeredDesc
+ final RegisteredFontFamilyMember registeredDesc
= this.fontDescriptions.get(i);
if (description.equivalent(registeredDesc)) {
throw new FontException("Equivalent font-description "
@@ -210,7 +210,7 @@
* @return The first matching RegisteredFontDesc found for this font-family,
* or null if none match.
*/
- public RegisteredFontDesc findRegisteredFontDesc(final Font.Style style,
+ public RegisteredFontFamilyMember findRegisteredFontDesc(final Font.Style style,
final Font.Weight weight, final Font.Variant variant,
final Font.Stretch stretch, final boolean freeStandingFonts,
final boolean systemFonts) {
@@ -230,14 +230,14 @@
* is, it is assigned the next darker assigned keyword, if any, or
* the next lightest otherwise. */
- final RegisteredFontDesc[] matches =
- new RegisteredFontDesc[RegisteredFontFamily.QTY_WEIGHT_VALUES];
- RegisteredFontDesc bestMatch = null;
+ final RegisteredFontFamilyMember[] matches =
+ new RegisteredFontFamilyMember[RegisteredFontFamily.QTY_WEIGHT_VALUES];
+ RegisteredFontFamilyMember bestMatch = null;
/* First, look for a perfect match without considering simulated
* features. */
for (int i = 0; i < this.fontDescriptions.size(); i++) {
- final RegisteredFontDesc fd = this.fontDescriptions.get(i);
+ final RegisteredFontFamilyMember fd = this.fontDescriptions.get(i);
if (fd.matchIgnoreWeight(this, false, style, variant, stretch,
freeStandingFonts, systemFonts)) {
if (weight == Font.Weight.ANY) {
@@ -256,7 +256,7 @@
/* Next, look for a perfect match that does consider the simulated
* features. */
for (int i = 0; i < this.fontDescriptions.size(); i++) {
- final RegisteredFontDesc fd = this.fontDescriptions.get(i);
+ final RegisteredFontFamilyMember fd = this.fontDescriptions.get(i);
if (fd.matchPerfect(this, true, style, weight, variant, stretch,
freeStandingFonts, systemFonts)) {
if (weight == Font.Weight.ANY) {
@@ -272,13 +272,14 @@
}
/**
- * Decides which of two {@link RegisteredFontDesc} instances best fills the
+ * Decides which of two {@link RegisteredFontFamilyMember} instances best fills the
* requested weight value.
* @param matches The candidate font descriptors.
* @param weight The requested weight value.
* @return The descriptor best matching the requested weight.
*/
- private RegisteredFontDesc bestWeightMatch(final RegisteredFontDesc[] matches, final Font.Weight weight) {
+ private RegisteredFontFamilyMember bestWeightMatch(final RegisteredFontFamilyMember[] matches,
+ final Font.Weight weight) {
final int index = weightArrayIndex(weight);
final int normalIndex = weightArrayIndex(Font.Weight.NORMAL);
@@ -362,11 +363,11 @@
* @return The next bolder font, or the baseline font if no bolder font
* exists.
*/
- public RegisteredFontDesc nextBolderFont(
- final RegisteredFontDesc baseline) {
- RegisteredFontDesc best = null;
+ public RegisteredFontFamilyMember nextBolderFont(
+ final RegisteredFontFamilyMember baseline) {
+ RegisteredFontFamilyMember best = null;
for (int i = 0; i < this.fontDescriptions.size(); i++) {
- final RegisteredFontDesc candidate = this.fontDescriptions.get(i);
+ final RegisteredFontFamilyMember candidate = this.fontDescriptions.get(i);
// Ignore the baseline.
if (candidate == baseline) {
continue;
@@ -401,11 +402,11 @@
* @return The next lighter font, or the baseline font if no lighter font
* exists.
*/
- public RegisteredFontDesc nextLighterFont(
- final RegisteredFontDesc baseline) {
- RegisteredFontDesc best = null;
+ public RegisteredFontFamilyMember nextLighterFont(
+ final RegisteredFontFamilyMember baseline) {
+ RegisteredFontFamilyMember best = null;
for (int i = 0; i < this.fontDescriptions.size(); i++) {
- final RegisteredFontDesc candidate = this.fontDescriptions.get(i);
+ final RegisteredFontFamilyMember candidate = this.fontDescriptions.get(i);
// Ignore the baseline.
if (candidate == baseline) {
continue;
@@ -457,11 +458,11 @@
}
/**
- * Returns the list of {@link RegisteredFontDesc} instances that are
+ * Returns the list of {@link RegisteredFontFamilyMember} instances that are
* associated with this family.
* @return The font descriptions.
*/
- public List<RegisteredFontDesc> getFontDescriptions() {
+ public List<RegisteredFontFamilyMember> getFontDescriptions() {
return this.fontDescriptions;
}
Copied: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamilyMember.java (from rev 11858, trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java)
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamilyMember.java (rev 0)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamilyMember.java 2021-01-27 17:43:34 UTC (rev 11868)
@@ -0,0 +1,807 @@
+/*
+ * 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.font.config;
+
+import org.foray.common.WellKnownConstants;
+import org.foray.font.Font4a;
+
+import org.axsl.font.Font;
+import org.axsl.font.FontServer;
+import org.axsl.ps.Encoding;
+
+/**
+ * <p>RegisteredFontDesc encapsulates the set of characteristics about how a
+ * font is used.
+ * An RFD instance has one {@link RegisteredFontFamily} parent, which provides
+ * the font-family context in which it can be selected, and one
+ * {@link RegisteredFont} parent, which provides the link to the actual font.
+ * It is analogous to the font-description element in the font configuration,
+ * and is typically created directly as that is parsed.</p>
+ *
+ * <p>An RFD instance is primarily in font resolution, where its
+ * characteristics are comapared, in the context of the parent
+ * RegisteredFontFamily font family, to those requested by the font selection
+ * process.
+ */
+public class RegisteredFontFamilyMember {
+
+ /** Constant indicating the number of simulated "stretch" components. */
+ public static final byte QTY_SIMULATED_STRETCH = 8;
+
+ /** Co...
[truncated message content] |
|
From: <vic...@us...> - 2021-01-27 17:02:29
|
Revision: 11867
http://sourceforge.net/p/foray/code/11867
Author: victormote
Date: 2021-01-27 17:02:26 +0000 (Wed, 27 Jan 2021)
Log Message:
-----------
Add missing javadoc.
Modified Paths:
--------------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
Added Paths:
-----------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-27 15:14:42 UTC (rev 11866)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-27 17:02:26 UTC (rev 11867)
@@ -36,7 +36,7 @@
/**
* Weak bidirectional character type "LRI" in the Unicode specification.
- * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * Substitute for same-named and same-valued constant in {@link java.lang.Character} starting in Java 9.
* TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
*/
public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE = 19;
@@ -43,7 +43,7 @@
/**
* Weak bidirectional character type "RLI" in the Unicode specification.
- * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * Substitute for same-named and same-valued constant in {@link java.lang.Character} starting in Java 9.
* TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
*/
public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE = 20;
@@ -50,7 +50,7 @@
/**
* Weak bidirectional character type "FSI" in the Unicode specification.
- * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * Substitute for same-named and same-valued constant in {@link java.lang.Character} starting in Java 9.
* TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
*/
public static final byte DIRECTIONALITY_FIRST_STRONG_ISOLATE = 21;
@@ -57,7 +57,7 @@
/**
* Weak bidirectional character type "PDI" in the Unicode specification.
- * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * Substitute for same-named and same-valued constant in {@link java.lang.Character} starting in Java 9.
* TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
*/
public static final byte DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE = 22;
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/package-info.java 2021-01-27 17:02:26 UTC (rev 11867)
@@ -0,0 +1,35 @@
+/*
+ * 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: 11858 $
+ * $LastChangedDate: 2021-01-24 14:21:20 -0700 (Sun, 24 Jan 2021) $
+ * $LastChangedBy: victormote $
+ */
+
+/**
+ * <p>Classes for Unicode bidirectional support.
+ * Java now natively supports {link java.text.Bidi}, and the classes in this package may be obsolete.
+ * They are retained for now in case additional features need to be added to enhance the native Java support.</p>
+ */
+
+package org.foray.unicode.bidi;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-27 15:14:45
|
Revision: 11866
http://sourceforge.net/p/foray/code/11866
Author: victormote
Date: 2021-01-27 15:14:42 +0000 (Wed, 27 Jan 2021)
Log Message:
-----------
Based on aXSL change, return a list of Font4a instead of Font.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
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 2021-01-26 13:20:09 UTC (rev 11865)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2021-01-27 15:14:42 UTC (rev 11866)
@@ -854,8 +854,7 @@
}
@Override
- public List<org.axsl.font.Font> getAllFonts(final boolean freeStandingFonts,
- final boolean systemFonts) {
+ public List<Font4a> getAllFonts(final boolean freeStandingFonts, final boolean systemFonts) {
final List<Font4a> fontList = new ArrayList<Font4a>();
for (RegisteredFontFamily family : this.fontFamilies.values()) {
final List<RegisteredFontDesc> rfdList
@@ -878,12 +877,9 @@
if (fontList.size() < 1) {
return null;
}
- final List<org.axsl.font.Font> returnList
- = new ArrayList<org.axsl.font.Font>();
+ final List<Font4a> returnList = new ArrayList<Font4a>();
for (int i = 0; i < fontList.size(); i++) {
- final org.axsl.font.FontUse fontUse =
- (org.axsl.font.FontUse) fontList.get(i);
- final org.axsl.font.Font font = fontUse.getFont();
+ final Font4a font = fontList.get(i);
boolean duplicateFound = false;
for (int j = 0; j < returnList.size() && ! duplicateFound; j++) {
if (font == returnList.get(j)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-26 13:20:15
|
Revision: 11865
http://sourceforge.net/p/foray/code/11865
Author: victormote
Date: 2021-01-26 13:20:09 +0000 (Tue, 26 Jan 2021)
Log Message:
-----------
Tie in bidi char type enumeration with Java Character directionality notion.
Modified Paths:
--------------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
Added Paths:
-----------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-26 12:03:38 UTC (rev 11864)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-26 13:20:09 UTC (rev 11865)
@@ -36,72 +36,144 @@
public enum BidiCharType {
/** The "Left-to-Right" Bidi character type. */
- L,
+ L(Character.DIRECTIONALITY_LEFT_TO_RIGHT),
/** The "Right-to-Left" Bidi character type. */
- R,
+ R(Character.DIRECTIONALITY_RIGHT_TO_LEFT),
/** The "Right-to-Left Arabic" Bidi character type. */
- AL,
+ AL(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC),
/** The "European Number" Bidi character type. */
- EN,
+ EN(Character.DIRECTIONALITY_EUROPEAN_NUMBER),
/** The "European Number Separator" Bidi character type. */
- ES,
+ ES(Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR),
/** The "European Number Terminator" Bidi character type. */
- ET,
+ ET(Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR),
/** The "Arabic Number" Bidi character type. */
- AN,
+ AN(Character.DIRECTIONALITY_ARABIC_NUMBER),
/** The "Common Number Separator" Bidi character type. */
- CS,
+ CS(Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR),
/** The "Nonspacing Mark" Bidi character type. */
- NSM,
+ NSM(Character.DIRECTIONALITY_NONSPACING_MARK),
/** The "Boundary Neutral" Bidi character type. */
- BN,
+ BN(Character.DIRECTIONALITY_BOUNDARY_NEUTRAL),
/** The "Paragraph Separator" Bidi character type. */
- B,
+ B(Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR),
/** The "Segment Separator" Bidi character type. */
- S,
+ S(Character.DIRECTIONALITY_SEGMENT_SEPARATOR),
/** The "Whitespace" Bidi character type. */
- WS,
+ WS(Character.DIRECTIONALITY_WHITESPACE),
/** The "Other Neutrals" Bidi character type. */
- ON,
+ ON(Character.DIRECTIONALITY_OTHER_NEUTRALS),
/** The "Left-to-Right Embedding" Bidi character type. */
- LRE,
+ LRE(Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING),
/** The "Left-to-Right Override" Bidi character type. */
- LRO,
+ LRO(Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE),
/** The "Right-to-Left Embedding" Bidi character type. */
- RLE,
+ RLE(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING),
/** The "Right-to-Left Override" Bidi character type. */
- RLO,
+ RLO(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE),
/** The "Pop Directional Format" Bidi character type. */
- PDF,
+ PDF(Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT),
/** The "Left-to-Right Isolate" Bidi character type. */
- LRI,
+ LRI(BidiUtils.DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE),
/** The "Right-to-Left Isolate" Bidi character type. */
- RLI,
+ RLI(BidiUtils.DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE),
/** The "First Strong Isolate" Bidi character type. */
- FSI,
+ FSI(BidiUtils.DIRECTIONALITY_FIRST_STRONG_ISOLATE),
/** The "Pop Directional Isolate" Bidi character type. */
- PDI
+ PDI(BidiUtils.DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE);
+
+
+ /**
+ * Array whose index is the bidi character types index within {@link Character}.
+ * This should correspond to {@link #values()}, but we use this instead to avoid possible performance problems.
+ * @see #directionality
+ */
+ private static final BidiCharType[] VALUES = {
+ L, R, AL, EN, ES, ET, AN, CS, NSM, BN, B, S, WS, ON, LRE, LRO, RLE, RLO, PDF, LRI, RLI, FSI, PDI
+ };
+
+
+ /**
+ * The numeric index assigned to the bidi character type within {@link Character}.
+ * @see Character#getDirectionality(int)
+ */
+ private byte directionality;
+
+ /**
+ * Private constructor.
+ * @param index The numeric index assigned to the character type at {@link Character#getDirectionality(int)}.
+ */
+ BidiCharType(final byte index) {
+ this.directionality = index;
+ }
+
+ /**
+ * Returns the corresponding directionality index assigned to the character type within {@link Character}.
+ * @return The corresponding directionality index assigned to the character type within {@link Character}.
+ * @see Character#getDirectionality(int)
+ */
+ public byte getDirectionality() {
+ return this.directionality;
+ }
+
+ /**
+ * Returns the instance of this enumeration for a given bidi character directionality index.
+ * @param directionality The directionality index for which the enumeration is needed.
+ * @return The instance of this enumeration matching {@code directionality}, or null if {@code directionality} is
+ * out-of-bounds.
+ * @see Character#getDirectionality(int)
+ */
+ public static BidiCharType fromDirectionality(final int directionality) {
+ if (directionality < 0
+ || directionality >= VALUES.length) {
+ return null;
+ }
+ return VALUES[directionality];
+ }
+
+ /**
+ * Returns the instance of this enumeration for a given character.
+ * @param ch The character for which the bidi character type is needed.
+ * @return The instance of this enumeration for {@code ch}, or null if it is unknown or undefined.
+ * @see Character#getDirectionality(char)
+ */
+ public static BidiCharType forChar(final char ch) {
+ final int directionality = Character.getDirectionality(ch);
+ return fromDirectionality(directionality);
+ }
+
+ /**
+ * Returns the instance of this enumeration for a given Unicode code point.
+ * @param cp The code point for which the bidi character type is needed.
+ * @return The instance of this enumeration for {@code cp}, or null if it is unknown or undefined.
+ * @see Character#getDirectionality(int)
+ */
+ public static BidiCharType forCodePoint(final int cp) {
+ final int directionality = Character.getDirectionality(cp);
+ return fromDirectionality(directionality);
+ }
+
}
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiUtils.java 2021-01-26 13:20:09 UTC (rev 11865)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2021 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.unicode.bidi;
+
+/**
+ * Utility code supporting the Unicode Bidirectional logic.
+ */
+public final class BidiUtils {
+
+
+ /**
+ * Weak bidirectional character type "LRI" in the Unicode specification.
+ * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
+ */
+ public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE = 19;
+
+ /**
+ * Weak bidirectional character type "RLI" in the Unicode specification.
+ * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
+ */
+ public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE = 20;
+
+ /**
+ * Weak bidirectional character type "FSI" in the Unicode specification.
+ * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
+ */
+ public static final byte DIRECTIONALITY_FIRST_STRONG_ISOLATE = 21;
+
+ /**
+ * Weak bidirectional character type "PDI" in the Unicode specification.
+ * Substitute for same-named and same-values constant in {@link java.lang.Character} starting in Java 9.
+ * TODO: After FOray upgrades to Java 9, replace this constant with the one in {@link java.lang.Character}.
+ */
+ public static final byte DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE = 22;
+
+
+ /**
+ * Private constructor. This is a utility class and should never be instantiated.
+ */
+ private BidiUtils() { }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-26 12:03:39
|
Revision: 11864
http://sourceforge.net/p/foray/code/11864
Author: victormote
Date: 2021-01-26 12:03:38 +0000 (Tue, 26 Jan 2021)
Log Message:
-----------
Add enumeration of Bidi character types.
Added Paths:
-----------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/bidi/BidiCharType.java 2021-01-26 12:03:38 UTC (rev 11864)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2021 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.unicode.bidi;
+
+/**
+ * Enumeration of the Unicode Bidirectional character types.
+ * @see "Unicode(r) Standard Annex #9: https://www.unicode.org/reports/tr9/"
+ * @see "https://en.wikipedia.org/wiki/Bidirectional_text#Table_of_possible_BiDi_character_types"
+ */
+public enum BidiCharType {
+
+ /** The "Left-to-Right" Bidi character type. */
+ L,
+
+ /** The "Right-to-Left" Bidi character type. */
+ R,
+
+ /** The "Right-to-Left Arabic" Bidi character type. */
+ AL,
+
+ /** The "European Number" Bidi character type. */
+ EN,
+
+ /** The "European Number Separator" Bidi character type. */
+ ES,
+
+ /** The "European Number Terminator" Bidi character type. */
+ ET,
+
+ /** The "Arabic Number" Bidi character type. */
+ AN,
+
+ /** The "Common Number Separator" Bidi character type. */
+ CS,
+
+ /** The "Nonspacing Mark" Bidi character type. */
+ NSM,
+
+ /** The "Boundary Neutral" Bidi character type. */
+ BN,
+
+ /** The "Paragraph Separator" Bidi character type. */
+ B,
+
+ /** The "Segment Separator" Bidi character type. */
+ S,
+
+ /** The "Whitespace" Bidi character type. */
+ WS,
+
+ /** The "Other Neutrals" Bidi character type. */
+ ON,
+
+ /** The "Left-to-Right Embedding" Bidi character type. */
+ LRE,
+
+ /** The "Left-to-Right Override" Bidi character type. */
+ LRO,
+
+ /** The "Right-to-Left Embedding" Bidi character type. */
+ RLE,
+
+ /** The "Right-to-Left Override" Bidi character type. */
+ RLO,
+
+ /** The "Pop Directional Format" Bidi character type. */
+ PDF,
+
+ /** The "Left-to-Right Isolate" Bidi character type. */
+ LRI,
+
+ /** The "Right-to-Left Isolate" Bidi character type. */
+ RLI,
+
+ /** The "First Strong Isolate" Bidi character type. */
+ FSI,
+
+ /** The "Pop Directional Isolate" Bidi character type. */
+ PDI
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-25 23:14:57
|
Revision: 11863
http://sourceforge.net/p/foray/code/11863
Author: victormote
Date: 2021-01-25 23:14:54 +0000 (Mon, 25 Jan 2021)
Log Message:
-----------
Convert some WellKnownConstants to Unicode character definitions.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfa.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfItem.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
Added Paths:
-----------
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
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 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -29,7 +29,6 @@
package org.foray.area;
import org.foray.common.CharSequenceSubset;
-import org.foray.common.WellKnownConstants;
import org.foray.common.i18n.Orthography4a;
import org.foray.common.primitive.XmlCharacterUtils;
@@ -44,6 +43,7 @@
import org.axsl.font.FontUse;
import org.axsl.galley.GalleyVisitorException;
import org.axsl.galley.RenderVisitor;
+import org.axsl.unicode.block.Basic_Latin_Block;
import java.awt.Color;
import java.io.Serializable;
@@ -386,7 +386,7 @@
for (int i = start; i < start + size; i++) {
final char c = chars.charAt(i);
if (! XmlCharacterUtils.isXMLWhitespace(c)
- || c == WellKnownConstants.ASCII_LINEFEED) {
+ || c == Basic_Latin_Block.CONTROL_LINE_FEED) {
return count;
}
count ++;
@@ -430,7 +430,7 @@
for (int i = start + size - 1; i >= start; i--) {
final char c = chars.charAt(i);
if (! XmlCharacterUtils.isXMLWhitespace(c)
- || c == WellKnownConstants.ASCII_LINEFEED) {
+ || c == Basic_Latin_Block.CONTROL_LINE_FEED) {
return count;
}
count ++;
@@ -559,7 +559,7 @@
return false;
}
final int lastCharIndex = rawText.length() - 1;
- if (rawText.charAt(lastCharIndex) == WellKnownConstants.ASCII_LINEFEED) {
+ if (rawText.charAt(lastCharIndex) == Basic_Latin_Block.CONTROL_LINE_FEED) {
return true;
}
return false;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -30,6 +30,8 @@
import org.foray.common.sequence.ByteArray;
+import org.axsl.unicode.block.Basic_Latin_Block;
+
/**
* Class containing well-known or commonly-used constants and conversions.
*/
@@ -111,17 +113,9 @@
/** The number of decipoints per point, that is, 10. */
public static final int DECIPOINTS_PER_POINT = 10;
- /** The carriage-return character, cast as a byte. */
- public static final byte ASCII_CARRIAGE_RETURN = 0x0D;
-
- /** The linefeed character, cast as a byte. */
- public static final byte ASCII_LINEFEED = 0x0A;
-
- /** The linefeed character, cast as a 1-character String. */
- public static final String ASCII_LINEFEED_STRING = "\n";
-
/** The carriage-return / linefeed combination, cast as a byte array. */
- public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED = new ByteArray(ASCII_CARRIAGE_RETURN, ASCII_LINEFEED);
+ public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED =
+ new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN, (byte) Basic_Latin_Block.CONTROL_LINE_FEED);
/** The number of bytes per kilobyte, that is, 1024. */
public static final short BYTES_PER_KILOBYTE = 1024;
@@ -172,18 +166,6 @@
/** The exponent to use when cubing a value, that is, 3. */
public static final int CUBED_EXPONENT = 3;
- /** The ASCII Null (NUL) character. */
- public static final byte ASCII_NULL = 0x00;
-
- /** The ASCII Horizontal Tab (HT) character. */
- public static final byte ASCII_TAB = 0x09;
-
- /** The ASCII Form Feed (FF) character. */
- public static final byte ASCII_FORM_FEED = 0x0C;
-
- /** The ASCII Space character. */
- public static final byte ASCII_SPACE = 0x20;
-
/**
* Private constructor. This is a utility class, and should never be
* instantiated.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -28,12 +28,12 @@
package org.foray.common.data;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
import org.foray.common.sequence.ByteSequenceSubset;
import org.axsl.common.sequence.ByteSequence;
import org.axsl.common.sequence.ByteSequencePlus;
+import org.axsl.unicode.block.Basic_Latin_Block;
import java.util.ArrayList;
import java.util.List;
@@ -59,12 +59,12 @@
* The standard set of whitespace characters.
*/
private static final ByteArray WHITESPACE = new ByteArray(
- WellKnownConstants.ASCII_NULL,
- WellKnownConstants.ASCII_TAB,
- WellKnownConstants.ASCII_LINEFEED,
- WellKnownConstants.ASCII_FORM_FEED,
- WellKnownConstants.ASCII_CARRIAGE_RETURN,
- WellKnownConstants.ASCII_SPACE);
+ (byte) Basic_Latin_Block.CONTROL_NULL,
+ (byte) Basic_Latin_Block.CONTROL_CHARACTER_TABULATION,
+ (byte) Basic_Latin_Block.CONTROL_LINE_FEED,
+ (byte) Basic_Latin_Block.CONTROL_FORM_FEED,
+ (byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN,
+ (byte) Basic_Latin_Block.SPACE);
/** The default tokenizer configuration. Using it will return non-whitespace as tokens. */
private static final ByteSequenceTokenizerConfig DEFAULT_TOKENIZER_CONFIG =
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -28,10 +28,10 @@
package org.foray.common.data;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
import org.axsl.common.sequence.ByteSequence;
+import org.axsl.unicode.block.Basic_Latin_Block;
import org.junit.Assert;
import org.junit.Test;
@@ -56,12 +56,12 @@
/** Whitespace characters that should be treated as non-returnable delimiters for these tests. */
private static final ByteArray WHITESPACE = new ByteArray(
- WellKnownConstants.ASCII_NULL,
- WellKnownConstants.ASCII_TAB,
- WellKnownConstants.ASCII_LINEFEED,
- WellKnownConstants.ASCII_FORM_FEED,
- WellKnownConstants.ASCII_CARRIAGE_RETURN,
- WellKnownConstants.ASCII_SPACE);
+ (byte) Basic_Latin_Block.CONTROL_NULL,
+ (byte) Basic_Latin_Block.CONTROL_CHARACTER_TABULATION,
+ (byte) Basic_Latin_Block.CONTROL_LINE_FEED,
+ (byte) Basic_Latin_Block.CONTROL_FORM_FEED,
+ (byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN,
+ (byte) Basic_Latin_Block.SPACE);
/** A standard configuration for these tests. */
private static final ByteArray ESCAPE_CHARS = new ByteArray("\\");
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 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -49,6 +49,7 @@
import org.axsl.font.FontUse;
import org.axsl.ps.CharSet;
import org.axsl.ps.Encoding;
+import org.axsl.unicode.block.Basic_Latin_Block;
import org.slf4j.Logger;
@@ -604,7 +605,8 @@
}
}
buffer.append(endTextDelimiter(font));
- buffer.append("]TJ" + WellKnownConstants.ASCII_LINEFEED_STRING);
+ buffer.append("]TJ");
+ buffer.append(Basic_Latin_Block.CONTROL_LINE_FEED);
return buffer.toString();
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Font.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Font.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -28,10 +28,10 @@
package org.foray.font.format.type1;
-import org.foray.common.WellKnownConstants;
import org.foray.font.format.FontContent;
import org.axsl.ps.PsFontDictionary;
+import org.axsl.unicode.block.Basic_Latin_Block;
import java.util.Arrays;
@@ -149,8 +149,8 @@
protected byte[] convertLineEndings(final byte[] input) {
for (int i = 0; i < input.length; i++) {
/* If carriage-return, convert to line-feed. */
- if (input[i] == WellKnownConstants.ASCII_CARRIAGE_RETURN) {
- input[i] = WellKnownConstants.ASCII_LINEFEED;
+ if (input[i] == Basic_Latin_Block.CONTROL_CARRIAGE_RETURN) {
+ input[i] = Basic_Latin_Block.CONTROL_LINE_FEED;
}
}
return input;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfa.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfa.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfa.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -29,9 +29,10 @@
package org.foray.font.format.type1;
import org.foray.common.ByteSequenceSearcher;
-import org.foray.common.WellKnownConstants;
import org.foray.font.format.FontParser;
+import org.axsl.unicode.block.Basic_Latin_Block;
+
import java.io.IOException;
/**
@@ -138,10 +139,10 @@
startOfSegment --;
getRandomInput().seek(startOfSegment);
final byte newByte = getRandomInput().readByte();
- if (newByte == WellKnownConstants.ASCII_CARRIAGE_RETURN) {
+ if (newByte == Basic_Latin_Block.CONTROL_CARRIAGE_RETURN) {
continue;
}
- if (newByte == WellKnownConstants.ASCII_LINEFEED) {
+ if (newByte == Basic_Latin_Block.CONTROL_LINE_FEED) {
continue;
}
if (newByte == '0') {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractCharacterSequence.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.common.i18n.Country4a;
import org.foray.common.i18n.Language4a;
import org.foray.common.i18n.Orthography4a;
@@ -53,6 +52,7 @@
import org.axsl.font.FontServer;
import org.axsl.font.FontUse;
import org.axsl.text.line.LineText;
+import org.axsl.unicode.block.Basic_Latin_Block;
import java.util.List;
@@ -355,7 +355,7 @@
/* If it is not whitespace, it cannot be changed. */
return c;
}
- if (c == WellKnownConstants.ASCII_LINEFEED) {
+ if (c == Basic_Latin_Block.CONTROL_LINE_FEED) {
/* If it is 0x000A (linefeed), it cannot be changed. */
return c;
}
@@ -371,7 +371,7 @@
if (charAfter == CharacterSequence4a.DISCARD_CHAR) {
return c;
}
- if (charAfter != WellKnownConstants.ASCII_LINEFEED) {
+ if (charAfter != Basic_Latin_Block.CONTROL_LINE_FEED) {
return c;
}
return CharacterSequence4a.DISCARD_CHAR;
@@ -381,7 +381,7 @@
if (charBefore == CharacterSequence4a.DISCARD_CHAR) {
return c;
}
- if (charBefore != WellKnownConstants.ASCII_LINEFEED) {
+ if (charBefore != Basic_Latin_Block.CONTROL_LINE_FEED) {
return c;
}
return CharacterSequence4a.DISCARD_CHAR;
@@ -391,7 +391,7 @@
default: {
/* If first element, only check next. */
if (charBefore == CharacterSequence4a.DISCARD_CHAR) {
- if (charAfter == WellKnownConstants.ASCII_LINEFEED) {
+ if (charAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
return CharacterSequence4a.DISCARD_CHAR;
}
return c;
@@ -398,14 +398,14 @@
}
/* If last element, only check previous. */
if (charAfter == CharacterSequence4a.DISCARD_CHAR) {
- if (charBefore == WellKnownConstants.ASCII_LINEFEED) {
+ if (charBefore == Basic_Latin_Block.CONTROL_LINE_FEED) {
return CharacterSequence4a.DISCARD_CHAR;
}
return c;
}
/* Otherwise, check both. */
- if (charBefore == WellKnownConstants.ASCII_LINEFEED
- || charAfter == WellKnownConstants.ASCII_LINEFEED) {
+ if (charBefore == Basic_Latin_Block.CONTROL_LINE_FEED
+ || charAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
return CharacterSequence4a.DISCARD_CHAR;
}
return c;
@@ -493,7 +493,7 @@
* removed.
*/
public static char applyLinefeedTreatment(final char c, final LinefeedTreatment linefeedTreatment) {
- if (c != WellKnownConstants.ASCII_LINEFEED) {
+ if (c != Basic_Latin_Block.CONTROL_LINE_FEED) {
/* This property does not apply to this char. */
return c;
}
@@ -552,7 +552,7 @@
int changeElements = 0;
for (int i = 0; i < charArray.length(); i++) {
final char c = charArray.charAt(i);
- if (c == WellKnownConstants.ASCII_LINEFEED) {
+ if (c == Basic_Latin_Block.CONTROL_LINE_FEED) {
if (linefeedTreatment == LinefeedTreatment.IGNORE) {
discardElements ++;
} else {
@@ -571,7 +571,7 @@
discardElements = 0;
for (int i = 0; i < charArray.length(); i++) {
final char c = charArray.charAt(i);
- if (c == WellKnownConstants.ASCII_LINEFEED) {
+ if (c == Basic_Latin_Block.CONTROL_LINE_FEED) {
final char conversionChar = applyLinefeedTreatment(c,
linefeedTreatment);
if (conversionChar == CharacterSequence4a.DISCARD_CHAR) {
@@ -650,7 +650,7 @@
/* If it is not whitespace, nothing should change. */
return c;
}
- if (c == WellKnownConstants.ASCII_LINEFEED) {
+ if (c == Basic_Latin_Block.CONTROL_LINE_FEED) {
/* If it is a linefeed, nothing should change. */
return c;
}
@@ -658,7 +658,7 @@
&& XmlCharacterUtils.isXMLWhitespace(charBefore)) {
return CharacterSequence4a.DISCARD_CHAR;
}
- if (charAfter == WellKnownConstants.ASCII_LINEFEED) {
+ if (charAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
return CharacterSequence4a.DISCARD_CHAR;
}
return c;
Added: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java (rev 0)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/AbstractTextPainter.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -0,0 +1,398 @@
+/*
+ * Copyright 2021 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.graphic.batik;
+
+//import org.foray.common.primitive.CharacterUtils;
+//
+//import org.axsl.font.Font;
+//import org.axsl.unicode.block.General_Punctuation_Block;
+//import org.axsl.unicode.block.Latin_1_Supplement_Block;
+//
+//import org.apache.batik.bridge.FontFamilyResolver;
+//import org.apache.batik.bridge.GlyphLayout;
+//import org.apache.batik.bridge.SVGGVTFont;
+//import org.apache.batik.bridge.StrokingTextPainter;
+//import org.apache.batik.bridge.TextLayoutFactory;
+//import org.apache.batik.bridge.TextNode;
+//import org.apache.batik.bridge.TextSpanLayout;
+//import org.apache.batik.gvt.font.GVTGlyphVector;
+//import org.apache.batik.gvt.text.BidiAttributedCharacterIterator;
+//import org.apache.batik.gvt.text.TextPaintInfo;
+import org.apache.batik.bridge.TextPainter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+//import java.awt.Graphics2D;
+//import java.awt.Shape;
+//import java.awt.font.FontRenderContext;
+//import java.awt.geom.AffineTransform;
+//import java.awt.geom.Ellipse2D;
+//import java.awt.geom.GeneralPath;
+//import java.awt.geom.Point2D;
+//import java.io.IOException;
+//import java.text.AttributedCharacterIterator;
+//import java.util.List;
+//import java.util.Set;
+
+
+/**
+ * Abstract superclass for {@link TextPainter} implementations.
+ */
+public abstract class AbstractTextPainter /* extends StrokingTextPainter */ {
+
+ /** The logger. */
+ protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractTextPainter.class);
+
+// /** Static layout factory for complex scripts. */
+// private static final TextLayoutFactory COMPLEX_SCRIPT_TEXT_LAYOUT_FACTORY =
+// new TextLayoutFactory() {
+// public TextSpanLayout createTextLayout(final AttributedCharacterIterator aci,
+// final int [] charMap, final Point2D offset, final FontRenderContext frc) {
+// if (ComplexGlyphLayout.mayRequireComplexLayout(aci)) {
+// return new ComplexGlyphLayout(aci, charMap, offset, frc);
+// } else {
+// return new GlyphLayout(aci, charMap, offset, frc);
+// }
+// }
+// };
+//
+// /** the font collection */
+// protected final FontInfo fontInfo;
+//
+// protected final FontFamilyResolver fontFamilyResolver;
+//
+// protected Font font;
+//
+// protected TextPaintInfo tpi;
+//
+// /**
+// * Creates a new instance.
+// * @param fontInfo the font collection
+// */
+// public AbstractTextPainter(FontInfo fontInfo) {
+// this.fontInfo = fontInfo;
+// this.fontFamilyResolver = new FOPFontFamilyResolverImpl(fontInfo);
+// }
+//
+// /**
+// * Indicates whether the given {@link Graphics2D} instance if compatible with this text painter
+// * implementation.
+// * @param g2d the instance to check
+// * @return true if the instance is compatible.
+// */
+// protected abstract boolean isSupported(Graphics2D g2d);
+//
+// /**
+// * Paints a single text run.
+// * @param textRun the text run
+// * @param g2d the target Graphics2D instance
+// * @throws IOException if an I/O error occurs while rendering the text
+// */
+// protected final void paintTextRun(final TextRun textRun, final Graphics2D g2d) throws IOException {
+// logTextRun(textRun);
+// final AttributedCharacterIterator runaci = textRun.getACI();
+// runaci.first();
+// tpi = (TextPaintInfo) runaci.getAttribute(PAINT_INFO);
+// if (tpi == null || !tpi.visible) {
+// return;
+// }
+// if (tpi.composite != null) {
+// g2d.setComposite(tpi.composite);
+// }
+// final TextSpanLayout layout = textRun.getLayout();
+// final GVTGlyphVector gv = layout.getGlyphVector();
+// if (! (gv.getFont() instanceof FOPGVTFont)) {
+// assert gv.getFont() == null || gv.getFont() instanceof SVGGVTFont;
+// //Draw using Java2D when no native fonts are available
+// textRun.getLayout().draw(g2d);
+// return;
+// } else {
+// final GeneralPath debugShapes = new GeneralPath();
+// preparePainting(g2d);
+// saveGraphicsState();
+// setInitialTransform(g2d.getTransform());
+// clip(g2d.getClip());
+// beginTextObject();
+// writeGlyphs((FOPGVTGlyphVector) gv, debugShapes);
+// endTextObject();
+// restoreGraphicsState();
+// }
+// }
+//
+// protected void writeGlyphs(FOPGVTGlyphVector gv, GeneralPath debugShapes) throws IOException {
+// final AffineTransform localTransform = new AffineTransform();
+// Point2D prevPos = null;
+// AffineTransform prevGlyphTransform = null;
+// font = ((FOPGVTFont) gv.getFont()).getFont();
+// for (int index = 0, c = gv.getNumGlyphs(); index < c; index++) {
+// if (!gv.isGlyphVisible(index)) {
+// continue;
+// }
+// final Point2D glyphPos = gv.getGlyphPosition(index);
+//
+// final AffineTransform glyphTransform = gv.getGlyphTransform(index);
+// LOGGER.trace("pos " + glyphPos + ", transform " + glyphTransform);
+// if (DEBUG) {
+// Shape sh = gv.getGlyphLogicalBounds(index);
+// if (sh == null) {
+// sh = new Ellipse2D.Double(glyphPos.getX(), glyphPos.getY(), 2, 2);
+// }
+// debugShapes.append(sh, false);
+// }
+//
+// //Exact position of the glyph
+// localTransform.setToIdentity();
+// localTransform.translate(glyphPos.getX(), glyphPos.getY());
+// if (glyphTransform != null) {
+// localTransform.concatenate(glyphTransform);
+// }
+// localTransform.scale(1, -1);
+//
+// positionGlyph(prevPos, glyphPos, glyphTransform != null || prevGlyphTransform != null);
+// final char glyph = (char) gv.getGlyphCode(index);
+// //Update last position
+// prevPos = glyphPos;
+// prevGlyphTransform = glyphTransform;
+//
+// writeGlyph(glyph, localTransform);
+// }
+// }
+//
+// @Override
+// protected void paintTextRuns(@SuppressWarnings("rawtypes") final List textRuns, final Graphics2D g2d) {
+// LOGGER.trace("paintTextRuns: count = " + textRuns.size());
+// if (!isSupported(g2d)) {
+// super.paintTextRuns(textRuns, g2d);
+// return;
+// }
+// for (Object textRun1 : textRuns) {
+// final TextRun textRun = (TextRun) textRun1;
+// try {
+// paintTextRun(textRun, g2d);
+// } catch (final IOException ioe) {
+// //No other possibility than to use a RuntimeException
+// throw new RuntimeException(ioe);
+// }
+// }
+// }
+//
+// /**
+// * Collects all characters from an {@link AttributedCharacterIterator}.
+// * @param runaci the character iterator
+// * @return the characters
+// */
+// protected CharSequence collectCharacters(final AttributedCharacterIterator runaci) {
+// final StringBuffer chars = new StringBuffer();
+// for (runaci.first(); runaci.getIndex() < runaci.getEndIndex();) {
+// chars.append(runaci.current());
+// runaci.next();
+// }
+// return chars;
+// }
+//
+// // Use FOP's bidi algorithm implementation and sub-divide each chunk into runs
+// // that respect bidi level boundaries. N.B. batik does not sub-divide chunks at
+// // bidi level boundaries because it performs eager reordering. In FOP, we need
+// // to perform lazy reordering after character to glyph mapping occurs since
+// // that mapping process requires logical (not visual) ordered input.
+// @Override
+// public List computeTextRuns(final TextNode node, final AttributedCharacterIterator nodeACI,
+// final AttributedCharacterIterator [] chunkACIs) {
+// nodeACI.first();
+// final int defaultBidiLevel =
+// (((Integer) nodeACI.getAttribute(WRITING_MODE)).intValue() == WRITING_MODE_RTL) ? 1 : 0;
+// for (int i = 0, n = chunkACIs.length; i < n; ++i) {
+// chunkACIs[i] = new BidiAttributedCharacterIterator(chunkACIs[i], defaultBidiLevel);
+// }
+// return super.computeTextRuns(node, nodeACI, chunkACIs, null);
+// }
+//
+// // We want to sub-divide text chunks into distinct runs at bidi level boundaries.
+// @Override
+// protected Set getTextRunBoundaryAttributes() {
+// final Set textRunBoundaryAttributes = super.getTextRunBoundaryAttributes();
+// if (!textRunBoundaryAttributes.contains(BIDI_LEVEL)) {
+// textRunBoundaryAttributes.add(BIDI_LEVEL);
+// }
+// return textRunBoundaryAttributes;
+// }
+//
+// // Perform reordering of runs.
+// @SuppressWarnings("rawtypes")
+// @Override
+// protected List reorderTextRuns(final TextChunk chunk, final List runs) {
+// // 1. determine min/max bidi levels for runs
+// int mn = -1;
+// int mx = -1;
+// for (TextRun r : (List<TextRun>) runs) {
+// final int level = r.getBidiLevel();
+// if (level >= 0) {
+// if ((mn < 0) || (level < mn)) {
+// mn = level;
+// }
+// if ((mx < 0) || (level > mx)) {
+// mx = level;
+// }
+// }
+// }
+//
+// // 2. reorder from maximum level to minimum odd level
+// if (mx > 0) {
+// for (int l1 = mx, l2 = ((mn & 1) == 0) ? (mn + 1) : mn; l1 >= l2; l1--) {
+// runs = reorderRuns(runs, l1);
+// }
+// }
+//
+// // 3. reverse glyphs (and perform mirroring) in runs as needed
+// final boolean mirror = true;
+// reverseGlyphs(runs, mirror);
+//
+// return runs;
+// }
+//
+// private List<TextRun> reorderRuns(final List<TextRun> runs, final int level) {
+// assert level >= 0;
+// final List<TextRun> runsNew = new java.util.ArrayList<TextRun>();
+// for (int i = 0, n = runs.size(); i < n; i++) {
+// final TextRun tri = (TextRun) runs.get(i);
+// if (tri.getBidiLevel() < level) {
+// runsNew.add(tri);
+// } else {
+// final int s = i;
+// int e = s;
+// while (e < n) {
+// final TextRun tre = (TextRun) runs.get(e);
+// if (tre.getBidiLevel() < level) {
+// break;
+// } else {
+// e++;
+// }
+// }
+// if (s < e) {
+// runsNew.addAll(reverseRuns(runs, s, e));
+// }
+// i = e - 1;
+// }
+// }
+// if (!runsNew.equals(runs)) {
+// runs = runsNew;
+// }
+// return runs;
+// }
+//
+// private List<TextRun> reverseRuns(final List<TextRun> runs, final int s, final int e) {
+// final int n = e - s;
+// final List<TextRun> runsNew = new java.util.ArrayList<TextRun>(n);
+// if (n > 0) {
+// for (int i = 0; i < n; i++) {
+// final int k = n - i - 1;
+// final TextRun tr = (TextRun) runs.get(s + k);
+// tr.reverse();
+// runsNew.add(tr);
+// }
+// }
+// return runsNew;
+// }
+//
+// private void reverseGlyphs(final List<TextRun> runs, final boolean mirror) {
+// for (TextRun r : runs) {
+// r.maybeReverseGlyphs(mirror);
+// }
+// }
+//
+// protected abstract void preparePainting(Graphics2D g2d);
+//
+// protected abstract void saveGraphicsState() throws IOException;
+//
+// protected abstract void restoreGraphicsState() throws IOException;
+//
+// protected abstract void setInitialTransform(AffineTransform transform) throws IOException;
+//
+// protected abstract void clip(Shape clip) throws IOException;
+//
+// protected abstract void beginTextObject() throws IOException;
+//
+// protected abstract void endTextObject() throws IOException;
+//
+// protected abstract void positionGlyph(Point2D prevPos, Point2D glyphPos, boolean reposition);
+//
+// protected abstract void writeGlyph(char glyph, AffineTransform transform) throws IOException;
+//
+//
+// protected final void logTextRun(final TextRun textRun) {
+// final AttributedCharacterIterator runaci = textRun.getACI();
+// final TextSpanLayout layout = textRun.getLayout();
+// runaci.first();
+// if (LOGGER.isTraceEnabled()) {
+// final int charCount = runaci.getEndIndex() - runaci.getBeginIndex();
+// LOGGER.trace("================================================");
+// LOGGER.trace("New text run:");
+// LOGGER.trace("char count: " + charCount);
+// LOGGER.trace("range: "
+// + runaci.getBeginIndex() + " - " + runaci.getEndIndex());
+// LOGGER.trace("glyph count: " + layout.getGlyphCount()); //=getNumGlyphs()
+// }
+// }
+//
+// /**
+// * Creates a trace log message for certain characters that may cause problems due to being unpainted.
+// * @param ch The char to be logged.
+// * @param layout A text span layout.
+// * @param index An index.
+// * @param visibleChar Indicates whether the char is visible.
+// */
+// protected final void logCharacter(final char ch, final TextSpanLayout layout, final int index,
+// final boolean visibleChar) {
+// if (LOGGER.isTraceEnabled()) {
+// LOGGER.trace("glyph " + index
+// + " -> " + layout.getGlyphIndex(index) + " => " + ch);
+// if (CharacterUtils.isAnySpace(ch) && ch != ' ') {
+// LOGGER.trace("Space found: " + Integer.toHexString(ch));
+// } else if (ch == General_Punctuation_Block.ZERO_WIDTH_JOINER) {
+// LOGGER.trace("ZWJ found: " + Integer.toHexString(ch));
+// } else if (ch == Latin_1_Supplement_Block.SOFT_HYPHEN) {
+// LOGGER.trace("Soft hyphen found: " + Integer.toHexString(ch));
+// }
+// if (!visibleChar) {
+// LOGGER.trace("Invisible glyph found: " + Integer.toHexString(ch));
+// }
+// }
+// }
+//
+// @Override
+// protected FontFamilyResolver getFontFamilyResolver() {
+// return this.fontFamilyResolver;
+// }
+//
+// @Override
+// protected TextLayoutFactory getTextLayoutFactory() {
+// return COMPLEX_SCRIPT_TEXT_LAYOUT_FACTORY;
+// }
+//
+}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -31,6 +31,8 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.unicode.block.Basic_Latin_Block;
+
import java.util.Arrays;
import java.util.List;
@@ -138,8 +140,8 @@
WellKnownConstants.ASCII_CARRIAGE_RETURN_LINEFEED,
/* Single-byte arrays at the bottom of the list. */
- new ByteArray(WellKnownConstants.ASCII_LINEFEED),
- new ByteArray(WellKnownConstants.ASCII_CARRIAGE_RETURN)
+ new ByteArray((byte) Basic_Latin_Block.CONTROL_LINE_FEED),
+ new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN)
);
/**
@@ -147,12 +149,12 @@
* @see "PDF Reference, Sixth Edition (PDF version 1.7), Section 3.1.1, especially Table 3.1."
*/
public static final ByteArray PDF_WHITESPACE = new ByteArray(
- WellKnownConstants.ASCII_NULL,
- WellKnownConstants.ASCII_TAB,
- WellKnownConstants.ASCII_LINEFEED,
- WellKnownConstants.ASCII_FORM_FEED,
- WellKnownConstants.ASCII_CARRIAGE_RETURN,
- WellKnownConstants.ASCII_SPACE);
+ (byte) Basic_Latin_Block.CONTROL_NULL,
+ (byte) Basic_Latin_Block.CONTROL_CHARACTER_TABULATION,
+ (byte) Basic_Latin_Block.CONTROL_LINE_FEED,
+ (byte) Basic_Latin_Block.CONTROL_FORM_FEED,
+ (byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN,
+ (byte) Basic_Latin_Block.SPACE);
/** The maximum size, in bytes, of the file ID field. */
public static final int FILE_ID_SIZE = 16;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfItem.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfItem.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfItem.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -28,11 +28,11 @@
package org.foray.pdf;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.StringUtils;
import org.foray.pdf.object.PdfDocument4a;
import org.axsl.pdf.PdfException;
+import org.axsl.unicode.block.Basic_Latin_Block;
import java.io.IOException;
import java.io.OutputStream;
@@ -49,7 +49,7 @@
* Note that this always uses the Unix-style line ending, as it is more
* compact, and as the PDF generated should be identical, regardless of
* the platform from which it is generated. */
- public static final String EOL = WellKnownConstants.ASCII_LINEFEED_STRING;
+ public static final String EOL = StringUtils.EMPTY_STRING + Basic_Latin_Block.CONTROL_LINE_FEED;
/**
* The String that should be used to end a cross-reference line in the
@@ -60,7 +60,7 @@
* If a 1-character eol is used (such as a newline), then an extra character
* must be padded.
* According to the Reference, that character must be a space. */
- public static final String XREF_EOL = StringUtils.SINGLE_SPACE + WellKnownConstants.ASCII_LINEFEED_STRING;
+ public static final String XREF_EOL = StringUtils.SINGLE_SPACE + Basic_Latin_Block.CONTROL_LINE_FEED;
/** The String that should be used to end a line in log messages. */
public static final String MSG_EOL = System.getProperty("line.separator");
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2021-01-25 22:50:51 UTC (rev 11862)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2021-01-25 23:14:54 UTC (rev 11863)
@@ -49,6 +49,7 @@
import org.axsl.graphic.output.GraphicOutputContext;
import org.axsl.pdf.PdfColor;
import org.axsl.pdf.PdfPage;
+import org.axsl.unicode.block.Basic_Latin_Block;
import org.apache.batik.ext.awt.g2d.GraphicContext;
import org.slf4j.Logger;
@@ -558,9 +559,9 @@
final Gradient4a gradient = new Gradient4a(false, aColorSpace, someColors, null, theCoords);
final String gradientName = this.pdfContext.getGradientName(gradient);
if (fill) {
- this.write("/Pattern cs /" + gradientName + " scn" + WellKnownConstants.ASCII_LINEFEED);
+ this.write("/Pattern cs /" + gradientName + " scn" + Basic_Latin_Block.CONTROL_LINE_FEED);
} else {
- this.write("/Pattern CS /" + gradientName + " SCN" + WellKnownConstants.ASCII_LINEFEED);
+ this.write("/Pattern CS /" + gradientName + " SCN" + Basic_Latin_Block.CONTROL_LINE_FEED);
}
} else if (paint instanceof TexturePaint) { }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-25 22:50:57
|
Revision: 11862
http://sourceforge.net/p/foray/code/11862
Author: victormote
Date: 2021-01-25 22:50:51 +0000 (Mon, 25 Jan 2021)
Log Message:
-----------
Use char instead of byte, even for blocks that fit into byte.
Modified Paths:
--------------
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-unicode/src/main/java/org/foray/unicode/Block.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/Block.java 2021-01-25 21:54:28 UTC (rev 11861)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/Block.java 2021-01-25 22:50:51 UTC (rev 11862)
@@ -133,10 +133,11 @@
if (this.end > Character.MAX_VALUE) {
return "int";
}
- if (this.end > Byte.MAX_VALUE) {
- return "char";
- }
- return "byte";
+ /* Since there is one code block whose code points can all be contained in a byte, it is tempting to use byte
+ * as the type in that case. However, the fact that byte is a numeric type causes some String-related methods
+ * to treat it is a number, resulting for example with the numeric value being included in the string instead of
+ * the char value: for example "32" instead of " ". */
+ return "char";
}
}
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java 2021-01-25 21:54:28 UTC (rev 11861)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java 2021-01-25 22:50:51 UTC (rev 11862)
@@ -130,7 +130,6 @@
writer.write(block.getJavaName());
writer.write("_Block {");
writer.write(eol);
- writer.write("");
writer.write(eol);
writer.write(" /*");
writer.write(eol);
@@ -141,10 +140,29 @@
writer.write(eol);
writer.write(" */");
writer.write(eol);
- writer.write("");
writer.write(eol);
final String type = block.getSmallestIndexType();
+ if (block.getEnd() <= Byte.MAX_VALUE) {
+ writer.write(" /*");
+ writer.write(eol);
+ writer.write(" * Since all code points in this block can be contained in one byte, ");
+ writer.write("it is tempting to use byte as the type for");
+ writer.write(eol);
+ writer.write(" * them. However, byte is a numeric type, which causes some String-building ");
+ writer.write("methods to treat it is a number,");
+ writer.write(eol);
+ writer.write(" * resulting in the numeric value being included in the string instead ");
+ writer.write("of the char value: for example \"32\" instead");
+ writer.write(eol);
+ writer.write(" * of \" \".");
+ writer.write(eol);
+ writer.write(" */");
+ writer.write(eol);
+ writer.write(eol);
+ }
+
+
/* CodePoints are already sorted. */
for (CodePoint cp : block.getCodePoints()) {
writer.write(" public static final ");
@@ -170,7 +188,6 @@
}
/* The file footer. */
- writer.write("");
writer.write(eol);
writer.write(" /* Private constructor. This is a utility class and should never be instantiated. */");
writer.write(eol);
@@ -178,7 +195,6 @@
writer.write(className);
writer.write("() { }");
writer.write(eol);
- writer.write("");
writer.write(eol);
writer.write("}");
writer.write(eol);
@@ -272,7 +288,6 @@
builder.append(eol);
builder.append(" */");
builder.append(eol);
- builder.append("");
builder.append(eol);
builder.append("/*");
builder.append(eol);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-25 21:54:31
|
Revision: 11861
http://sourceforge.net/p/foray/code/11861
Author: victormote
Date: 2021-01-25 21:54:28 +0000 (Mon, 25 Jan 2021)
Log Message:
-----------
Add methods needed for text processing in SVGs.
Modified Paths:
--------------
trunk/foray/foray-common/build.gradle
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2021-01-25 21:23:45 UTC (rev 11860)
+++ trunk/foray/foray-common/build.gradle 2021-01-25 21:54:28 UTC (rev 11861)
@@ -9,6 +9,7 @@
api group: 'org.axsl', name: 'axsl-ps', version: axslVersion
api group: 'org.axsl', name: 'axsl-font', version: axslVersion
api group: 'org.axsl', name: 'axsl-fo', version: axslVersion
+ api group: 'org.axsl', name: 'axsl-unicode', version: axslVersion
implementation group: 'ch.qos.logback', name: 'logback-classic', version: logbackClassicVersion
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2021-01-25 21:23:45 UTC (rev 11860)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2021-01-25 21:54:28 UTC (rev 11861)
@@ -30,6 +30,12 @@
import org.foray.common.WellKnownConstants;
+import org.axsl.unicode.block.Arabic_Presentation_Forms_B_Block;
+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;
+
import java.util.List;
/**
@@ -198,4 +204,93 @@
return (byte) (theChar & WellKnownConstants.MAX_8_BIT_UNSIGNED_BYTE);
}
+ /**
+ * Helper method to determine if the character is a
+ * space with normal behavior. Normal behavior means that
+ * it's not non-breaking.
+ * @param c character to inspect
+ * @return True if the character is a normal space
+ */
+ public static boolean isBreakableSpace(final int c) {
+ return c == Basic_Latin_Block.SPACE || isFixedWidthSpace(c);
+ }
+
+ /**
+ * Indicates whether a given char is a zero-width space.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is a zero-width space character.
+ */
+ public static boolean isZeroWidthSpace(final int c) {
+ return c == General_Punctuation_Block.ZERO_WIDTH_SPACE
+ || c == General_Punctuation_Block.WORD_JOINER
+ || c == Arabic_Presentation_Forms_B_Block.ZERO_WIDTH_NO_BREAK_SPACE;
+ }
+
+ /**
+ * Indicates whether a given char is a (breakable) fixed-width space.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is a fixed-width space character.
+ */
+ public static boolean isFixedWidthSpace(final int c) {
+ return (c >= General_Punctuation_Block.EN_QUAD
+// || c == General_Punctuation_Block.EN_QUAD // 0x2000
+// || c == General_Punctuation_Block.EM_QUAD // 0x2001
+// || c == General_Punctuation_Block.EN_SPACE // 0x2002
+// || c == General_Punctuation_Block.EM_SPACE // 0x2003
+// || c == General_Punctuation_Block.THREE_PER_EM_SPACE // 0x2004
+// || c == General_Punctuation_Block.FOUR_PER_EM_SPACE // 0x2005
+// || c == General_Punctuation_Block.SIX_PER_EM_SPACE // 0x2006
+// || c == General_Punctuation_Block.FIGURE_SPACE // 0x2007
+// || c == General_Punctuation_Block.PUNCTUATION_SPACE // 0x2008
+// || c == General_Punctuation_Block.THIN_SPACE // 0x2009
+// || c == General_Punctuation_Block.HAIR_SPACE // 0x200a
+// || c == General_Punctuation_Block.ZERO_WIDTH_SPACE // 0x200b
+ && c <= General_Punctuation_Block.ZERO_WIDTH_SPACE)
+ || c == CJK_Symbols_and_Punctuation_Block.IDEOGRAPHIC_SPACE;
+ }
+
+ /**
+ * Indicates whether a given char is an adjustable space.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is an adjustable space character.
+ */
+ public static boolean isAdjustableSpace(final int c) {
+ /* TODO: This list may not be complete. */
+ return
+ c == Basic_Latin_Block.SPACE
+ || c == Latin_1_Supplement_Block.NO_BREAK_SPACE;
+ }
+
+ /**
+ * Indicates whether a given char is a breaking space character.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is a breaking space character.
+ */
+ public static boolean isBreakableSpace(final char c) {
+ return c == Basic_Latin_Block.SPACE || isFixedWidthSpace(c);
+ }
+
+ /**
+ * Indicates whether a given char is a non-breaking space character.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is a non-breaking space character.
+ */
+ public static boolean isNonBreakableSpace(final char c) {
+ return
+ c == Latin_1_Supplement_Block.NO_BREAK_SPACE
+ || c == General_Punctuation_Block.NARROW_NO_BREAK_SPACE
+ || c == CJK_Symbols_and_Punctuation_Block.IDEOGRAPHIC_SPACE
+ || c == General_Punctuation_Block.WORD_JOINER
+ || c == Arabic_Presentation_Forms_B_Block.ZERO_WIDTH_NO_BREAK_SPACE;
+ }
+
+ /**
+ * Indicates whether a given char is a space character.
+ * @param c The char to be tested.
+ * @return True if and only if {@code c} is a space character.
+ */
+ public static boolean isAnySpace(final char c) {
+ return isBreakableSpace(c) || isNonBreakableSpace(c);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-25 21:23:51
|
Revision: 11860
http://sourceforge.net/p/foray/code/11860
Author: victormote
Date: 2021-01-25 21:23:45 +0000 (Mon, 25 Jan 2021)
Log Message:
-----------
Handle the case of an unnamed control character.
Modified Paths:
--------------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/CodePoint.java
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/CodePoint.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/CodePoint.java 2021-01-25 17:34:25 UTC (rev 11859)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/CodePoint.java 2021-01-25 21:23:45 UTC (rev 11860)
@@ -176,7 +176,11 @@
public String getJavaName() {
String base = this.name;
if ("<control>".equals(base)) {
- base = "CONTROL_" + this.unicode10Name;
+ if ("".equals(this.unicode10Name)) {
+ base = "CONTROL_0x" + Integer.toHexString(this.value);
+ } else {
+ base = "CONTROL_" + this.unicode10Name;
+ }
}
String toReturn = base.toUpperCase(Locale.US);
toReturn = toReturn.replace(" ", "_");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-25 17:34:27
|
Revision: 11859
http://sourceforge.net/p/foray/code/11859
Author: victormote
Date: 2021-01-25 17:34:25 +0000 (Mon, 25 Jan 2021)
Log Message:
-----------
Break up Subversion keyword generation so that Subversion doesn't try to expand them in this file.
Modified Paths:
--------------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java 2021-01-24 21:21:20 UTC (rev 11858)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/UnicodeParser.java 2021-01-25 17:34:25 UTC (rev 11859)
@@ -276,11 +276,16 @@
builder.append(eol);
builder.append("/*");
builder.append(eol);
- builder.append(" * $LastChangedRevision$");
+ /* These next items are keywords meaningful to Subversion. We break them up so that Subversion does not expand
+ * them here. */
+ builder.append(" * $Last");
+ builder.append("ChangedRevision$");
builder.append(eol);
- builder.append(" * $LastChangedDate$");
+ builder.append(" * $Last");
+ builder.append("ChangedDate$");
builder.append(eol);
- builder.append(" * $LastChangedBy$");
+ builder.append(" * $Last");
+ builder.append("ChangedBy$");
builder.append(eol);
builder.append(" */");
builder.append(eol);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2021-01-24 21:22:03
|
Revision: 11858
http://sourceforge.net/p/foray/code/11858
Author: victormote
Date: 2021-01-24 21:21:20 +0000 (Sun, 24 Jan 2021)
Log Message:
-----------
Add properties to better handle SVN keywords.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/ForayTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BasicLinkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BidiOverrideArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/IndexPageCitationListArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/InlineContainerArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.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-common/src/main/java/org/foray/common/CharacterOutputStream.java
trunk/foray/foray-common/src/main/java/org/foray/common/Mime.java
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/encoding/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/resource/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/xml/SaxParser.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableBase.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCff2.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCvt.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableFpgm.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGasp.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGdef.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGpos.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGsub.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableJstf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableMath.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePrep.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableVorg.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsSerializer.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/util/package-info.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslPropertyKeyword.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/AxslValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/ObjectMakerAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PropertyMakerAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata.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/FoObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoPropertyKeyword.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FolioPrefix.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FolioSuffix.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationListSeparator.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationRangeSeparator.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageNumberPrefix.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageNumberSuffix.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation.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/PdAllowedHeightScale.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAllowedWidthScale.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/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/PdChangeBarColor.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/foray/ForayObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/foray/obj/package-info.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathNamespace.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/MathObjectMaker.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/SvgObject.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtShadowEffectWrapper.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnAbstractNamedProperty.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnFromPageMasterRegion.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnMergePropertyValues.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgbIcc.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnSystemFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/xml/XmlProperty.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/MathGraphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaAwt.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/factory/MathFactory.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicJava2d4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicJava2dFactory.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicOutput4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicOutputFactory.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicPdf4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicPdfFactory.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicPs4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/GraphicPsFactory.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgJava2d.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPdf.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPs.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/factory/TestMathFactory.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/ConfigParser.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionarySerializer.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/util/NatLangParser.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/util/ValidateChars.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/wrapper/package-info.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/zzarchive/package-info.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/package-info.java
trunk/foray/foray-linebreak/src/main/java/org/foray/text/line/PatientLineBreaker.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifMarker.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgfCatalog.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTblCatalog.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTblFormat.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifXref.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifXrefFormat.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifXrefInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfPageLabel.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformEps.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformMath.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/object/PdfXformSvg.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/package-info.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/PdfParserTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/AbstractMixedInlinePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BasicLinkPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/BidiOverridePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InlinePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/WrapperPnr.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsOperatorException.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVectorInputStream.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/GlyphListAgl1.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/Ascii85DecodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/CcittFaxDecodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/DctDecodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/FlateEncodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/PsDecodeFilter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/PsEncodeFilter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/RunLengthDecodeFilter.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/package-info.java
trunk/foray/foray-xml/src/main/java/org/foray/xml/DomUtil.java
trunk/foray/master/doc/web/module/api.html
trunk/foray/master/doc/web/module/download.html
Property Changed:
----------------
trunk/
trunk/foray/foray-app/build.gradle
trunk/foray/foray-app/src/main/java/org/foray/app/AwtStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineOptions.java
trunk/foray/foray-app/src/main/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/FOray.java
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
trunk/foray/foray-app/src/main/java/org/foray/app/Options.java
trunk/foray/foray-app/src/main/java/org/foray/app/OutputTargetFactory.java
trunk/foray/foray-app/src/main/java/org/foray/app/OutputTargetType.java
trunk/foray/foray-app/src/main/java/org/foray/app/PrintStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/Starter.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTask.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/ForayAntTaskStarter.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/RunTest.java
trunk/foray/foray-app/src/main/java/org/foray/app/ant/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/app/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/app/test/TestConverter.java
trunk/foray/foray-app/src/main/java/org/foray/app/test/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoAwtViewer.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoFo2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoObj2Xml.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Fo.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/DemoXml2Pdf.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/EmbedDemo.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/model/ProjectMember.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/model/ProjectTeam.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/model/ProjectTeamInputSource.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/model/ProjectTeamXmlReader.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/model/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/tools/AbstractObjectReader.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/tools/EasyContentHandlerProxy.java
trunk/foray/foray-app/src/main/java/org/foray/demo/embed/tools/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/demo/package-info.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/AbstractDemoServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoPrintServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/DemoServlet.java
trunk/foray/foray-app/src/main/java/org/foray/demo/servlet/package-info.java
trunk/foray/foray-app/src/test/java/org/foray/app/ForayTests.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/AreaTreeCreator.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBlock.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestBorder.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestGraphicArea.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestInline.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestMetadata.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/TestVertical.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/AbstractFoTreeTest.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/FoDocumentReader.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestInvalidXml.java
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractListItemContent.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractTablePartContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaClass.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaFixed.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaFlexible.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BasicLinkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BeforeFloatRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BidiOverrideArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockContainerRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkParentArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTitleArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/BookmarkTreeArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ContainerRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/FoLinkage.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/FoLinkageMarker.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/FoLinkageNormal.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/FootnoteRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/IndexPageCitationListArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/InlineContainerArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListBlockArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemBodyContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ListItemLabelContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/MainRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NonArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalFlowRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection.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/PageRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionRaBody.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/SpanRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/SvgArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableBodyContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableCellRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableFooterContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableHeaderContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRa.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TableRowContainer.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/package-info.java
trunk/foray/foray-areatree/src/test/java/org/foray/area/TestPageCollection.java
trunk/foray/foray-common/build.gradle
trunk/foray/foray-common/src/main/java/org/foray/common/AxslDtdUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/ByteSequenceSearcher.java
trunk/foray/foray-common/src/main/java/org/foray/common/CharSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/CharacterOutputStream.java
trunk/foray/foray-common/src/main/java/org/foray/common/ClassService.java
trunk/foray/foray-common/src/main/java/org/foray/common/ColorSpaceCmyk.java
trunk/foray/foray-common/src/main/java/org/foray/common/ColorUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/Configuration.java
trunk/foray/foray-common/src/main/java/org/foray/common/ConfigurationException.java
trunk/foray/foray-common/src/main/java/org/foray/common/Environment.java
trunk/foray/foray-common/src/main/java/org/foray/common/FontOptions4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/FontUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/ForayConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/Gradient4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/IoUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/Java2dUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/MathMlUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/Mime.java
trunk/foray/foray-common/src/main/java/org/foray/common/ParamrefTaglet.java
trunk/foray/foray-common/src/main/java/org/foray/common/SvgUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/AbstractOrderedTreeNode.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/NibbleArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreeNode.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodes.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesChar.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesInt.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTreeMap.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/encoding/Latin1Encoding.java
trunk/foray/foray-common/src/main/java/org/foray/common/encoding/SingleByteEncoding.java
trunk/foray/foray-common/src/main/java/org/foray/common/encoding/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Orthography4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/RandomAccessInput.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/RandomAccessInputArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/RandomAccessInputFile.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/RandomAccessInputUrl.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/SimpleDataSource.java
trunk/foray/foray-common/src/main/java/org/foray/common/io/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphen4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBoxChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaBranch4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaConfig4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaGlueChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaLeaf4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/ParaPenaltyChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/para/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BooleanUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.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/CharacterUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharsetUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/NumberUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ObjectUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/String4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringBytes.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringLatin1.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtf16.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.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/main/java/org/foray/common/primitive/XmlUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/BoundingBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsColor.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/resource/ResourceLocation.java
trunk/foray/foray-common/src/main/java/org/foray/common/resource/ResourceLocationClasspath.java
trunk/foray/foray-common/src/main/java/org/foray/common/resource/ResourceLocationUrl.java
trunk/foray/foray-common/src/main/java/org/foray/common/resource/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/AbstractProtocolRegistration.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/FactoryProtocolRegistration.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/ForayUrlStreamHandlerFactory.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/PropertyProtocolRegistration.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/ProtocolRegistrationBroker.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/ProtocolRegistrationStrategy.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/UniversalProtocolRegistration.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlFactory.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlUtil.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/classpath/Handler.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/classpath/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/package-info.java
trunk/foray/foray-common/src/main/java/org/foray/common/xml/DocumentInputSource.java
trunk/foray/foray-common/src/main/java/org/foray/common/xml/DocumentReader.java
trunk/foray/foray-common/src/main/java/org/foray/common/xml/SaxParser.java
trunk/foray/foray-common/src/main/java/org/foray/common/xml/package-info.java
trunk/foray/foray-common/src/main/resources/CatalogManager.properties
trunk/foray/foray-common/src/main/resources/logback.xml
trunk/foray/foray-common/src/test/java/org/foray/common/ConfigurationTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractByteSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractIntSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/IntArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/IntSequenceIteratorTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/LongArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/LongArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/NibbleArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/OrderedTreePath4aTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/PackedIntArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/TernaryTreeMapTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/TernaryTreeTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/encoding/Latin1EncodingTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Country4aTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/i18n/Orthography4aTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/io/RandomAccessInputArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringLatin1Tests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/UnicodeCharUtilsTests.java
trunk/foray/foray-common/src/test/resources/logback-test.xml
trunk/foray/foray-core/build.gradle
trunk/foray/foray-core/src/main/java/org/foray/core/Application.java
trunk/foray/foray-core/src/main/java/org/foray/core/ConfigurationParser.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayDocument.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayException.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForaySession.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-core/src/main/java/org/foray/core/OutputConfig.java
trunk/foray/foray-core/src/main/java/org/foray/core/SessionConfig.java
trunk/foray/foray-core/src/main/java/org/foray/core/package-info.java
trunk/foray/foray-font/build.gradle
trunk/foray/foray-font/src/main/data/base-14/00_readme.txt
trunk/foray/foray-font/src/main/data/base-14/Courier-Bold.afm
trunk/foray/foray-font/src/main/data/base-14/Courier-BoldOblique.afm
trunk/foray/foray-font/src/main/data/base-14/Courier-Oblique.afm
trunk/foray/foray-font/src/main/data/base-14/Courier.afm
trunk/foray/foray-font/src/main/data/base-14/Helvetica-Bold.afm
trunk/foray/foray-font/src/main/data/base-14/Helvetica-BoldOblique.afm
trunk/foray/foray-font/src/main/data/base-14/Helvetica-Oblique.afm
trunk/foray/foray-font/src/main/data/base-14/Helvetica.afm
trunk/foray/foray-font/src/main/data/base-14/MustRead.html
trunk/foray/foray-font/src/main/data/base-14/Symbol.afm
trunk/foray/foray-font/src/main/data/base-14/Times-Bold.afm
trunk/foray/foray-font/src/main/data/base-14/Times-BoldItalic.afm
trunk/foray/foray-font/src/main/data/base-14/Times-Italic.afm
trunk/foray/foray-font/src/main/data/base-14/Times-Roman.afm
trunk/foray/foray-font/src/main/data/base-14/ZapfDingbats.afm
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelector.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorCbc.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontSelectorFactory.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/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/Subset.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfigGenerator.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfigParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfiguredFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontDesc.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/FontContent.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/FontParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/FontParserClient.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/Kerning.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/Panose4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/AbstractOtfLayoutTable.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfCoverage.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfCoveragex01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfCoveragex02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfFeature.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLanguageSystem.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsub.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubSubtable.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx01x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx01x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx02x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx03x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx04x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x03.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x03.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx07x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx08x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfScript.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollection.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeCollectionLister.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeContainer.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/ttf/TrueTypeSingle.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtcTableHeader.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfMtxEntry.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTable.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfSubSetFile.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTable.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableBase.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCff.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCff2.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCmap.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableCvt.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableFpgm.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGasp.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGdef.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGpos.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGsub.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHead.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHhea.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableHmtx.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableJstf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableLoca.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableMath.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableMaxp.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableOs2.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePclt.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePrep.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableVorg.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfa.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParserPfb.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/Type1MetricsParser.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/java/org/foray/font/format/type1/Type1MetricsSerializer.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/output/FontPdfUtilities.java
trunk/foray/foray-font/src/main/java/org/foray/font/output/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/package-info.java
trunk/foray/foray-font/src/main/java/org/foray/font/util/MockFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/util/package-info.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/TestFont4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/TestFontServer4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/KerningTests.java
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/TrueTypeCollectionParserTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/TrueTypeFontParserTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfaTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1FontParserPfbTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/type1/Type1MetricsParserAfmTests.java
trunk/foray/foray-font/src/test/resources/font-config.xml
trunk/foray/foray-font/src/test/resources/source-ams/00-readme.txt
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/README
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/README
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmb10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbsy10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx5.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx6.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbx9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbxsl10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmbxti10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmcsc10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmdunh10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmex10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmff10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmfi10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmfib8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cminch.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmitt10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi5.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi6.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmi9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmmib10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr17.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr5.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr6.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmr9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsl10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsl12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsl8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsl9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsltt10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmss10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmss12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmss17.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmss8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmss9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssbx10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssdc10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssi10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssi12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssi17.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssi8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssi9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssq8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmssqi8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy5.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy6.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmsy9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtcsc10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtex10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtex8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtex9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmti10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmti12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmti7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmti8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmti9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtt10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtt12.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtt8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmtt9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmu10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/cmvtt10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy5.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy6.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy7.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasy9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lasyb10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lcircle1.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lcirclew.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lcmss8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lcmssb8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/lcmssi8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/line10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/linew10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/logo10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/logo8.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/logo9.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/logobf10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/afm/logosl10.afm
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/cmsample.tex
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmb10.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbsy10.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx10.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx12.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx5.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx6.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx7.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx8.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx9.pfb
trunk/foray/foray-font/src/test/resources/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmbx...
[truncated message content] |