Thread: [FOray-commit] SF.net SVN: foray:[13837] trunk/foray (Page 46)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2025-06-11 21:53:17
|
Revision: 13837
http://sourceforge.net/p/foray/code/13837
Author: victormote
Date: 2025-06-11 21:53:14 +0000 (Wed, 11 Jun 2025)
Log Message:
-----------
Upgrade checkstyle to 10.23, to match Eclipse plugin. Fix config change to JavadocVariable made in 10.22.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/foray-00-dev/config/checkstyle/checkstyle-config.xml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-10 15:04:27 UTC (rev 13836)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-11 21:53:14 UTC (rev 13837)
@@ -69,7 +69,7 @@
// logbackClassic: '1.3.5', // Latest is 1.3.5 as of 2022-11-26.
/* Build-time-only dependencies that should never be permanently used in build.gradle files. */
- checkstyle: '10.4', // Latest is 10.6 as of 2023-01-23. See Note 6.
+ checkstyle: '10.23', // Latest is 10.25 as of 2025-06-11. See Note 6.
]
/*
* Notes on Dependency Releases (See above for references)
@@ -91,7 +91,7 @@
* Java version used to start Gradle. For now, using a JDK that matches the javaTargetCompatibility value above
* seems to solve the problem.
*
- * 6. The current (as of 2023-01-23) Eclipse plugin for checkstyle uses Checkstyle 10.4.
+ * 6. The current (as of 2025-06-11) Eclipse plugin for checkstyle uses Checkstyle 10.23.
* We will use that for now to avoid configuration conflicts between the two versions.
*/
Modified: trunk/foray/foray-00-dev/config/checkstyle/checkstyle-config.xml
===================================================================
--- trunk/foray/foray-00-dev/config/checkstyle/checkstyle-config.xml 2025-06-10 15:04:27 UTC (rev 13836)
+++ trunk/foray/foray-00-dev/config/checkstyle/checkstyle-config.xml 2025-06-11 21:53:14 UTC (rev 13837)
@@ -149,7 +149,7 @@
<!-- Make sure each variable has javadoc. -->
<module name="JavadocVariable">
- <property name="scope" value="private"/>
+ <property name="accessModifiers" value="private"/>
</module>
<!-- Check the javadoc style. If there is a javadoc comment, it must be well-formed, even if it is private. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-12 16:42:32
|
Revision: 13839
http://sourceforge.net/p/foray/code/13839
Author: victormote
Date: 2025-06-12 16:42:29 +0000 (Thu, 12 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Reintroduce the ConsumerFont interface, as being necessary to keep encoding-related issues separate from font-related issues.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.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 2025-06-12 13:01:07 UTC (rev 13838)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-12 16:42:29 UTC (rev 13839)
@@ -34,12 +34,17 @@
import org.foray.font.ttf.TrueTypeFont;
import org.foray.font.ttf.TtfSubSetFile;
import org.foray.font.type1.Type1Font;
+import org.foray.primitive.sequence.ByteArray;
import org.foray.ps.encode.EncodingVector4a;
+import org.axsl.font.ConsumerFont;
import org.axsl.font.FontException;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.Encoding;
import org.axsl.ps.EncodingVector;
+import org.slf4j.LoggerFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -46,17 +51,9 @@
import java.util.List;
/**
- * <p>A ConsumerFont represents a Font as used by a specific FontConsumer.
- * The key fields are therefore a Font and a FontConsumer.
- * The main responsibilities of this class are:</p>
- * <ul>
- * <li>To supply a FontUse with the proper encoding when it is requested by
- * a FontConsumer.</li>
- * <li>To handle subsetting.</li>
- * </ul>
- *
+ * FOray implementation of {@link ConsumerFont}.
*/
-public class ConsumerFont4a {
+public class ConsumerFont4a implements ConsumerFont {
/** Constant indicating the maximum expected file size. */
private static final int EXPECTED_FILE_SIZE = 128000;
@@ -358,5 +355,94 @@
return null;
}
+ @Override
+ public ByteSequence getContent() {
+ if (! getFOrayFont().isEmbeddable()) {
+ return null;
+ }
+ if (! (getFOrayFont() instanceof FreeStandingFont)) {
+ return null;
+ }
+ final FreeStandingFont fsf = (FreeStandingFont) getFOrayFont();
+ byte[] embeddableFont = null;
+ try {
+ embeddableFont = getRawFontFile();
+ } catch (final IOException | FontException e) {
+ final String message = "Failed to get contents for " + fsf.getPostscriptName();
+ LoggerFactory.getLogger(this.getClass()).error(message, e);
+ }
+ return new ByteArray(embeddableFont);
+ }
+ @Override
+ public ByteSequence getContentPostScriptHex() {
+ if (! (this.font instanceof FsType1Font)) {
+ return null;
+ }
+ final FsType1Font type1Font = (FsType1Font) font;
+ Type1Font pfb = null;
+ try {
+ pfb = type1Font.getType1File();
+ } catch (final FontException e1) {
+ /* TODO: Handle the exception at a lower level and remove this catch. */
+ return null;
+ }
+ return new ByteArray(pfb.getByteArray());
+ }
+
+ /**
+ * Return the type1 font, if any, associated with this font use.
+ * @return The type1 font.
+ */
+ private Type1Font getType1Font() {
+ final Font4a forayFont = getFOrayFont();
+ if (forayFont instanceof FsType1Font) {
+ final FsType1Font type1Font = (FsType1Font) forayFont;
+ try {
+ return type1Font.getType1File();
+ } catch (final FontException e) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public int getEmbeddableLength1() {
+ /* TODO: This needs to handle subsets. */
+ final Type1Font type1Font = getType1Font();
+ if (type1Font == null) {
+ final ByteSequence content = getContent();
+ if (content == null) {
+ return 0;
+ }
+ return content.length();
+ } else {
+ return type1Font.getLength1();
+ }
+ }
+
+ @Override
+ public int getEmbeddableLength2() {
+ /* TODO: This needs to handle subsets. */
+ final Type1Font type1Font = getType1Font();
+ if (type1Font == null) {
+ return 0;
+ } else {
+ return type1Font.getLength2();
+ }
+ }
+
+ @Override
+ public int getEmbeddableLength3() {
+ /* TODO: This needs to handle subsets. */
+ final Type1Font type1Font = getType1Font();
+ if (type1Font == null) {
+ return 0;
+ } else {
+ return type1Font.getLength3();
+ }
+ }
+
}
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 2025-06-12 13:01:07 UTC (rev 13838)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-12 16:42:29 UTC (rev 13839)
@@ -33,8 +33,6 @@
import org.foray.font.config.RegisteredFont;
import org.foray.font.ttf.TrueTypeFont;
import org.foray.font.ttf.table.GsubTable;
-import org.foray.font.type1.Type1Font;
-import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.IntArrayBuilder;
import org.foray.primitive.sequence.ShortArrayBuilder;
import org.foray.ps.encode.CharSet;
@@ -42,14 +40,13 @@
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.constants.TypographicConstants;
+import org.axsl.font.ConsumerFont;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
-import org.axsl.font.FontException;
import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
-import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.IntSequence;
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
@@ -56,10 +53,6 @@
import org.axsl.unicode.block.U0000_Basic_Latin;
import org.axsl.value.FontStretch;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
@@ -108,6 +101,11 @@
}
@Override
+ public ConsumerFont getConsumerFont() {
+ return this.consumerFont;
+ }
+
+ @Override
public Font4a getFont() {
return this.consumerFont.getFOrayFont();
}
@@ -465,53 +463,6 @@
}
@Override
- public ByteSequence getContent() {
- /*
- * Returns the Collection of byte arrays to be placed in the embedded
- * font stream in the PDF file, as documented in the PDF Reference,
- * Second Edition, Section 5.8.
- * A collection is used so that, if the user of this method is able to,
- * it can write the elements one at a time, to (in some cases) reduce
- * the amount of memory used.
- */
- if (! getFOrayFont().isEmbeddable()) {
- return null;
- }
- if (! (getFOrayFont() instanceof FreeStandingFont)) {
- return null;
- }
- final FreeStandingFont fsf = (FreeStandingFont) getFOrayFont();
- byte[] embeddableFont = null;
- try {
- embeddableFont = this.consumerFont.getRawFontFile();
- } catch (final IOException e) {
- this.getLogger().error("Failed to get contents for "
- + fsf.getPostscriptName() + ": " + e.getMessage());
- } catch (final FontException e) {
- this.getLogger().error("Error reading contents of "
- + fsf.getPostscriptName() + ": " + e.getMessage());
- }
- return new ByteArray(embeddableFont);
- }
-
- @Override
- public ByteSequence getContentPostScriptHex() {
- final Font font = getFont();
- if (! (font instanceof FsType1Font)) {
- return null;
- }
- final FsType1Font type1Font = (FsType1Font) font;
- Type1Font pfb = null;
- try {
- pfb = type1Font.getType1File();
- } catch (final FontException e1) {
- /* TODO: Handle the exception at a lower level and remove this catch. */
- return null;
- }
- return new ByteArray(pfb.getByteArray());
- }
-
- @Override
public String textToPdf(final CharSequence theString, final FontContext fontContext,
final Orthography orthography) {
final Font font = getFOrayFont();
@@ -697,62 +648,7 @@
return new String(charArray);
}
- /**
- * Return the type1 font, if any, associated with this font use.
- * @return The type1 font.
- */
- private Type1Font getType1Font() {
- final Font4a forayFont = this.consumerFont.getFOrayFont();
- if (forayFont instanceof FsType1Font) {
- final FsType1Font type1Font = (FsType1Font) forayFont;
- try {
- return type1Font.getType1File();
- } catch (final FontException e) {
- return null;
- }
- } else {
- return null;
- }
- }
-
@Override
- public int getEmbeddableLength1() {
- /* TODO: This needs to handle subsets. */
- final Type1Font type1Font = getType1Font();
- if (type1Font == null) {
- final ByteSequence content = getContent();
- if (content == null) {
- return 0;
- }
- return content.length();
- } else {
- return type1Font.getLength1();
- }
- }
-
- @Override
- public int getEmbeddableLength2() {
- /* TODO: This needs to handle subsets. */
- final Type1Font type1Font = getType1Font();
- if (type1Font == null) {
- return 0;
- } else {
- return type1Font.getLength2();
- }
- }
-
- @Override
- public int getEmbeddableLength3() {
- /* TODO: This needs to handle subsets. */
- final Type1Font type1Font = getType1Font();
- if (type1Font == null) {
- return 0;
- } else {
- return type1Font.getLength3();
- }
- }
-
- @Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("[");
@@ -763,13 +659,4 @@
return builder.toString();
}
- /**
- * Returns the logger.
- * @return The logger.
- */
- private Logger getLogger() {
- /* Not cached because not expected to get used much. */
- return LoggerFactory.getLogger(getClass());
- }
-
}
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-12 13:01:07 UTC (rev 13838)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-12 16:42:29 UTC (rev 13839)
@@ -28,12 +28,12 @@
package org.foray.font.fixture;
+import org.axsl.font.ConsumerFont;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
-import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.IntSequence;
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
@@ -54,6 +54,12 @@
return this.font;
}
+ @Override
+ public ConsumerFont getConsumerFont() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
/**
* Set the font.
* @param font The new font.
@@ -185,36 +191,6 @@
}
@Override
- public ByteSequence getContent() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public int getEmbeddableLength1() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int getEmbeddableLength2() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int getEmbeddableLength3() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public ByteSequence getContentPostScriptHex() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public CharSequence textToPdf(final CharSequence theString, final FontContext fontOptions,
final Orthography orthography) {
// TODO Auto-generated method stub
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java 2025-06-12 13:01:07 UTC (rev 13838)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java 2025-06-12 16:42:29 UTC (rev 13839)
@@ -31,6 +31,7 @@
import org.foray.pdf.document.PdfDocument4a;
import org.foray.pdf.type.PdfStream;
+import org.axsl.font.ConsumerFont;
import org.axsl.font.FontFormat;
import org.axsl.font.FontUse;
import org.axsl.pdf.PdfException;
@@ -59,7 +60,7 @@
@Override
protected void finalizeStreamContent() throws PdfException {
- final ByteSequence fontFileStream = this.font.getContent();
+ final ByteSequence fontFileStream = this.font.getConsumerFont().getContent();
/* TODO: The addition of the filters below was prohibited by the parent class, PdfStream, because content
* had already been written into the stream without them. There is perhaps some sequencing problem that has
* resulted from the one-step serialization process recently (Dec 2020) implemented. */
@@ -83,13 +84,14 @@
if (! font.getFont().isEmbeddable()) {
return null;
}
+ final ConsumerFont consumerFont = font.getConsumerFont();
if (FontFormat.TYPE1 == font.getFont().getFormat()) {
- return " /Length1 " + font.getEmbeddableLength1()
- + " /Length2 " + font.getEmbeddableLength2()
- + " /Length3 " + font.getEmbeddableLength3();
+ return " /Length1 " + consumerFont.getEmbeddableLength1()
+ + " /Length2 " + consumerFont.getEmbeddableLength2()
+ + " /Length3 " + consumerFont.getEmbeddableLength3();
}
- return " /Length1 " + font.getEmbeddableLength1();
+ return " /Length1 " + consumerFont.getEmbeddableLength1();
}
@Override
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 2025-06-12 13:01:07 UTC (rev 13838)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2025-06-12 16:42:29 UTC (rev 13839)
@@ -355,7 +355,8 @@
if (! font.isEmbeddable()) {
continue;
}
- final String fontContents = ByteArray.fromByteSequence(fontUse.getContentPostScriptHex()).toString();
+ final String fontContents = ByteArray.fromByteSequence(
+ fontUse.getConsumerFont().getContentPostScriptHex()).toString();
write(fontContents);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-12 17:28:59
|
Revision: 13840
http://sourceforge.net/p/foray/code/13840
Author: victormote
Date: 2025-06-12 17:28:53 +0000 (Thu, 12 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Clarify relationships between interfaces be eliminating some shortcuts.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfToUnicodeCmap.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -273,7 +273,7 @@
final FontUse fontUse = getHelveticaFont();
/* The following computation is tested in {@link TestFont4a#testWidth()}. */
final String testString = "Test of Centering";
- final int textWidth = fontUse.getFont().width(
+ final int textWidth = fontUse.getConsumerFont().getFont().width(
testString, 0, testString.length(), 12000, 0, 0, this.fontOptionsWithKerning, null);
assertEquals(textWidth, textArea.crIpd());
@@ -306,7 +306,7 @@
final NormalBlockArea4a blockArea = (NormalBlockArea4a) node;
/* Tests of the block area. */
- assertEquals("Helvetica", blockArea.traitNominalFont().getFont().getFontName());
+ assertEquals("Helvetica", blockArea.traitNominalFont().getConsumerFont().getFont().getFontName());
assertEquals(12000, blockArea.traitFontSize());
assertEquals(TextAlign.CENTER, blockArea.traitTextAlign());
@@ -339,8 +339,8 @@
/* The following computation is tested in {@link TestFont4a#testWidth()}.
* The extra word spacing is .3em = .3 * 12000 = 3600. */
final String testString = "Centered with Word Spacing";
- final int textWidth = fontUse.getFont().width(testString, 0, testString.length(), 12000, 0, 3600,
- this.fontOptionsWithKerning, null);
+ final int textWidth = fontUse.getConsumerFont().getFont().width(testString, 0, testString.length(), 12000, 0,
+ 3600, this.fontOptionsWithKerning, null);
assertEquals(textWidth, textArea.crIpd());
/* The x value of the text area content rectangle should be at the x
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -77,7 +77,7 @@
assertTrue(node instanceof NormalBlockArea4a);
final NormalBlockArea4a blockArea = (NormalBlockArea4a) node;
final FontUse font = blockArea.traitNominalFont();
- assertEquals("Courier", font.getFont().getPostscriptName());
+ assertEquals("Courier", font.getConsumerFont().getFont().getPostscriptName());
assertEquals(12000, blockArea.traitFontSize());
/* The first child of the block area is a line-area. */
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -829,7 +829,7 @@
return DEFAULT_NORMAL_LINE_HEIGHT_FACTOR;
} else {
final Font.LineHeightAlgorithm algorithm = Font.LineHeightAlgorithm.DEFAULT;
- return fontUse.getFont().normalLineHeightFactor(algorithm);
+ return fontUse.getConsumerFont().getFont().normalLineHeightFactor(algorithm);
}
}
@@ -837,7 +837,7 @@
public FontData getFontData() {
if (this instanceof Area4a) {
final Area4a area = (Area4a) this;
- return area.traitNominalFont().getFont();
+ return area.traitNominalFont().getConsumerFont().getFont();
}
return null;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -480,7 +480,8 @@
public int getCharWidth(final int c) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharUsed(c);
- return fontUse.getFont().width(c, traitFontSize()) + this.traitGeneratedBy().traitLetterSpacingOpt(this);
+ return fontUse.getConsumerFont().getFont().width(c, traitFontSize()) +
+ this.traitGeneratedBy().traitLetterSpacingOpt(this);
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -742,7 +742,7 @@
* whole issue needs to be revisited. */
// final Baseline baseline = this.traitDominantBaseline();
final Font.Baseline baseline = Font.Baseline.ALPHABETIC;
- final Font font = traitNominalFont().getFont();
+ final Font font = traitNominalFont().getConsumerFont().getFont();
return font.baselineOffset(axis, baseline, this.traitFontSize());
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -228,7 +228,7 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ return fontUse.getConsumerFont().getFont().width(word, 0, word.length(), traitFontSize(),
traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
fontContext(), getOrthography());
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -249,7 +249,7 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ return fontUse.getConsumerFont().getFont().width(word, 0, word.length(), traitFontSize(),
traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
fontContext(), getOrthography());
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -249,7 +249,7 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ return fontUse.getConsumerFont().getFont().width(word, 0, word.length(), traitFontSize(),
traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
fontContext(), getOrthography());
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -234,7 +234,7 @@
public int getWordWidth(final CharSequence word) {
final FontUse fontUse = traitNominalFont();
fontUse.registerCharsUsed(word);
- return fontUse.getFont().width(word, 0, word.length(), traitFontSize(),
+ return fontUse.getConsumerFont().getFont().width(word, 0, word.length(), traitFontSize(),
traitGeneratedBy().traitLetterSpacingOpt(this), traitGeneratedBy().traitWordSpacingOpt(this),
fontContext(), getOrthography());
}
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 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -400,7 +400,7 @@
*/
int recomputeProgressionDimension() {
final CharSequence text = getText();
- final int pd = traitNominalFont().getFont().width(text, 0, text.length(), traitFontSize(),
+ final int pd = traitNominalFont().getConsumerFont().getFont().width(text, 0, text.length(), traitFontSize(),
traitLetterSpacingOpt(), traitWordSpacingOpt(), fontContext(), getOrthography());
return pd;
}
@@ -603,7 +603,8 @@
*/
public int getIdealIpd() {
final FontUse fontUse = traitNominalFont();
- final int ideal = fontUse.getFont().width(getText(), traitFontSize(), FontContext.DEFAULT, getOrthography());
+ final int ideal = fontUse.getConsumerFont().getFont().width(getText(), traitFontSize(), FontContext.DEFAULT,
+ getOrthography());
return ideal;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -69,7 +69,7 @@
/* TODO: Fix this method after we add the context to this class. */
final CommonFontPa asText = (CommonFontPa) this.content;
final int fontSize = asText.traitFontSize(null);
- final int zeroWidth = getFontUse().getFont().width('0', fontSize);
+ final int zeroWidth = getFontUse().getConsumerFont().getFont().width('0', fontSize);
// This is an estimate for purposes of layout.
return zeroWidth * QTY_PLACEHOLDER_DIGITS;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -120,7 +120,7 @@
final Orthography orthography = this.content.getOrthography();
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return getFontUse().getFont().width(chars, fontSize, FontContext.DEFAULT, orthography);
+ return getFontUse().getConsumerFont().getFont().width(chars, fontSize, FontContext.DEFAULT, orthography);
}
return 0;
}
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 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -84,6 +84,11 @@
}
}
+ @Override
+ public Font4a getFont() {
+ return this.font;
+ }
+
/**
* Returns the parent font.
* @return The font.
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -42,7 +42,6 @@
import org.axsl.constants.TypographicConstants;
import org.axsl.font.ConsumerFont;
import org.axsl.font.Font;
-import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontUse;
@@ -105,11 +104,6 @@
return this.consumerFont;
}
- @Override
- public Font4a getFont() {
- return this.consumerFont.getFOrayFont();
- }
-
/**
* Return the Font instance cast as a {@link Font4a}.
* @return The {@link Font4a} instance.
@@ -284,7 +278,7 @@
return fontSize;
}
if (percent.equals(FontFeatureSimulation.SMALL_CAP_SIMULATION_NATIVE)) {
- final Font4a font = getFont();
+ final Font4a font = this.consumerFont.getFont();
int smallCapsSize = font.getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
smallCapsSize /= font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
smallCapsSize *= NumericConstants.PERCENT_CONVERSION;
@@ -310,18 +304,13 @@
@Override
public String getPostscriptName() {
- final String postScriptName = this.getFont().getPostscriptName();
- if (this.encoding == this.getFont().getInternalEncoding()) {
+ final String postScriptName = getConsumerFont().getFont().getPostscriptName();
+ if (this.encoding == getConsumerFont().getFont().getInternalEncoding()) {
return postScriptName;
}
return postScriptName + "-" + this.encoding.getName();
}
- @Override
- public FontConsumer getFontConsumer() {
- return this.consumerFont.getFontConsumer();
- }
-
/**
* Returns the font consumer instance.
* @return The font consumer instance.
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -29,8 +29,6 @@
package org.foray.font.fixture;
import org.axsl.font.ConsumerFont;
-import org.axsl.font.Font;
-import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
@@ -47,34 +45,22 @@
public class MockFontUse implements FontUse {
/** The font. */
- private Font font;
+ private ConsumerFont font;
@Override
- public Font getFont() {
+ public ConsumerFont getConsumerFont() {
return this.font;
}
- @Override
- public ConsumerFont getConsumerFont() {
- // TODO Auto-generated method stub
- return null;
- }
-
/**
* Set the font.
* @param font The new font.
*/
- public void setFont(final Font font) {
+ public void setFont(final ConsumerFont font) {
this.font = font;
}
@Override
- public FontConsumer getFontConsumer() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public FontUse getNextBest(final int codePoint) {
// TODO Auto-generated method stub
return null;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -276,7 +276,7 @@
/* TODO: If letter-spacing is used, it needs to come from the SVG. */
final int letterSpacing = 0;
/* TODO: Pass the font options below instead of hard-coding them. */
- final int width = fontToUse.getFont().width(txt, 0, txt.length(),
+ final int width = fontToUse.getConsumerFont().getFont().width(txt, 0, txt.length(),
awtFontSize * TypographicConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
this.orthography);
final float advance = width / (float) TypographicConstants.MILLIPOINTS_PER_POINT;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/KpContext4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -81,7 +81,7 @@
public int getIdealWidth(final KpLeaf leaf) {
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return this.fontUse.getFont().width(chars, fontSize, fontContext, orthography);
+ return this.fontUse.getConsumerFont().getFont().width(chars, fontSize, fontContext, orthography);
}
return 0;
}
@@ -98,7 +98,7 @@
@Override
public int getHyphenCharacterWidth() {
- return this.fontUse.getFont().width(this.hyphenationCharacter, this.fontSize);
+ return this.fontUse.getConsumerFont().getFont().width(this.hyphenationCharacter, this.fontSize);
}
/**
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -34,6 +34,7 @@
import org.foray.orthography.Punctuation4a;
import org.axsl.context.LineBreakContext;
+import org.axsl.font.ConsumerFont;
import org.axsl.kp.KpBoxTf;
import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpContext;
@@ -109,7 +110,9 @@
public static void initializeClass() {
font = new MockMonotypeFont(true);
fontUse = new MockFontUse();
- fontUse.setFont(font);
+ final ConsumerFont consumerFont = Mockito.mock(ConsumerFont.class);
+ Mockito.when(consumerFont.getFont()).thenReturn(font);
+ fontUse.setFont(consumerFont);
/* Set up the same glue items used by Knuth-Plass, so that our computations of adjustments can be compared.
* See "Knuth, Digital Typography, p. 75" for values. */
kpSpaceAfterComma = createSpecialGlue(font, 6, 4, 2);
@@ -463,7 +466,7 @@
protected LineBreakContext createGrimmLineBreakContext(final KpContext4a kpContext) {
/* Line width of 390 Monotype "units" is obtained from "Digital Typography," p. 73.
* We convert to millipoints to match the line-breaking logic. */
- final int lineWidth = kpContext.getFontUse().getFont().toMillipoints(390, GRIMM_FONT_SIZE);
+ final int lineWidth = kpContext.getFontUse().getConsumerFont().getFont().toMillipoints(390, GRIMM_FONT_SIZE);
assertEquals(390_000, lineWidth);
final LineBreakContext lbContext = createLineBreakTarget(lineWidth);
return lbContext;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -487,7 +487,7 @@
* @return The appropriate PdfFont4a instance.
*/
public PdfFont4a getPdfFont(final FontUse fontUse) {
- final Font font = fontUse.getFont();
+ final Font font = fontUse.getConsumerFont().getFont();
/* Look for a match in the existing fonts. */
for (int i = 0; i < this.usedFonts.size(); i++) {
final PdfFont4a pdfFont = this.usedFonts.get(i);
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -125,7 +125,7 @@
@Override
public ByteSequencePlus serialize() {
- final Font font = this.fsFont.getFont();
+ final Font font = this.fsFont.getConsumerFont().getFont();
final StringBuilder p = new StringBuilder();
p.append(getSerializedId() + EOL);
p.append("<< /Type /Font");
@@ -171,7 +171,7 @@
* @return The CID Font subtype for {@code fsFont}.
*/
protected static PdfCidFont.SubType getCidType(final FontUse fsFont) {
- final Font font = fsFont.getFont();
+ final Font font = fsFont.getConsumerFont().getFont();
if (font.getFormat() == FontFormat.TRUETYPE) {
return PdfCidFont.SubType.CID_TYPE2;
}
@@ -183,7 +183,7 @@
* @return The array of glyph widths for this font.
*/
private ShortSequence getCIDWidths() {
- if (! this.fsFont.getFont().isEmbeddable()) {
+ if (! this.fsFont.getConsumerFont().getFont().isEmbeddable()) {
return null;
}
return this.fsFont.getWidths();
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -140,7 +140,7 @@
*/
public static PdfFont4a makeFont(final PdfDocument4a pdfDoc, final FontUse fsFont) {
PdfFont4a font = null;
- if (fsFont.getFont().isPdfStandardFont()) {
+ if (fsFont.getConsumerFont().getFont().isPdfStandardFont()) {
font = new PdfFont4a(pdfDoc, fsFont);
} else {
switch (PdfFont4a.getFontSubtype(fsFont)) {
@@ -408,10 +408,10 @@
* @return The font subtype.
*/
public static SubType getFontSubtype(final FontUse fontUse) {
- if (fontUse.getFont().getFontComplexity() == Font.Complexity.COMPOSITE) {
+ if (fontUse.getConsumerFont().getFont().getFontComplexity() == Font.Complexity.COMPOSITE) {
return PdfFont4a.SubType.TYPE0;
}
- if (FontFormat.TYPE1 == fontUse.getFont().getFormat()) {
+ if (FontFormat.TYPE1 == fontUse.getConsumerFont().getFont().getFormat()) {
return PdfFont4a.SubType.TYPE1;
}
return PdfFont4a.SubType.TRUETYPE;
@@ -451,7 +451,7 @@
@Override
public Font getFont() {
/* If available, delegate this to the FontUse instance. */
- return this.fsFont == null ? null : this.fsFont.getFont();
+ return this.fsFont == null ? null : this.fsFont.getConsumerFont().getFont();
}
@Override
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -51,7 +51,7 @@
* @throws PdfException If the font is not embeddable.
*/
public PdfFontFileStream(final FontUse font) throws PdfException {
- if (! font.getFont().isEmbeddable()) {
+ if (! font.getConsumerFont().getFont().isEmbeddable()) {
throw new PdfException("Can't create PdfFontFileStream for a Font "
+ "that is not embeddable.");
}
@@ -81,12 +81,12 @@
* @return The String containing the "Additional entries".
*/
public String getPdfFontFileStreamAdditional() {
- if (! font.getFont().isEmbeddable()) {
+ if (! font.getConsumerFont().getFont().isEmbeddable()) {
return null;
}
final ConsumerFont consumerFont = font.getConsumerFont();
- if (FontFormat.TYPE1 == font.getFont().getFormat()) {
+ if (FontFormat.TYPE1 == font.getConsumerFont().getFont().getFormat()) {
return " /Length1 " + consumerFont.getEmbeddableLength1()
+ " /Length2 " + consumerFont.getEmbeddableLength2()
+ " /Length3 " + consumerFont.getEmbeddableLength3();
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfToUnicodeCmap.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfToUnicodeCmap.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfToUnicodeCmap.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -98,7 +98,7 @@
writeCIDSystemInfo(builder);
writeVersionTypeName(builder);
writeCodeSpaceRange(builder);
- if (this.fsFont.getFont().isEmbeddable()) {
+ if (this.fsFont.getConsumerFont().getFont().isEmbeddable()) {
final String bfEntries = getToUnicodeBf();
builder.append(bfEntries);
writeBFEntries(builder);
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2025-06-12 16:42:29 UTC (rev 13839)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/LineBreaker.java 2025-06-12 17:28:53 UTC (rev 13840)
@@ -93,7 +93,8 @@
codePointToUse = java.lang.Character.toUpperCase((char) codePoint);
}
fontUse.registerCharUsed(codePointToUse);
- return fontUse.getFont().width(codePointToUse, fontSize) + lineText.inlineLetterSpacingOptimum();
+ return fontUse.getConsumerFont().getFont().width(codePointToUse, fontSize) +
+ lineText.inlineLetterSpacingOptimum();
}
...
[truncated message content] |
|
From: <vic...@us...> - 2025-06-12 21:44:18
|
Revision: 13842
http://sourceforge.net/p/foray/code/13842
Author: victormote
Date: 2025-06-12 21:44:15 +0000 (Thu, 12 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Move listing of FontUse instances from FontConsumer to ConsumerFont, to clean up the tree structure.
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-render/src/main/java/org/foray/render/ps/PsRenderer.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 2025-06-12 20:18:16 UTC (rev 13841)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-12 21:44:15 UTC (rev 13842)
@@ -39,6 +39,7 @@
import org.axsl.font.ConsumerFont;
import org.axsl.font.FontException;
+import org.axsl.font.FontUse;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.Encoding;
import org.axsl.ps.EncodingVector;
@@ -48,6 +49,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -450,4 +452,9 @@
}
}
+ @Override
+ public List<? extends FontUse> getUsedFontUses() {
+ return Collections.unmodifiableList(this.fontUses);
+ }
+
}
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 2025-06-12 20:18:16 UTC (rev 13841)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2025-06-12 21:44:15 UTC (rev 13842)
@@ -407,31 +407,6 @@
return Collections.unmodifiableList(consumerFonts);
}
- @Override
- public List<FontUse4a> getUsedFontUses() {
- if (this.usedFonts.size() < 1) {
- return Collections.emptyList();
- }
- /* How big should the array be? */
- int count = 0;
- for (ConsumerFont4a consumerFont : this.usedFonts.values()) {
- count += consumerFont.getFontUses().size();
- }
- if (count < 1) {
- return Collections.emptyList();
- }
- final List<FontUse4a> toReturn = new ArrayList<FontUse4a>(count);
-
- for (ConsumerFont4a consumerFont : this.usedFonts.values()) {
- final List<FontUse4a> fontUses = consumerFont.getFontUses();
- for (int i = 0; i < fontUses.size(); i++) {
- final FontUse4a fontUse = fontUses.get(i);
- toReturn.add(fontUse);
- }
- }
- return toReturn;
- }
-
/**
* Record the fact that this FontConsumer has used this font.
* @param font The Font instance that was used.
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 2025-06-12 20:18:16 UTC (rev 13841)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2025-06-12 21:44:15 UTC (rev 13842)
@@ -43,6 +43,7 @@
import org.axsl.constants.MimeConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.constants.TypographicConstants;
+import org.axsl.font.ConsumerFont;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.galley.AreaG5;
@@ -342,7 +343,14 @@
* @throws IOException For errors writing to output.
*/
protected void writeFontDict() throws IOException {
- final List<? extends FontUse> fontUses = getFontConsumer().getUsedFontUses();
+ final List<? extends ConsumerFont> consumerFonts = getFontConsumer().getUsedFonts();
+ final List<FontUse> fontUses = new ArrayList<FontUse>();
+ for (int index = 0; index < consumerFonts.size(); index ++) {
+ final ConsumerFont consumerFont = consumerFonts.get(index);
+ for (int index2 = 0; index2 < consumerFont.getUsedFontUses().size(); index2 ++) {
+ fontUses.add(consumerFont.getUsedFontUses().get(index2));
+ }
+ }
/* Embed fonts. */
for (int i = 0; i < fontUses.size(); i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-13 11:33:25
|
Revision: 13844
http://sourceforge.net/p/foray/code/13844
Author: victormote
Date: 2025-06-13 11:33:22 +0000 (Fri, 13 Jun 2025)
Log Message:
-----------
Clarify heritage of RegisteredFont.
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/FontServer4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.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
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 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -213,7 +213,7 @@
// final Encoding encoding = findEncoding(rfd, codePoint);
if (encoding == null) {
/* No encoding was configured, meaning that the native encoding should be used. */
- final RegisteredFontContent content = rfd.getRegisteredFont();
+ final RegisteredFontContent content = rfd.getRegisteredFontContent();
final Font4a font = content.getBestFont();
encoding = font.getInternalEncoding();
}
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 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -293,9 +293,9 @@
}
Font4a fontSelected = null;
if (this.selectionConstraints.canSelectFreeStandingFonts()) {
- fontSelected = fontDescSelected.getRegisteredFont().getFreeStandingFont();
+ fontSelected = fontDescSelected.getRegisteredFontContent().getFreeStandingFont();
} else {
- fontSelected = fontDescSelected.getRegisteredFont().getSystemFont();
+ fontSelected = fontDescSelected.getRegisteredFontContent().getSystemFont();
}
final ConsumerFont4a consumerFont = registerFontUse(fontSelected);
return consumerFont.getFontUse(fontDescSelected, fontSelected.getInternalEncoding());
@@ -319,7 +319,7 @@
* @return The FontUse instance dictated by the parameters of consumer.
*/
protected Font4a whichUse(final RegisteredFont rfd) {
- final RegisteredFontContent rf = rfd.getRegisteredFont();
+ final RegisteredFontContent rf = rfd.getRegisteredFontContent();
/* Avoid instantiating the non-preferred manifestation if it won't be
* used anyway. */
@@ -356,7 +356,7 @@
if (! this.selectionConstraints.canSelectFreeStandingFonts()) {
return null;
}
- final FreeStandingFont fsf = rfd.getRegisteredFont().getFreeStandingFont();
+ final FreeStandingFont fsf = rfd.getRegisteredFontContent().getFreeStandingFont();
if (fsf == null) {
return null;
}
@@ -509,7 +509,7 @@
for (RegisteredFontFamily rff : this.server.registeredFontFamilies()) {
for (int i = 0; i < rff.getRegisteredFonts().size(); i++) {
final RegisteredFont rfd = rff.getRegisteredFonts().get(i);
- final Panose4a panoseInstance = rfd.getRegisteredFont()
+ final Panose4a panoseInstance = rfd.getRegisteredFontContent()
.getPanose();
final long difference = panoseInstance.difference(desiredPanose, null);
if (difference < bestDifference) {
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 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -240,12 +240,14 @@
}
/* Punt and try to create something that will work. */
try {
- final RegisteredFontContent rf = new RegisteredFontContent(this, null, null, null, null, null, "serif");
- final RegisteredFontFamily rff = this.registerFontFamily2("serif");
- final RegisteredFont font = new RegisteredFont(rf, rff, null, FontStyle.NORMAL,
+ final RegisteredFontContent registeredFontContent =
+ new RegisteredFontContent(this, null, null, null, null, null, "serif");
+ final RegisteredFontFamily registeredFontFamily = this.registerFontFamily2("serif");
+ final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, null, FontStyle.NORMAL,
FontWeight.NORMAL, FontVariant.NORMAL,
FontStretch.NORMAL, FontFeatureSimulation.DEFAULT);
- rff.registerFont(font);
+ registeredFontFamily.registerFont(registeredFont);
+ registeredFont.registerContent(registeredFontContent);
} catch (final FontException e) {
getLogger().error("Unable to create default system font.");
}
@@ -595,11 +597,10 @@
}
for (int i = 0; i < fontList.size(); i++) {
final Font awtFont = fontList.get(i);
- RegisteredFontFamily rff = this.getRegisteredFontFamily(
- awtFont.getFamily());
- if (rff == null) {
+ RegisteredFontFamily registeredFontFamily = this.getRegisteredFontFamily(awtFont.getFamily());
+ if (registeredFontFamily == null) {
try {
- rff = registerFontFamily2(awtFont.getFamily());
+ registeredFontFamily = registerFontFamily2(awtFont.getFamily());
} catch (final FontException e) {
/* This should never happen. We just made sure it doesn't
* already exist. */
@@ -606,9 +607,9 @@
continue;
}
}
- final RegisteredFontContent rf;
+ final RegisteredFontContent registeredFontContent;
try {
- rf = new RegisteredFontContent(this, awtFont.getFontName(),
+ registeredFontContent = new RegisteredFontContent(this, awtFont.getFontName(),
null, null, null, org.axsl.font.Font.Embedding.NONE, awtFont.getFontName());
} catch (final FontException e) {
this.logger.error(e.getMessage());
@@ -624,10 +625,11 @@
}
final FontVariant fontVariant = FontVariant.NORMAL;
final FontStretch fontStretch = FontStretch.NORMAL;
- final RegisteredFont font = new RegisteredFont(rf, rff, null, fontStyle, fontWeight, fontVariant,
- fontStretch, FontFeatureSimulation.DEFAULT);
+ final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, null, fontStyle, fontWeight,
+ fontVariant, fontStretch, FontFeatureSimulation.DEFAULT);
+ registeredFont.registerContent(registeredFontContent);
try {
- rff.registerFont(font);
+ registeredFontFamily.registerFont(registeredFont);
} catch (final FontException e) {
this.logger.error(e.getMessage());
}
@@ -838,7 +840,7 @@
if (rfdList != null) {
for (int i = 0; i < rfdList.size(); i++) {
final RegisteredFont rfd = rfdList.get(i);
- final RegisteredFontContent rf = rfd.getRegisteredFont();
+ final RegisteredFontContent rf = rfd.getRegisteredFontContent();
if (freeStandingFonts
&& rf.getFreeStandingFont() != null) {
fontList.add(rf.getFreeStandingFont());
@@ -1038,10 +1040,12 @@
final FontStretch stretch,
final FontFeatureSimulation simulation)
throws FontException {
- final RegisteredFontFamily rff = this.getRegisteredFontFamily(fontFamily);
- final RegisteredFontContent rf = this.getRegisteredFont(fontID);
- final RegisteredFont font = new RegisteredFont(rf, rff, encoding, style, weight, variant, stretch, simulation);
- rff.registerFont(font);
+ final RegisteredFontFamily registeredFontFamily = this.getRegisteredFontFamily(fontFamily);
+ final RegisteredFontContent registeredFontContent = this.getRegisteredFont(fontID);
+ final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, encoding, style, weight, variant,
+ stretch, simulation);
+ registeredFont.registerContent(registeredFontContent);
+ registeredFontFamily.registerFont(registeredFont);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -464,10 +464,11 @@
/* TODO: Reactivate parsing of the simulation parameters and add them to simulation below. */
final FontFeatureSimulation4a simulation = new FontFeatureSimulation4a();
- final RegisteredFont font = new RegisteredFont(content, this.currentFontFamily, encoding, style, weight,
+ final RegisteredFont font = new RegisteredFont(this.currentFontFamily, encoding, style, weight,
variant, stretch, simulation);
+ font.registerContent(content);
- if (font.getRegisteredFont() == null) {
+ if (font.getRegisteredFontContent() == null) {
final UnresolvedFont unresolved = new UnresolvedFont();
unresolved.font = font;
unresolved.fontContentId = contentString;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -80,10 +80,7 @@
* stretch bucket. */
public static final byte SIMULATE_ULTRA_EXPANDED_INDEX = 7;
- /** The RegisteredFont instance. */
- private RegisteredFontContent registeredFont;
-
- /** The parent RegisteredFontFamily instance. */
+ /** The parent {@link RegisteredFontFamily} instance. */
private RegisteredFontFamily registeredFontFamily;
/** The encoding to be used. */
@@ -104,11 +101,13 @@
/** The font feature simulation for this registered font. */
private FontFeatureSimulation fontFeatureSimulation;
+ /** The content for this registered font. */
+ private RegisteredFontContent registeredFontContent;
+
/**
* Constructor.
- * @param rf The parent registered font.
- * @param rff The parent registered font family.
- * @param encoding The specified encoding.
+ * @param registeredFontFamily The parent registered font family.
+ * @param defaultEncoding 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)
@@ -115,12 +114,11 @@
* @param fontStretch The font stretch (normal, condensed, etc.)
* @param simulation The font features to be simulated if not natively present.
*/
- public RegisteredFont(final RegisteredFontContent rf, final RegisteredFontFamily rff, final Encoding encoding,
+ public RegisteredFont(final RegisteredFontFamily registeredFontFamily, final Encoding defaultEncoding,
final FontStyle fontStyle, final FontWeight fontWeight, final FontVariant fontVariant,
final FontStretch fontStretch, final FontFeatureSimulation simulation) {
- this.registeredFont = rf;
- this.registeredFontFamily = rff;
- this.encoding = encoding;
+ this.registeredFontFamily = registeredFontFamily;
+ this.encoding = defaultEncoding;
this.fontStyle = fontStyle;
this.fontWeight = fontWeight;
this.fontVariant = fontVariant;
@@ -129,6 +127,14 @@
}
/**
+ * Registers the content for this font.
+ * @param registeredFontContent The parent registered font.
+ */
+ public void registerContent(final RegisteredFontContent registeredFontContent) {
+ this.registeredFontContent = registeredFontContent;
+ }
+
+ /**
* Returns the font style.
* @return The font style.
*/
@@ -164,8 +170,8 @@
* Returns the related registered font instance.
* @return The related registered font instance.
*/
- public RegisteredFontContent getRegisteredFont() {
- return this.registeredFont;
+ public RegisteredFontContent getRegisteredFontContent() {
+ return this.registeredFontContent;
}
/**
@@ -178,8 +184,8 @@
* @throws IllegalStateException If this method is called on an instance for which the content is already set.
*/
public void setRegisteredFontContent(final RegisteredFontContent content) {
- if (this.registeredFont == null) {
- this.registeredFont = content;
+ if (this.registeredFontContent == null) {
+ this.registeredFontContent = content;
} else {
throw new IllegalStateException("The content of this font has already been set.");
}
@@ -420,10 +426,10 @@
*/
public boolean generalTypeMatches(final boolean freeStandingFonts,
final boolean systemFonts) {
- if (freeStandingFonts && this.registeredFont.hasFreeStandingFont()) {
+ if (freeStandingFonts && this.registeredFontContent.hasFreeStandingFont()) {
return true;
}
- if (systemFonts && this.registeredFont.hasSystemFont()) {
+ if (systemFonts && this.registeredFontContent.hasSystemFont()) {
return true;
}
return false;
@@ -433,7 +439,7 @@
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("[");
- builder.append(this.registeredFont.getConfiguredFontName());
+ builder.append(this.registeredFontContent.getConfiguredFontName());
builder.append(", ");
builder.append(this.registeredFontFamily.getName());
builder.append(", ");
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.java 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -224,7 +224,7 @@
this.fsFont = createFSFont();
if (this.fsFont == null) {
this.fsFont = getFontServer().getDefaultFreeStandingFont()
- .getRegisteredFont().fsFont;
+ .getRegisteredFontContent().fsFont;
getLogger().error("Unable to open font "
+ this.configuredFontName + ".");
getLogger().error("Using a default font instead.");
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 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontFamily.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -88,7 +88,7 @@
*/
public void registerFont(final RegisteredFont font) throws FontException {
/* Check basic completeness. */
- if (font.getRegisteredFont() == null) {
+ if (font.getRegisteredFontContent() == null) {
throw new FontException(RegisteredFontContent.class.getName() + " is required.");
}
if (font.getFontStyle() == null) {
Modified: trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
===================================================================
--- trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2025-06-13 10:59:57 UTC (rev 13843)
+++ trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2025-06-13 11:33:22 UTC (rev 13844)
@@ -98,14 +98,15 @@
final PsServer4a psServer = new PsServer4a();
final FontServer4a fontServer = new FontServer4a(psServer);
final FontConsumer4a fontConsumer = fontServer.createFontConsumer(null);
- final RegisteredFontContent rf = fontServer.getRegisteredFont("Base14-Helvetica");
- final RegisteredFontFamily rff = fontServer.getRegisteredFontFamily("Base14-Helvetica");
- final FreeStandingFont font = rf.getFreeStandingFont();
- final RegisteredFont rfd = new RegisteredFont(rf, rff,
- rf.getFreeStandingFont().getInternalEncoding(), FontStyle.NORMAL, FontWeight.NORMAL,
+ final RegisteredFontContent registeredFontContent = fontServer.getRegisteredFont("Base14-Helvetica");
+ final RegisteredFontFamily registeredFontFamily = fontServer.getRegisteredFontFamily("Base14-Helvetica");
+ final FreeStandingFont font = registeredFontContent.getFreeStandingFont();
+ final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily,
+ registeredFontContent.getFreeStandingFont().getInternalEncoding(), FontStyle.NORMAL, FontWeight.NORMAL,
FontVariant.NORMAL, FontStretch.NORMAL, FontFeatureSimulation.DEFAULT);
+ registeredFont.registerContent(registeredFontContent);
final ConsumerFont4a consumerFont = new ConsumerFont4a(font, fontConsumer);
- final FontUse fontUse = new FontUse4a(consumerFont, rfd, EncodingStandard.getInstance());
+ final FontUse fontUse = new FontUse4a(consumerFont, registeredFont, EncodingStandard.getInstance());
final PdfFont pdfFont = doc.getPdfFont(fontUse);
contentStream.setFont(pdfFont, 12);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-13 14:20:45
|
Revision: 13846
http://sourceforge.net/p/foray/code/13846
Author: victormote
Date: 2025-06-13 14:20:42 +0000 (Fri, 13 Jun 2025)
Log Message:
-----------
Remove unneeded methods.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2025-06-13 14:06:51 UTC (rev 13845)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2025-06-13 14:20:42 UTC (rev 13846)
@@ -57,7 +57,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.xml.sax.EntityResolver;
import java.io.IOException;
import java.io.InputStream;
@@ -125,12 +124,10 @@
* @throws ForayException For errors creating the server.
*/
public static FontServer makeFontServer(final SessionConfig configuration) throws ForayException {
- final EntityResolver entityResolver = configuration.makeEntityResolver();
final PsServer psServer = ForaySpecific.makePsServer();
final FontServer4a forayFontServer = new FontServer4a(psServer);
forayFontServer.setBaseFontURL(configuration.optionFontBaseDirectory());
forayFontServer.setBaseURL(configuration.optionBaseDirectory());
- forayFontServer.setEntityResolver(entityResolver);
final URL fontConfigURL = configuration.optionFontConfiguration();
if (fontConfigURL != null) {
InputStream inputStream = null;
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 2025-06-13 14:06:51 UTC (rev 13845)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2025-06-13 14:20:42 UTC (rev 13846)
@@ -55,7 +55,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
-import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -149,10 +148,6 @@
/** This is the SystemFont that should be used when a SystemFont is required and all other fallback options fail. */
private RegisteredFont defaultSystemFont = null;
- /** An EntityResolver to be used by XML parsers (for handling DTD catalogs,
- * etc.). */
- private EntityResolver entityResolver = null;
-
/**
* Map whose key is a String containing the id of a {@link RegisteredFontContent} instance, and whose value is that
* instance.
@@ -829,68 +824,6 @@
}
/**
- * Returns a list of all Font instances.
- * @param freeStandingFonts Set to true to include free-standing fonts in the returned array.
- * @param systemFonts Set to true to include system fonts in the returned array.
- * @return The array of all Font instances.
- */
- 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<RegisteredFont> rfdList
- = family.getRegisteredFonts();
- if (rfdList != null) {
- for (int i = 0; i < rfdList.size(); i++) {
- final RegisteredFont rfd = rfdList.get(i);
- final RegisteredFontContent rf = rfd.getRegisteredFontContent();
- if (freeStandingFonts
- && rf.getFreeStandingFont() != null) {
- fontList.add(rf.getFreeStandingFont());
- }
- if (systemFonts
- && rf.getSystemFont() != null) {
- fontList.add(rf.getSystemFont());
- }
- }
- }
- }
- if (fontList.size() < 1) {
- return null;
- }
- final List<Font4a> returnList = new ArrayList<Font4a>();
- for (int i = 0; i < fontList.size(); i++) {
- final Font4a font = fontList.get(i);
- boolean duplicateFound = false;
- for (int j = 0; j < returnList.size() && ! duplicateFound; j++) {
- if (font == returnList.get(j)) {
- duplicateFound = true;
- }
- }
- /* If duplicate found, Skip this one, it is already on the list. */
- if (! duplicateFound) {
- returnList.add(font);
- }
- }
- return returnList;
- }
-
- /**
- * Returns the EntityResolver for this server.
- * @return The EntityResolver.
- */
- public EntityResolver getEntityResolver() {
- return this.entityResolver;
- }
-
- /**
- * Sets the EntityResolver for this server.
- * @param entityResolver The new EntityResolver.
- */
- public void setEntityResolver(final EntityResolver entityResolver) {
- this.entityResolver = entityResolver;
- }
-
- /**
* Register a font-family for use by the system.
* @param name The name of the font-family (e.g. "Courier").
* @return The font family instance.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-15 03:15:12
|
Revision: 13853
http://sourceforge.net/p/foray/code/13853
Author: victormote
Date: 2025-06-15 03:15:09 +0000 (Sun, 15 Jun 2025)
Log Message:
-----------
Roll class RegisteredFontContent into RegisteredFont. Still some broken tests and test documents.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
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/FontServer4a.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/config/FontConfigParser.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/RegisteredFontFamily.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/FontParser.java
trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
Removed Paths:
-------------
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -35,7 +35,8 @@
import org.foray.font.FontServer4a;
import org.foray.font.FontUse4a;
import org.foray.font.FreeStandingFont;
-import org.foray.font.config.RegisteredFontContent;
+import org.foray.font.config.RegisteredFont;
+import org.foray.font.config.RegisteredFontFamily;
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTree;
@@ -75,7 +76,9 @@
protected FontUse4a getHelveticaFont() throws FontException {
final FontServer4a fontServer = getFontServer();
assertNotNull(fontServer);
- final RegisteredFontContent rf = fontServer.getRegisteredFont("Base14-Helvetica");
+ final RegisteredFontFamily rff = fontServer.getRegisteredFontFamily("Base14-Helvetica");
+ assertNotNull(rff);
+ final RegisteredFont rf = rff.getRegisteredFont("Base14-Helvetica");
assertNotNull(rf);
final FreeStandingFont fsf = rf.getFreeStandingFont();
assertNotNull(fsf);
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 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -30,7 +30,6 @@
import org.foray.common.IoUtil;
import org.foray.font.config.RegisteredFont;
-import org.foray.font.config.RegisteredFontContent;
import org.foray.font.ttf.TrueTypeFont;
import org.foray.font.ttf.TtfSubSetFile;
import org.foray.font.type1.Type1Font;
@@ -213,8 +212,7 @@
// final Encoding encoding = findEncoding(rfd, codePoint);
if (encoding == null) {
/* No encoding was configured, meaning that the native encoding should be used. */
- final RegisteredFontContent content = rfd.getRegisteredFontContent();
- final Font4a font = content.getBestFont();
+ final Font4a font = rfd.getBestFont();
encoding = font.getInternalEncoding();
}
if (encoding == null) {
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -28,7 +28,7 @@
package org.foray.font;
import org.foray.common.FontUtil;
-import org.foray.font.config.RegisteredFontContent;
+import org.foray.font.config.RegisteredFont;
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
import org.foray.ps.encode.CharSet;
@@ -92,14 +92,14 @@
/**
* The RegisteredFontContent that is attached to this Font instance.
*/
- private RegisteredFontContent registeredFontContent = null;
+ private RegisteredFont registeredFont;
/**
* Constructor.
* @param rf The parent registered font.
*/
- protected Font4a(final RegisteredFontContent rf) {
- this.registeredFontContent = rf;
+ protected Font4a(final RegisteredFont rf) {
+ this.registeredFont = rf;
}
@Override
@@ -257,8 +257,8 @@
* Return the parent registered font.
* @return The registered font.
*/
- public RegisteredFontContent getRegisteredFontContent() {
- return this.registeredFontContent;
+ public RegisteredFont getRegisteredFont() {
+ return this.registeredFont;
}
/**
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 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -29,7 +29,6 @@
package org.foray.font;
import org.foray.font.config.RegisteredFont;
-import org.foray.font.config.RegisteredFontContent;
import org.foray.font.config.RegisteredFontFamily;
import org.foray.font.format.Panose;
import org.foray.font.format.Panose4a;
@@ -47,7 +46,6 @@
import org.axsl.value.FontVariant;
import org.axsl.value.FontWeight;
-import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
@@ -97,31 +95,21 @@
/** The font selection constraints. */
private FontSelectionConstraints selectionConstraints;
- /**
- * Set to true if FreeStandingFonts should be selected where possible,
- * false if SystemFont should be selected where possible.
- * In cases where usesFreeStandingFonts and usesSystemFonts are both set to
- * true, this breaks the tie.
- */
+ /** Set to true if FreeStandingFonts should be selected where possible,false if SystemFont should be selected where
+ * possible. In cases where usesFreeStandingFonts and usesSystemFonts are both set to true, this breaks the tie. */
private boolean prefersFreeStandingFonts = true;
- /**
- * Collection of fonts used by this FontConsumer.
- * The key is the Font instance, and the value is the related ConsumerFont
- * instance.
- */
- private Map<Font4a, ConsumerFont4a> usedFonts
- = new HashMap<Font4a, ConsumerFont4a>();
+ /** Collection of fonts used by this FontConsumer. The key is the Font instance, and the value is the related
+ * {@link ConsumerFont4a} instance. */
+ private Map<Font4a, ConsumerFont4a> usedFonts = new HashMap<Font4a, ConsumerFont4a>();
/** The encoding latitude for this consumer. */
private byte encodingLatitude = FontConsumer4a.ENCODING_ANY;
- /** The FontSelection instance to be used for font-selection-strategy =
- * "character-by-character". */
+ /** The FontSelection instance to be used for font-selection-strategy = "character-by-character". */
private FontSelector fontSelectorCBC;
- /** The FontSelection instance to be used for font-selection-strategy =
- * "auto". */
+ /** The FontSelection instance to be used for font-selection-strategy = "auto". */
private FontSelector fontSelectorAuto;
/** The font selector to be used by this consumer. */
@@ -240,7 +228,7 @@
builder.append(weight.toString() + " (weight), ");
builder.append(variant.toString() + " (variant), ");
builder.append(stretch.toString() + " (stretch), ");
- getLogger().warn("Suitable font not found for: " + builder.toString());
+ LoggerFactory.getLogger(getClass()).warn("Suitable font not found for: " + builder.toString());
return null;
}
try {
@@ -293,9 +281,9 @@
}
Font4a fontSelected = null;
if (this.selectionConstraints.canSelectFreeStandingFonts()) {
- fontSelected = fontDescSelected.getRegisteredFontContent().getFreeStandingFont();
+ fontSelected = fontDescSelected.getFreeStandingFont();
} else {
- fontSelected = fontDescSelected.getRegisteredFontContent().getSystemFont();
+ fontSelected = fontDescSelected.getSystemFont();
}
final ConsumerFont4a consumerFont = registerFontUse(fontSelected);
return consumerFont.getFontUse(fontDescSelected, fontSelected.getInternalEncoding());
@@ -302,27 +290,19 @@
}
/**
- * <p>Since {@link RegisteredFontContent} and {@link RegisteredFont} 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>
+ * <p>Since {@link RegisteredFont} instances can create either a {@link FreeStandingFont} or a {@link SystemFont},
+ * or both, this method selects which one should be used.</p>
*
- * <p>In cases where both a FreeStandingFont and a SystemFont are available,
- * and either can be selected, this method also breaks the tie, again using
- * a FontConsumer parameter.
- * Although each has access to the other's methods for things that it
- * does not natively know, there are still potential differences between
- * the two (especially font metrics), and an application needs to be able
- * to select which one it prefers.
- * @param rfd The RegisteredFontDesc instance which points to the usable
- * font.
+ * <p>In cases where both a FreeStandingFont and a SystemFont are available, and either can be selected, this method
+ * also breaks the tie, again using a FontConsumer parameter.
+ * Although each has access to the other's methods for things that it does not natively know, there are still
+ * potential differences between the two (especially font metrics), and an application needs to be able to select
+ * which one it prefers.
+ * @param rfd The RegisteredFontDesc instance which points to the usable font.
* @return The FontUse instance dictated by the parameters of consumer.
*/
protected Font4a whichUse(final RegisteredFont rfd) {
- final RegisteredFontContent rf = rfd.getRegisteredFontContent();
-
- /* Avoid instantiating the non-preferred manifestation if it won't be
- * used anyway. */
+ /* Avoid instantiating the non-preferred manifestation if it won't be used anyway. */
FreeStandingFont fsf = null;
SystemFont sf = null;
@@ -333,10 +313,10 @@
/* It is available. */
return fsf;
}
- return eligibleSystemFont(rf);
+ return eligibleSystemFont(rfd);
} else {
/* Consumer prefers SystemFont. */
- sf = eligibleSystemFont(rf);
+ sf = eligibleSystemFont(rfd);
if (sf != null) {
/* It is available. */
return sf;
@@ -346,17 +326,16 @@
}
/**
- * For a given registered font description, returns the free-standing font
- * for that description, if it is eligible for selection.
+ * For a given registered font description, returns the free-standing font for that description, if it is eligible
+ * for selection.
* @param rfd The registered font description to be tested.
- * @return The {@link FreeStandingFont} instance, if it exists and is
- * eligible, or null otherwise.
+ * @return The {@link FreeStandingFont} instance, if it exists and is eligible, or null otherwise.
*/
private FreeStandingFont eligibleFreeStandingFont(final RegisteredFont rfd) {
if (! this.selectionConstraints.canSelectFreeStandingFonts()) {
return null;
}
- final FreeStandingFont fsf = rfd.getRegisteredFontContent().getFreeStandingFont();
+ final FreeStandingFont fsf = rfd.getFreeStandingFont();
if (fsf == null) {
return null;
}
@@ -368,7 +347,7 @@
* @param rf The registered font to be tested.
* @return The {@link SystemFont instance}, if it exists and is eligible, or null otherwise.
*/
- private SystemFont eligibleSystemFont(final RegisteredFontContent rf) {
+ private SystemFont eligibleSystemFont(final RegisteredFont rf) {
if (! this.selectionConstraints.canSelectSystemFonts()) {
return null;
}
@@ -410,8 +389,7 @@
/**
* Record the fact that this FontConsumer has used this font.
* @param font The Font instance that was used.
- * @return The consumer font that encapsulates {@code font} for this
- * consumer.
+ * @return The consumer font that encapsulates {@code font} for this consumer.
*/
protected ConsumerFont4a registerFontUse(final Font4a font) {
ConsumerFont4a consumerFont = this.usedFonts.get(font);
@@ -431,8 +409,7 @@
/**
* Returns the FontUse instance for a given font.
- * @param font The Font instance for which we wish to find the
- * related FontUse instance.
+ * @param font The Font instance for which we wish to find the related FontUse instance.
* @return The related FontUse instance.
*/
public ConsumerFont4a getConsumerFont(final Font4a font) {
@@ -461,10 +438,8 @@
* @return True if and only if the encoding latitude is valid.
*/
private boolean validEncodingLatitude(final int encodingLatitude) {
- for (int i = 0; i < FontConsumer4a.VALID_ENCODING_LATITUDES.length;
- i++) {
- if (encodingLatitude
- == FontConsumer4a.VALID_ENCODING_LATITUDES[i]) {
+ for (int i = 0; i < FontConsumer4a.VALID_ENCODING_LATITUDES.length; i++) {
+ if (encodingLatitude == FontConsumer4a.VALID_ENCODING_LATITUDES[i]) {
return true;
}
}
@@ -479,11 +454,9 @@
* {@link #ENCODING_ANY}.
* @throws FontException If the encoding latitude is not valid.
*/
- public void setEncodingLatitude(final int encodingLatitude)
- throws FontException {
+ public void setEncodingLatitude(final int encodingLatitude) throws FontException {
if (! validEncodingLatitude(encodingLatitude)) {
- throw new FontException("FOrayFontConsumer invalid encoding "
- + "latitude: " + encodingLatitude);
+ throw new FontException("FOrayFontConsumer invalid encoding latitude: " + encodingLatitude);
}
this.encodingLatitude = (byte) encodingLatitude;
}
@@ -509,8 +482,7 @@
for (RegisteredFontFamily rff : this.server.registeredFontFamilies()) {
for (int i = 0; i < rff.getRegisteredFonts().size(); i++) {
final RegisteredFont rfd = rff.getRegisteredFonts().get(i);
- final Panose4a panoseInstance = rfd.getRegisteredFontContent()
- .getPanose();
+ final Panose4a panoseInstance = rfd.getPanose();
final long difference = panoseInstance.difference(desiredPanose, null);
if (difference < bestDifference) {
bestDifference = difference;
@@ -528,13 +500,4 @@
}
}
- /**
- * Returns the logger.
- * @return The logger.
- */
- private Logger getLogger() {
- /* Not cached because not expected to get used much. */
- return LoggerFactory.getLogger(getClass());
- }
-
}
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 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontServer4a.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -33,7 +33,6 @@
import org.foray.font.config.FontConfigParser;
import org.foray.font.config.FontFeatureSimulation4a;
import org.foray.font.config.RegisteredFont;
-import org.foray.font.config.RegisteredFontContent;
import org.foray.font.config.RegisteredFontFamily;
import org.foray.font.format.FontParserClient;
import org.foray.ps.encode.EncodingSymbol;
@@ -148,12 +147,6 @@
/** This is the SystemFont that should be used when a SystemFont is required and all other fallback options fail. */
private RegisteredFont defaultSystemFont = null;
- /**
- * Map whose key is a String containing the id of a {@link RegisteredFontContent} instance, and whose value is that
- * instance.
- */
- private Map<String, RegisteredFontContent> registeredFontContent = new HashMap<String, RegisteredFontContent>();
-
/** Map of registered font selector factories. The key is String containing the name of the factory, and the value
* is the {@link FontSelectorFactory} that the name maps to. */
private Map<String, FontSelectorFactory> registeredFontSelectorFactories =
@@ -234,14 +227,11 @@
}
/* Punt and try to create something that will work. */
try {
- final RegisteredFontContent registeredFontContent =
- new RegisteredFontContent(this, null, null, null, null, null, "serif");
final RegisteredFontFamily registeredFontFamily = this.registerFontFamily("serif");
final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, null, FontStyle.NORMAL,
- FontWeight.NORMAL, FontVariant.NORMAL,
- FontStretch.NORMAL, FontFeatureSimulation.DEFAULT);
+ FontWeight.NORMAL, FontVariant.NORMAL, FontStretch.NORMAL, FontFeatureSimulation.DEFAULT, null,
+ null, null, null, null, "serif");
registeredFontFamily.registerFont(registeredFont);
- registeredFont.registerContent(registeredFontContent);
} catch (final FontException e) {
getLogger().error("Unable to create default system font.");
}
@@ -446,16 +436,7 @@
this.getLogger().warn("Serialized Base-14 font metrics not found: " + resourceName);
return;
}
- RegisteredFontContent registeredFontContent = null;
- try {
- registeredFontContent = new RegisteredFontContent(this, fontName, null, null, null,
- org.axsl.font.Font.Embedding.NONE, null);
- } catch (final FontException e) {
- this.logger.warn(e.getMessage(), e);
- }
- registeredFontContent.setSerializedMetricsFile(metricURL);
-
Encoding encoding = EncodingWinAnsi.getInstance();
if (registeredFontFamily.getName().equals("Base14-Symbol")) {
encoding = EncodingSymbol.getInstance();
@@ -467,8 +448,8 @@
simulation.setSimulateSmallCaps(FontServer4a.DEFAULT_SMALL_CAPS_SIZE);
final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, encoding, style, weight,
- FontVariant.NORMAL, FontStretch.NORMAL, simulation);
- registeredFont.registerContent(registeredFontContent);
+ FontVariant.NORMAL, FontStretch.NORMAL, simulation, fontName, null, metricURL, null,
+ org.axsl.font.Font.Embedding.NONE, null);
registeredFontFamily.registerFont(registeredFont);
}
@@ -510,14 +491,7 @@
continue;
}
}
- final RegisteredFontContent registeredFontContent;
- try {
- registeredFontContent = new RegisteredFontContent(this, awtFont.getFontName(),
- null, null, null, org.axsl.font.Font.Embedding.NONE, awtFont.getFontName());
- } catch (final FontException e) {
- this.logger.error(e.getMessage());
- continue;
- }
+
FontStyle fontStyle = FontStyle.NORMAL;
if (awtFont.isItalic()) {
fontStyle = FontStyle.ITALIC;
@@ -529,8 +503,9 @@
final FontVariant fontVariant = FontVariant.NORMAL;
final FontStretch fontStretch = FontStretch.NORMAL;
final RegisteredFont registeredFont = new RegisteredFont(registeredFontFamily, null, fontStyle, fontWeight,
- fontVariant, fontStretch, FontFeatureSimulation.DEFAULT);
- registeredFont.registerContent(registeredFontContent);
+ fontVariant, fontStretch, FontFeatureSimulation.DEFAULT,
+ awtFont.getFontName(),
+ null, null, null, org.axsl.font.Font.Embedding.NONE, awtFont.getFontName());
try {
registeredFontFamily.registerFont(registeredFont);
} catch (final FontException e) {
@@ -765,92 +740,6 @@
}
/**
- * Register a font for use by the system.
- * @param fontID A unique ID for this font (e.g. "Courier-Bold").
- * @param fontFileSource Source of the file containing the font, if any.
- * @param metricsFileSource Source of the file containing the font metrics, if any.
- * This is null for TrueType and OpenType fonts.
- * @param collectionID For TrueType collections, indicates which font in the collection corresponds to this font.
- * @param requestedEmbedding The requested font embedding for the font to be registered.
- * @param systemName For system fonts only, this is the name that should be supplied to the operating system font
- * registry to obtain the font from it. For other fonts, set this to null.
- * @throws FontException If a font with this {@code fontID} is already registered.
- */
- public void registerFont(final String fontID, final URL fontFileSource, final URL metricsFileSource,
- final String collectionID, final org.axsl.font.Font.Embedding requestedEmbedding, final String systemName)
- throws FontException {
- if (! isUsableFont(systemName, fontFileSource, metricsFileSource)) {
- return;
- }
- new RegisteredFontContent(this, fontID, fontFileSource, metricsFileSource, collectionID, requestedEmbedding,
- systemName);
- }
-
- /**
- * Indicates whether a given font has the barest capability of being used by
- * this server.
- * @param systemName The "system-name" for the font.
- * @param fontFile The font file for the font.
- * @param metricsFile The metric file for the font.
- * @return True if and only if the font has the barest necessities to be usable by this
- * font server.
- */
- private boolean isUsableFont(final String systemName, final Object fontFile,
- final Object metricsFile) {
- if (! this.usingFreeStandingFonts) {
- /* If not using FreeStandingFonts, then this font should not be
- * registered unless it will be able to generate a SystemFont. */
- if (systemName == null || systemName.equals("")) {
- return false;
- }
- }
- if (! this.usingSystemFonts) {
- /* If not using SystemFonts, then this font should not be
- * registered unless it will be able to generate a FreeStandingFont.
- */
- if (fontFile == null
- && metricsFile == null) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns the font registered to a given name.
- * @param name The name of the font being sought.
- * @return The registered font instance, or null if the font name has not
- * been registered.
- */
- public RegisteredFontContent getRegisteredFont(final String name) {
- return this.registeredFontContent.get(name);
- }
-
- /**
- * Maps a given font name to its related {@link RegisteredFontContent} instance.
- * @param fontID The name of the font to be associated.
- * @param rf The registered font instance to be associated with the name.
- * @throws FontException If the {@code fontID} is already registered.
- */
- public void registerFont(final String fontID, final RegisteredFontContent rf) throws FontException {
- final Object object = this.registeredFontContent.get(fontID);
- if (object != null) {
- throw new FontException("Font ID already registered: " + fontID);
- }
- this.registeredFontContent.put(fontID, rf);
- }
-
- /**
- * Indicates whether a font has already been registered for use by the system.
- * @param fontID The unique font ID for the font (e.g. "Courier-Bold").
- * @return True if and only if a font with ID of {@code fontID} is already registered.
- */
- public boolean isRegisteredFont(final String fontID) {
- final Object object = this.registeredFontContent.get(fontID);
- return object != null;
- }
-
- /**
* Returns the font-selector that should be used by a given font consumer.
* @param consumer The consumer for which a font-selector is needed.
* @return The font-selector instance.
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 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -28,7 +28,7 @@
package org.foray.font;
-import org.foray.font.config.RegisteredFontContent;
+import org.foray.font.config.RegisteredFont;
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
import org.foray.ps.encode.CharSet;
@@ -130,7 +130,7 @@
* Constructor.
* @param rf The parent registered font.
*/
- protected FreeStandingFont(final RegisteredFontContent rf) {
+ protected FreeStandingFont(final RegisteredFont rf) {
super(rf);
}
@@ -150,7 +150,7 @@
/* The font and/or metrics may not have been parsed yet. */
return this.fontName;
}
- return this.getRegisteredFontContent().getConfiguredFontName();
+ return this.getRegisteredFont().getConfiguredFontName();
}
@Override
@@ -168,7 +168,7 @@
&& ! this.postscriptName.equals("")) {
return this.postscriptName;
}
- return getRegisteredFontContent().getConfiguredFontName();
+ return getRegisteredFont().getConfiguredFontName();
}
@Override
@@ -250,11 +250,11 @@
return false;
}
/* Don't try to embed unless we have been told to. */
- if (! getRegisteredFontContent().isEmbedding()) {
+ if (! getRegisteredFont().isEmbedding()) {
return false;
}
/* If the fontFile exists, embed it. */
- if (getRegisteredFontContent().hasFontContent()) {
+ if (getRegisteredFont().hasFontContent()) {
return true;
}
return false;
@@ -274,7 +274,7 @@
return false;
}
/* Only subset if we have been told to. */
- return getRegisteredFontContent().isSubsetting();
+ return getRegisteredFont().isSubsetting();
}
/**
@@ -282,7 +282,7 @@
* @return The font content as a stream.
*/
protected InputStream getFontInputStream() {
- final URL contentLocation = getRegisteredFontContent().getFontFileSource();
+ final URL contentLocation = getRegisteredFont().getFontFileSource();
if (contentLocation == null) {
return null;
}
@@ -355,7 +355,7 @@
* is none, return null.
*/
public SystemFont systemFontManifestation() {
- return this.getRegisteredFontContent().getSystemFont();
+ return this.getRegisteredFont().getSystemFont();
}
/**
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 2025-06-14 20:07:46 UTC (rev 13852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2025-06-15 03:15:09 UTC (rev 13853)
@@ -30,7 +30,7 @@
import org.foray.common.data.BoundingBoxShort;
import org.foray.common.data.BoundingBoxUtils;
-import org.foray.font.config.RegisteredFontContent;
+import org.foray.font.config.RegisteredFont;
import org.foray.font.ttf.TrueTypeCollection;
import org.foray.font.ttf.TrueTypeContainer;
import org.foray.font.ttf.TrueTypeFont;
@@ -72,7 +72,7 @@
* @throws FontException For errors parsing the font.
* @throws IOException For errors reading content.
*/
- public FsTrueTypeFont(final RegisteredFontContent rf) throws FontException, IOException {
+ public FsTrueTypeFont(final RegisteredFont rf) throws FontException, IOException {
super(rf);
parseFont();
}
@@ -84,8 +84,8 @@
*/
public void parseFont() throws FontException, IOException {
final TrueTypeContainer ttfFile = (TrueTypeContainer)
- getRegisteredFontContent().createFontFileReader(...
[truncated message content] |
|
From: <vic...@us...> - 2025-06-16 01:57:53
|
Revision: 13857
http://sourceforge.net/p/foray/code/13857
Author: victormote
Date: 2025-06-16 01:57:50 +0000 (Mon, 16 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Move nextBolder and nextLighter methods from FontUse to Font. Add method to FontConsumer to use that Font to get a FontUse.
Modified Paths:
--------------
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/FontUse4a.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.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 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/ConsumerFont4a.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -76,8 +76,7 @@
* @param font The parent font.
* @param consumer The parent font consumer.
*/
- public ConsumerFont4a(final Font4a font,
- final FontConsumer4a consumer) {
+ public ConsumerFont4a(final Font4a font, final FontConsumer4a consumer) {
this.font = font;
this.consumer = consumer;
if (this.font.isSubsettable()) {
@@ -235,8 +234,7 @@
* or created.
* @return The selected or created font use.
*/
- public FontUse4a getFontUse(final RegisteredFont rfd,
- final Encoding encoding) {
+ public FontUse4a getFontUse(final RegisteredFont rfd, final Encoding encoding) {
for (int i = 0; i < this.fontUses.size(); i++) {
final FontUse4a fontUse = this.fontUses.get(i);
if (fontUse.getRegisteredFontDesc() != rfd) {
@@ -455,4 +453,12 @@
return Collections.unmodifiableList(this.fontUses);
}
+ /**
+ * Adds a FontUse instance to this fonts list.
+ * @param fontUse The instance to be added.
+ */
+ public void registerFontUse(final FontUse4a fontUse) {
+ this.fontUses.add(fontUse);
+ }
+
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -474,4 +474,16 @@
*/
public abstract Panose4a getPanose();
+ @Override
+ public Font4a nextBolderFont() {
+ final RegisteredFont rf = this.registeredFont.nextBolderFont();
+ return rf == null ? null : rf.getBestFont();
+ }
+
+ @Override
+ public Font4a nextLighterFont() {
+ final RegisteredFont rf = this.registeredFont.nextLighterFont();
+ return rf == null ? null : rf.getBestFont();
+ }
+
}
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 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -33,6 +33,7 @@
import org.foray.font.format.Panose;
import org.foray.font.format.Panose4a;
+import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontException;
import org.axsl.font.FontSelectionConstraints;
@@ -40,6 +41,7 @@
import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
+import org.axsl.ps.Encoding;
import org.axsl.value.FontSelectionStrategy;
import org.axsl.value.FontStretch;
import org.axsl.value.FontStyle;
@@ -500,4 +502,33 @@
}
}
+ @Override
+ public FontUse4a getFontUse(final Font font, final Encoding encoding) {
+ if (font instanceof Font4a) {
+ final Font4a font4a = (Font4a) font;
+ ConsumerFont4a consumerFont = this.usedFonts.get(font4a);
+ final RegisteredFont registeredFont = font4a.getRegisteredFont();
+ final Encoding resolvedEncoding = encoding == null ? font.getInternalEncoding() : encoding;
+ if (consumerFont == null) {
+ consumerFont = new ConsumerFont4a(font4a, this);
+ final FontUse4a fontUse = new FontUse4a(consumerFont, registeredFont, resolvedEncoding);
+ consumerFont.registerFontUse(fontUse);
+ return fontUse;
+ } else {
+ FontUse4a fontUse = consumerFont.getFontUse(registeredFont, resolvedEncoding);
+ if (fontUse == null) {
+ fontUse = new FontUse4a(consumerFont, registeredFont, resolvedEncoding);
+ consumerFont.registerFontUse(fontUse);
+ return fontUse;
+ } else {
+ return fontUse;
+ }
+ }
+
+ } else {
+ /* TODO: Implement this. */
+ return 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 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -189,38 +189,6 @@
}
@Override
- public org.axsl.font.FontUse nextBolderFont() {
- final RegisteredFont desc =
- this.registeredFontDesc.nextBolderFont();
- return fontUseForDesc(desc);
- }
-
- @Override
- public org.axsl.font.FontUse nextLighterFont() {
- final RegisteredFont desc =
- this.registeredFontDesc.nextLighterFont();
- return fontUseForDesc(desc);
- }
-
- /**
- * Finds the FontUse instance that should be used for a given
- * {@link RegisteredFont} 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 RegisteredFont desc) {
- if (desc == null) {
- return null;
- }
- final FontConsumer4a consumer = this.getFOrayFontConsumer();
- final Font4a font = consumer.whichUse(desc);
- final ConsumerFont4a consumerFont = consumer.registerFontUse(font);
- return consumerFont.selectFontUse(desc);
- }
-
- @Override
public int unavailableChar(final CharSequence charSequence,
final int beginIndex) {
for (int i = 0; i < charSequence.length(); i++) {
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -313,4 +313,16 @@
return null;
}
+ @Override
+ public Font nextBolderFont() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Font nextLighterFont() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-15 21:36:15 UTC (rev 13856)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-16 01:57:50 UTC (rev 13857)
@@ -104,18 +104,6 @@
}
@Override
- public FontUse nextBolderFont() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public FontUse nextLighterFont() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public BigDecimal simulateSmallCaps() {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-16 09:59:24
|
Revision: 13858
http://sourceforge.net/p/foray/code/13858
Author: victormote
Date: 2025-06-16 09:59:22 +0000 (Mon, 16 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Move font-related methods from FontUse to Font.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.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 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -415,7 +415,7 @@
final int nominalFontSize = generatedBy.traitFontSizeActual(this);
if (usesFauxSmallCaps()) {
final FontUse fontUse = traitNominalFont();
- return fontUse.smallCapsSize(nominalFontSize);
+ return fontUse.getConsumerFont().getFont().smallCapsSize(nominalFontSize);
}
return nominalFontSize;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -134,7 +134,7 @@
* Right now we rely on the user to configure the font correctly to avoid this. */
/* Has the font been configured to simulate small-caps? */
- if (getFontUse().simulateSmallCaps() == null) {
+ if (getFontUse().getConsumerFont().getFont().simulateSmallCaps() == null) {
return false;
}
return true;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -33,7 +33,10 @@
import org.foray.font.format.Panose4a;
import org.foray.ps.encode.CharSet;
+import org.axsl.constants.NumericConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
+import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontFormat;
import org.axsl.i18n.Script;
import org.axsl.unicode.block.U0000_Basic_Latin;
@@ -41,7 +44,10 @@
import org.axsl.unicode.block.U2000_General_Punctuation;
import org.axsl.unicode.block.U3000_CJK_Symbols_and_Punctuation;
import org.axsl.value.BaselineIdentifier;
+import org.axsl.value.FontStretch;
+import java.math.BigDecimal;
+
/**
* An implementation of the aXSL {@link Font4a} interface.
*/
@@ -486,4 +492,39 @@
return rf == null ? null : rf.getBestFont();
}
+ @Override
+ public BigDecimal simulateSmallCaps() {
+ return this.registeredFont.getFontFeatureSimulation().getSimulatedSmallCaps();
+ }
+
+ @Override
+ public int smallCapsSize(final int fontSize) {
+ final BigDecimal percent = this.registeredFont.getFontFeatureSimulation().getSimulatedSmallCaps();
+ if (percent == null) {
+ return fontSize;
+ }
+ if (percent.equals(FontFeatureSimulation.SMALL_CAP_SIMULATION_NATIVE)) {
+ int smallCapsSize = getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
+ smallCapsSize /= getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
+ smallCapsSize *= NumericConstants.PERCENT_CONVERSION;
+ return smallCapsSize;
+ }
+ return Math.round(fontSize * percent.floatValue() / NumericConstants.PERCENT_CONVERSION);
+ }
+
+ @Override
+ public BigDecimal simulateOblique() {
+ return this.registeredFont.getFontFeatureSimulation().getSimulatedOblique();
+ }
+
+ @Override
+ public BigDecimal simulateBackslant() {
+ return this.registeredFont.getFontFeatureSimulation().getSimulatedBackslant();
+ }
+
+ @Override
+ public BigDecimal simulateStretch(final FontStretch stretch) {
+ return this.registeredFont.getFontFeatureSimulation().getSimulatedStretch(stretch);
+ }
+
}
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 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -37,13 +37,10 @@
import org.foray.primitive.sequence.ShortArrayBuilder;
import org.foray.ps.encode.CharSet;
-import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
-import org.axsl.constants.TypographicConstants;
import org.axsl.font.ConsumerFont;
import org.axsl.font.Font;
import org.axsl.font.FontContext;
-import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
import org.axsl.primitive.sequence.IntSequence;
@@ -50,10 +47,8 @@
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
import org.axsl.unicode.block.U0000_Basic_Latin;
-import org.axsl.value.FontStretch;
import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
/**
* <p>An implementation of the aXSL {@link FontUse4a} interface.</p>
@@ -235,42 +230,6 @@
}
@Override
- public BigDecimal simulateSmallCaps() {
- return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedSmallCaps();
- }
-
- @Override
- public int smallCapsSize(final int fontSize) {
- final BigDecimal percent = this.registeredFontDesc.getFontFeatureSimulation().getSimulatedSmallCaps();
- if (percent == null) {
- return fontSize;
- }
- if (percent.equals(FontFeatureSimulation.SMALL_CAP_SIMULATION_NATIVE)) {
- final Font4a font = this.consumerFont.getFont();
- int smallCapsSize = font.getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
- smallCapsSize /= font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
- smallCapsSize *= NumericConstants.PERCENT_CONVERSION;
- return smallCapsSize;
- }
- return Math.round(fontSize * percent.floatValue() / NumericConstants.PERCENT_CONVERSION);
- }
-
- @Override
- public BigDecimal simulateOblique() {
- return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedOblique();
- }
-
- @Override
- public BigDecimal simulateBackslant() {
- return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedBackslant();
- }
-
- @Override
- public BigDecimal simulateStretch(final FontStretch stretch) {
- return this.registeredFontDesc.getFontFeatureSimulation().getSimulatedStretch(stretch);
- }
-
- @Override
public String getPostscriptName() {
final String postScriptName = getConsumerFont().getFont().getPostscriptName();
if (this.encoding == getConsumerFont().getFont().getInternalEncoding()) {
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -36,7 +36,10 @@
import org.axsl.ps.BoundingBox;
import org.axsl.ps.Encoding;
import org.axsl.value.BaselineIdentifier;
+import org.axsl.value.FontStretch;
+import java.math.BigDecimal;
+
/**
* A mock implementation of {@link Font}, useful for tests.
*/
@@ -325,4 +328,29 @@
return null;
}
+ @Override
+ public BigDecimal simulateSmallCaps() {
+ return null;
+ }
+
+ @Override
+ public int smallCapsSize(final int fontSize) {
+ return fontSize;
+ }
+
+ @Override
+ public BigDecimal simulateOblique() {
+ return null;
+ }
+
+ @Override
+ public BigDecimal simulateBackslant() {
+ return null;
+ }
+
+ @Override
+ public BigDecimal simulateStretch(final FontStretch stretch) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-16 01:57:50 UTC (rev 13857)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-16 09:59:22 UTC (rev 13858)
@@ -35,10 +35,7 @@
import org.axsl.primitive.sequence.IntSequence;
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
-import org.axsl.value.FontStretch;
-import java.math.BigDecimal;
-
/**
* A mock implementation of {@link FontUse}, useful for tests.
*/
@@ -104,31 +101,6 @@
}
@Override
- public BigDecimal simulateSmallCaps() {
- return null;
- }
-
- @Override
- public int smallCapsSize(final int fontSize) {
- return fontSize;
- }
-
- @Override
- public BigDecimal simulateOblique() {
- return null;
- }
-
- @Override
- public BigDecimal simulateBackslant() {
- return null;
- }
-
- @Override
- public BigDecimal simulateStretch(final FontStretch stretch) {
- return null;
- }
-
- @Override
public String getPostscriptName() {
// TODO Auto-generated method stub
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-16 10:28:55
|
Revision: 13859
http://sourceforge.net/p/foray/code/13859
Author: victormote
Date: 2025-06-16 10:28:52 +0000 (Mon, 16 Jun 2025)
Log Message:
-----------
Conform to aXSL change: Remove duplicate method easily computed downstream.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.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 2025-06-16 09:59:22 UTC (rev 13858)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2025-06-16 10:28:52 UTC (rev 13859)
@@ -229,15 +229,6 @@
return this.encoding.canEncode(codePoint);
}
- @Override
- public String getPostscriptName() {
- final String postScriptName = getConsumerFont().getFont().getPostscriptName();
- if (this.encoding == getConsumerFont().getFont().getInternalEncoding()) {
- return postScriptName;
- }
- return postScriptName + "-" + this.encoding.getName();
- }
-
/**
* Returns the font consumer instance.
* @return The font consumer instance.
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-16 09:59:22 UTC (rev 13858)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFontUse.java 2025-06-16 10:28:52 UTC (rev 13859)
@@ -101,21 +101,13 @@
}
@Override
- public String getPostscriptName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
public void registerCharUsed(final int codePoint) {
// TODO Auto-generated method stub
-
}
@Override
public void registerCharsUsed(final CharSequence charSequence) {
// TODO Auto-generated method stub
-
}
@Override
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 2025-06-16 09:59:22 UTC (rev 13858)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2025-06-16 10:28:52 UTC (rev 13859)
@@ -382,7 +382,7 @@
continue;
}
final PsFont psFont = getPSFont(fontUse);
- write("/" + psFont.getName() + " /" + fontUse.getPostscriptName()
+ write("/" + psFont.getName() + " /" + getPostscriptName(fontUse)
+ " def");
}
write("end def");
@@ -442,10 +442,24 @@
write(" /Encoding " + vector.getName() + " def");
write(" currentdict");
write("end");
- write("/" + fontUse.getPostscriptName() + " exch definefont pop");
+ write("/" + getPostscriptName(fontUse) + " exch definefont pop");
}
}
+ /**
+ * Computes the name which should be used for a given {@link FontUse}.
+ * @param fontUse The font use for which a name is needed.
+ * @return The Postscript name for {@code fontUse}.
+ */
+ private String getPostscriptName(final FontUse fontUse) {
+ final String postScriptName = fontUse.getConsumerFont().getFont().getPostscriptName();
+ if (fontUse.getEncoding() == fontUse.getConsumerFont().getFont().getInternalEncoding()) {
+ return postScriptName;
+ }
+ return postScriptName + "-" + fontUse.getEncoding().getName();
+
+ }
+
@Override
protected void drawLine(final int startX, final int startY, final int endX,
final int endY, final int thickness, final RuleStyle ruleStyle,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-16 22:04:17
|
Revision: 13860
http://sourceforge.net/p/foray/code/13860
Author: victormote
Date: 2025-06-16 22:04:15 +0000 (Mon, 16 Jun 2025)
Log Message:
-----------
Turn off schema validation for FO Tree parsing, as there is no schema.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-xml/src/main/java/org/foray/xml/SaxParser4a.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2025-06-16 10:28:52 UTC (rev 13859)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2025-06-16 22:04:15 UTC (rev 13860)
@@ -37,6 +37,7 @@
import org.foray.fotree.fo.obj.Root4a;
import org.foray.fotree.foreign.ForeignNamespaceHandler;
import org.foray.xml.SaxParser4a;
+import org.foray.xml.XercesFeatures;
import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeEvent;
@@ -46,6 +47,7 @@
import org.axsl.fotree.fo.InstreamForeignObject;
import org.axsl.orthography.OrthographyException;
+import org.slf4j.event.Level;
import org.w3c.dom.Document;
import org.w3c.dom.mathml.MathMLDocument;
import org.w3c.dom.svg.SVGDocument;
@@ -163,6 +165,11 @@
XMLReader parser = this.parser;
if (parser == null) {
parser = createSax2Parser(false, true, true, null, false);
+
+ /* Turn off schema validation. */
+ setFeature(parser, XercesFeatures.VALIDATION_SCHEMA, false, Level.WARN);
+ setFeature(parser, XercesFeatures.VALIDATION_SCHEMA_FULL_CHECKING, false, Level.WARN);
+ setFeature(parser, XercesFeatures.HONOUR_ALL_SCHEMALOCATIONS, false, Level.WARN);
}
parser.parse(inputSource);
return this.foTree;
Modified: trunk/foray/foray-xml/src/main/java/org/foray/xml/SaxParser4a.java
===================================================================
--- trunk/foray/foray-xml/src/main/java/org/foray/xml/SaxParser4a.java 2025-06-16 10:28:52 UTC (rev 13859)
+++ trunk/foray/foray-xml/src/main/java/org/foray/xml/SaxParser4a.java 2025-06-16 22:04:15 UTC (rev 13860)
@@ -306,7 +306,7 @@
* @param loggingLevel The logging level to which any exceptions should be logged. A logging level of null implies
* that the exception should be rethrown instead of logged.
*/
- private void setFeature(final XMLReader xmlReader, final String feature, final boolean value,
+ protected void setFeature(final XMLReader xmlReader, final String feature, final boolean value,
final org.slf4j.event.Level loggingLevel) throws SAXException {
try {
xmlReader.setFeature(feature, value);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 12:19:39
|
Revision: 13864
http://sourceforge.net/p/foray/code/13864
Author: victormote
Date: 2025-06-25 12:19:36 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Replace some dependencies on ext.versions with dependencies on libs.versions.toml.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-xml/build.gradle
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -38,8 +38,6 @@
ext.versions = [
/* Dependencies related to aXSL. These should be maintained at the same versions used by aXSL. */
axsl: '0.3-SNAPSHOT', // Latest is 0.3-SNAPSHOT as of 2022-11-26. See Note 2.
- svgDom: '1.1', // See aXSL master/build.gradle
- mathMlDom: '2.0', // See aXSL master/build.gradle
/* End of aXSL-related dependencies. */
slf4j: '2.0.5', // Latest is 2.0.5 as of 2022-11-26.
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/foray-areatree/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -7,8 +7,8 @@
description = 'foray-areatree'
dependencies {
- api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
- api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+ api libs.svg.lib
+ api libs.mathml.lib
api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
api (group: "org.axsl", name: "axsl-font", version: versions.axsl)
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/foray-fotree/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -20,8 +20,8 @@
*/
- api (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom)
- api (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom)
+ api libs.svg.lib
+ api libs.mathml.lib
/* TODO: Replace this dependency on batik-anim, used for parsing SVGDocument, with something more lightweight. */
implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/foray-graphic/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -19,8 +19,8 @@
api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
// api (group: 'net.sourceforge.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
api (group: 'de.rototor.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
- api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
- api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+ api libs.svg.lib
+ api libs.mathml.lib
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/foray-render/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -6,7 +6,7 @@
description = 'foray-render'
dependencies {
- implementation group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
+ implementation libs.svg.lib
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
Modified: trunk/foray/foray-xml/build.gradle
===================================================================
--- trunk/foray/foray-xml/build.gradle 2025-06-25 11:58:19 UTC (rev 13863)
+++ trunk/foray/foray-xml/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
@@ -14,7 +14,7 @@
parser currently does not. */
implementation (group: 'xerces', name: 'xercesImpl', version: versions.xerces2_J)
api (group: "org.apache.xmlgraphics", name: "batik-dom", version: versions.batik)
- api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+ api libs.mathml.lib
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 13:11:09
|
Revision: 13865
http://sourceforge.net/p/foray/code/13865
Author: victormote
Date: 2025-06-25 13:11:01 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Replace some dependencies on ext.versions with dependencies on libs.versions.toml.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/foray-app/build.gradle
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-content/build.gradle
trunk/foray/foray-core/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-font-parse/build.gradle
trunk/foray/foray-font-tf/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-layout/build.gradle
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-mif/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-output/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-pdf-core/build.gradle
trunk/foray/foray-pdf-parse/build.gradle
trunk/foray/foray-pioneer/build.gradle
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps-data/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-speech/build.gradle
trunk/foray/foray-unicode/build.gradle
trunk/foray/foray-zz-attic/build.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -36,10 +36,6 @@
/******************** See Note 1 below for information about dependency releases. ********************/
ext.versions = [
- /* Dependencies related to aXSL. These should be maintained at the same versions used by aXSL. */
- axsl: '0.3-SNAPSHOT', // Latest is 0.3-SNAPSHOT as of 2022-11-26. See Note 2.
- /* End of aXSL-related dependencies. */
-
slf4j: '2.0.5', // Latest is 2.0.5 as of 2022-11-26.
commonsIo: '2.11.0', // Latest is 2.11.0 as of 2022-11-26.
commonsDiscovery: '0.5', // Latest is 0.5 as of 2022-11-26.
Modified: trunk/foray/foray-app/build.gradle
===================================================================
--- trunk/foray/foray-app/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-app/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -14,19 +14,19 @@
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- implementation (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
+ implementation libs.axsl.font
+ implementation libs.axsl.linebreak
+ implementation libs.axsl.ps
+ implementation libs.axsl.areatree
+ implementation libs.axsl.output
+ implementation libs.axsl.fotree
+ implementation libs.axsl.galley
+ implementation libs.axsl.orthography
+ implementation libs.axsl.graphic
+ implementation libs.axsl.layout
+ implementation libs.axsl.speech
+ implementation libs.axsl.mif
+ implementation libs.axsl.pdf
implementation (project(':foray-areatree'))
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-areatree/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -10,9 +10,9 @@
api libs.svg.lib
api libs.mathml.lib
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- api (group: "org.axsl", name: "axsl-font", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-fotree", version: versions.axsl)
+ api libs.axsl.areatree
+ api libs.axsl.font
+ api libs.axsl.fotree
/* We dislike declaring a direct dependency on axsl-galley here as axsl-areatree is intended to be a direct superset
* of it, and a dependency on axsl-areatree should be sufficient. Indeed, from a gradle standpoint it is, as gradle
* handles the transitive dependency properly. However, there is no build pattern (known to us) that allows a module
@@ -19,13 +19,13 @@
* to declare that its API is a direct (non-transitive) superset of another module's API. Since we are using the
* autonomousapps dependency-analysis tool, which (for good reason) dislikes having transitive dependencies
* accidentally leak into the API of client code, we declare a direct dependency on axsl-galley here. */
- api (group: "org.axsl", name: "axsl-galley", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-graphic", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-i18n", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-value", version: versions.axsl)
- implementation (group: "org.axsl", name: "axsl-constants", version: versions.axsl)
- implementation (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
+ api libs.axsl.galley
+ api libs.axsl.graphic
+ api libs.axsl.i18n
+ api libs.axsl.orthography
+ api libs.axsl.value
+ implementation libs.axsl.constants
+ implementation libs.axsl.kp.model
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-common/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -11,12 +11,12 @@
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
- implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ implementation libs.axsl.primitive
+ implementation libs.axsl.i18n
+ implementation libs.axsl.kp.model
+ implementation libs.axsl.ps
+ implementation libs.axsl.constants
+ implementation libs.axsl.value
implementation project(':foray-primitive')
}
Modified: trunk/foray/foray-content/build.gradle
===================================================================
--- trunk/foray/foray-content/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-content/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -5,15 +5,15 @@
description = 'foray-content'
dependencies {
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.content
+ api libs.axsl.fotree
+ api libs.axsl.font
+ api libs.axsl.value
+ api libs.axsl.orthography
+ api libs.axsl.kp.model
+ api libs.axsl.areatree
+ implementation libs.axsl.galley
api (project(':foray-common'))
}
Modified: trunk/foray/foray-core/build.gradle
===================================================================
--- trunk/foray/foray-core/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-core/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -8,17 +8,17 @@
dependencies {
implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api libs.axsl.areatree
+ api libs.axsl.fotree
+ api libs.axsl.font
+ implementation libs.axsl.galley
+ api libs.axsl.graphic
+ api libs.axsl.layout
+ api libs.axsl.orthography
+ api libs.axsl.output
+ api libs.axsl.speech
+ api libs.axsl.linebreak
+ implementation libs.axsl.constants
api (project(':foray-common'))
api (project(':foray-xml'))
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-font/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -12,12 +12,12 @@
implementation (group: 'commons-discovery', name: 'commons-discovery', version: versions.commonsDiscovery)
api (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api libs.axsl.primitive
+ api libs.axsl.font
+ api libs.axsl.ps
+ api libs.axsl.orthography
+ implementation libs.axsl.constants
+ api libs.axsl.value
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-font-parse/build.gradle
===================================================================
--- trunk/foray/foray-font-parse/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-font-parse/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -7,9 +7,9 @@
description = 'foray-font-parse'
dependencies {
+ api libs.axsl.constants
+ api libs.axsl.primitive
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (project(':foray-common'))
}
Modified: trunk/foray/foray-font-tf/build.gradle
===================================================================
--- trunk/foray/foray-font-tf/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-font-tf/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -6,11 +6,11 @@
dependencies {
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api libs.axsl.font
+ api libs.axsl.orthography
+ implementation libs.axsl.constants
+ api libs.axsl.primitive
+ api libs.axsl.value
api (project(':foray-ps-data'))
}
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-fotree/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -25,14 +25,14 @@
/* TODO: Replace this dependency on batik-anim, used for parsing SVGDocument, with something more lightweight. */
implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.fotree
+ implementation libs.axsl.primitive
+ api libs.axsl.i18n
+ api libs.axsl.orthography
+ api libs.axsl.kp.model
+ implementation libs.axsl.constants
+ api libs.axsl.value
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-graphic/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -22,13 +22,13 @@
api libs.svg.lib
api libs.mathml.lib
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.primitive
+ api libs.axsl.font
+ api libs.axsl.graphic
+ api libs.axsl.orthography
+ api libs.axsl.ps
+ api libs.axsl.value
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-layout/build.gradle
===================================================================
--- trunk/foray/foray-layout/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-layout/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -5,9 +5,9 @@
description = 'foray-layout'
dependencies {
- api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api libs.axsl.layout
+ api libs.axsl.areatree
+ api libs.axsl.fotree
}
javadoc {
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-linebreak/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -6,9 +6,9 @@
description = 'foray-linebreak'
dependencies {
- api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- api (group: "org.axsl", name: "axsl-context", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
+ api libs.axsl.linebreak
+ api libs.axsl.context
+ api libs.axsl.kp.model
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-mif/build.gradle
===================================================================
--- trunk/foray/foray-mif/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-mif/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -6,9 +6,9 @@
description = 'foray-mif'
dependencies {
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
+ implementation libs.axsl.constants
+ api libs.axsl.mif
+ api libs.axsl.output
implementation (project(':foray-common'))
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-orthography/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -11,13 +11,13 @@
api (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ implementation libs.axsl.constants
+ api libs.axsl.fotree
+ api libs.axsl.i18n
+ api libs.axsl.kp.model
+ api libs.axsl.orthography
+ api libs.axsl.primitive
+ api libs.axsl.value
api (project(':foray-common'))
api (project(':foray-primitive'))
Modified: trunk/foray/foray-output/build.gradle
===================================================================
--- trunk/foray/foray-output/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-output/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -6,11 +6,11 @@
description = 'foray-output'
dependencies {
- implementation (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ implementation libs.axsl.value
+ api libs.axsl.font
+ api libs.axsl.output
+ api libs.axsl.mif
+ api libs.axsl.fotree
implementation (project(':foray-common'))
}
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-pdf/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -9,15 +9,15 @@
dependencies {
api (group: 'org.apache.xmlgraphics', name: 'batik-awt-util', version: versions.batik)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.pdf
+ api libs.axsl.primitive
+ api libs.axsl.font
+ api libs.axsl.graphic
+ api libs.axsl.orthography
+ api libs.axsl.ps
+ implementation libs.axsl.constants
+ api libs.axsl.value
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-pdf-core/build.gradle
===================================================================
--- trunk/foray/foray-pdf-core/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-pdf-core/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -8,7 +8,7 @@
dependencies {
- api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
+ api libs.axsl.pdf
implementation (project(':foray-primitive'))
implementation (project(':foray-common'))
Modified: trunk/foray/foray-pdf-parse/build.gradle
===================================================================
--- trunk/foray/foray-pdf-parse/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-pdf-parse/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -7,8 +7,8 @@
description = 'foray-pdf-parse'
dependencies {
- api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api libs.axsl.pdf
+ api libs.axsl.primitive
implementation (project(':foray-common'))
implementation (project(':foray-pdf-core'))
Modified: trunk/foray/foray-pioneer/build.gradle
===================================================================
--- trunk/foray/foray-pioneer/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-pioneer/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -6,19 +6,19 @@
description = 'foray-pioneer'
dependencies {
- implementation (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ implementation libs.axsl.content
+ implementation libs.axsl.i18n
+ api libs.axsl.layout
+ api libs.axsl.fotree
+ api libs.axsl.areatree
+ implementation libs.axsl.galley
+ api libs.axsl.linebreak
+ api libs.axsl.kp.model
+ implementation libs.axsl.graphic
+ api libs.axsl.font
+ implementation libs.axsl.orthography
+ implementation libs.axsl.constants
+ api libs.axsl.value
implementation (project(':foray-common'))
api (project(':foray-layout'))
Modified: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-primitive/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -7,8 +7,8 @@
dependencies {
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.primitive
}
javadoc {
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2025-06-25 12:19:36 UTC (rev 13864)
+++ trunk/foray/foray-ps/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
@@ -9,9 +9,9 @@
dependencies {
implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ api libs.axsl.constants
+ api libs.axsl.primitive
+ api libs.axsl.ps
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-ps-data/build....
[truncated message content] |
|
From: <vic...@us...> - 2025-06-25 13:43:14
|
Revision: 13866
http://sourceforge.net/p/foray/code/13866
Author: victormote
Date: 2025-06-25 13:43:07 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Replace some dependencies on ext.versions with dependencies on libs.versions.toml.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.logging-conventions.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps-data/build.gradle
trunk/foray/foray-xml/build.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -36,10 +36,6 @@
/******************** See Note 1 below for information about dependency releases. ********************/
ext.versions = [
- slf4j: '2.0.5', // Latest is 2.0.5 as of 2022-11-26.
- commonsIo: '2.11.0', // Latest is 2.11.0 as of 2022-11-26.
- commonsDiscovery: '0.5', // Latest is 0.5 as of 2022-11-26.
- commonsCli: '1.5.0', // Latest is 1.5.0 as of 2022-11-26.
xmlResolver: '1.2', // Latest is 1.2 as of 2022-11-26. See Note 3.
xmlSchemaCore: '2.3.0', // Latest is 2.3.0 as of 2023-08-05.
xerces2_J: '2.12.2', // Latest is 2.12.2 as of 2023-08-05.
Modified: trunk/foray/buildSrc/src/main/groovy/foray.logging-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.logging-conventions.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/buildSrc/src/main/groovy/foray.logging-conventions.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -5,7 +5,7 @@
}
dependencies {
- implementation (group: 'org.slf4j', name: 'slf4j-api', version: versions.slf4j)
+ implementation libs.slf4j
}
/* Last line of script. */
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-common/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -8,7 +8,7 @@
description = 'foray-common'
dependencies {
- implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation libs.commonsIo
implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
implementation libs.axsl.primitive
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-font/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -8,9 +8,9 @@
dependencies {
- api (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- implementation (group: 'commons-discovery', name: 'commons-discovery', version: versions.commonsDiscovery)
- api (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ api libs.commonsIo
+ implementation libs.commonsDiscovery
+ api libs.commonsCli
api libs.axsl.primitive
api libs.axsl.font
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-orthography/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -7,8 +7,8 @@
description = 'foray-orthography'
dependencies {
- api (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- api (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ api libs.commonsCli
+ api libs.commonsIo
implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
implementation libs.axsl.constants
Modified: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-primitive/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -6,7 +6,7 @@
description = 'foray-primitive'
dependencies {
- implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation libs.commonsIo
api libs.axsl.constants
api libs.axsl.primitive
}
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-ps/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -7,7 +7,7 @@
description = 'foray-ps'
dependencies {
- implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation libs.commonsCli
api libs.axsl.constants
api libs.axsl.primitive
Modified: trunk/foray/foray-ps-data/build.gradle
===================================================================
--- trunk/foray/foray-ps-data/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-ps-data/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -7,7 +7,7 @@
description = 'foray-ps-data'
dependencies {
- implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation libs.commonsCli
api libs.axsl.ps
@@ -14,7 +14,7 @@
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
- testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ testImplementation libs.commonsIo
}
javadoc {
Modified: trunk/foray/foray-xml/build.gradle
===================================================================
--- trunk/foray/foray-xml/build.gradle 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/foray-xml/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
@@ -7,7 +7,7 @@
description = 'foray-xml'
dependencies {
- implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation libs.commonsCli
implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
implementation (group: 'org.apache.ws.xmlschema', name: 'xmlschema-core', version: versions.xmlSchemaCore)
/* The Xerces parser is used because it handles numeric character references correctly, while the standard Java
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-25 13:11:01 UTC (rev 13865)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-25 13:43:07 UTC (rev 13866)
@@ -97,9 +97,12 @@
axsl-speech = { group = "org.axsl", name = "axsl-speech", version.ref = "axsl" }
axsl-value = { group = "org.axsl", name = "axsl-value", version.ref = "axsl" }
+slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
+commonsIo = { group = "commons-io", name = "commons-io", version.ref = "commonsIo" }
+commonsCli = { group = "commons-cli", name = "commons-cli", version.ref = "commonsCli" }
+commonsDiscovery = { group = "commons-discovery", name = "commons-discovery", version.ref = "commonsDiscovery" }
-
checker-framework = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
# checkerFramework (group = 'org.checkerframework', name = 'checker', version = versions.checkerFramework)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 15:12:33
|
Revision: 13867
http://sourceforge.net/p/foray/code/13867
Author: victormote
Date: 2025-06-25 15:12:30 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Replace some dependencies on ext.versions with dependencies on libs.versions.toml.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/foray-app/build.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-core/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-xml/build.gradle
trunk/foray/foray-zz-attic/build.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -34,54 +34,11 @@
ext.buildDate = new Date().format("yyyy-MM-dd 'at' HH:mm 'GMT'", TimeZone.getTimeZone("GMT"))
-/******************** See Note 1 below for information about dependency releases. ********************/
ext.versions = [
- xmlResolver: '1.2', // Latest is 1.2 as of 2022-11-26. See Note 3.
- xmlSchemaCore: '2.3.0', // Latest is 2.3.0 as of 2023-08-05.
- xerces2_J: '2.12.2', // Latest is 2.12.2 as of 2023-08-05.
- ant: '1.10.12', // Latest is 1.10.12 as of 2022-11-26.
- servletApi: '4.0.1', // Latest is 4.0.1 as of 2022-11-26.
- xmlgraphicsCommons: '2.6', // Latest is 2.6 as of 2022-01-17.
- batik: '1.14', // Latest is 1.14 as of 2022-01-17.
- jeuclid: '3.1.14', // Latest is 3.1.14 as of 2022-11-26. See Note 4.
- icu4j: '72.1', // Latest is 72.1 as of 2022-11-26.
-
checkerFramework: '3.49.2', // Latest is 3.49.2 as of 2025-04-20.
junit: '5.13.1', // Latest is 5.13.1 as of 2025-06-15.
mockito: '4.9.0', // Latest is 4.9.0 as of 2022-11-26. See Note 5.
-
-
- /* See foray-00-master/resources/logger-impl/00-readme.txt for information about logging implementations.
- Bottom line is that logging implementations are not and should not be part of any FOray dependencies.
- This entry can be uncommented temporarily for short-term testing, but should never be checked in. */
-// logbackClassic: '1.3.5', // Latest is 1.3.5 as of 2022-11-26.
-
- /* Build-time-only dependencies that should never be permanently used in build.gradle files. */
- checkstyle: '10.23', // Latest is 10.25 as of 2025-06-11. See Note 6.
]
-/*
- * Notes on Dependency Releases (See above for references)
- * ========================================================
- * 1. Latest release information above is per www.mvnrepository.com, and ignores non-released artifacts (no alpha or
- * beta releases, except for aXSL).
- *
- * 2. At the moment, and for the foreseeable future, aXSL is controlled by FOray, as we attempt to get the module APIs
- * cleaned up and robust.
- *
- * 3. TODO: Remove this dependency when we upgrade to Java 1.9, as it looks like the catalog resolver code is part of
- * that release.
- *
- * 4. JEuclid has moved from group net.sourceforge.jeuclid to de.rototor.jeuclid, but continues to use the name
- * "jeuclid-core" and the same general release numbering sequence.
- * The latest version for group net.sourceforge.jeuclid as of 2021-01-12 is 3.1.9 per www.mvnrepository.com.
- *
- * 5. Mockito versions from 4.6.0 to 4.9.0 cause breakage at build time for reasons that seem to be related to the
- * Java version used to start Gradle. For now, using a JDK that matches the javaTargetCompatibility value above
- * seems to solve the problem.
- *
- * 6. The current (as of 2025-06-11) Eclipse plugin for checkstyle uses Checkstyle 10.23.
- * We will use that for now to avoid configuration conflicts between the two versions.
- */
java {
@@ -191,7 +148,7 @@
checkstyle {
configFile = new File(rootProject.projectDir.absolutePath + '/foray-00-dev/config/checkstyle/checkstyle-config.xml')
configProperties.put('foray.root', rootProject.projectDir)
- toolVersion = versions.checkstyle
+ toolVersion = "10.23"
}
tasks.withType(JavaCompile) {
Modified: trunk/foray/foray-app/build.gradle
===================================================================
--- trunk/foray/foray-app/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-app/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -8,11 +8,11 @@
description = 'foray-app'
dependencies {
- implementation (group: 'javax.servlet', name: 'javax.servlet-api', version: versions.servletApi)
- implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
- implementation (group: 'org.apache.ant', name: 'ant', version: versions.ant)
- implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation libs.servletApi
+ implementation libs.xmlResolver
+ implementation libs.ant
+ implementation libs.commonsIo
+ implementation libs.commonsCli
implementation libs.axsl.font
implementation libs.axsl.linebreak
@@ -51,7 +51,7 @@
testFixturesImplementation (project(':foray-fotree'))
testFixturesImplementation (project(':foray-pioneer'))
- testImplementation(testFixtures(group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl))
+ testImplementation(testFixtures(libs.axsl.fotree))
}
javadoc {
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-common/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -9,7 +9,7 @@
dependencies {
implementation libs.commonsIo
- implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
+ implementation libs.icu4j
implementation libs.axsl.primitive
implementation libs.axsl.i18n
Modified: trunk/foray/foray-core/build.gradle
===================================================================
--- trunk/foray/foray-core/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-core/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -6,7 +6,7 @@
description = 'foray-core'
dependencies {
- implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
+ implementation libs.xmlResolver
api libs.axsl.areatree
api libs.axsl.fotree
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-fotree/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -23,7 +23,7 @@
api libs.svg.lib
api libs.mathml.lib
/* TODO: Replace this dependency on batik-anim, used for parsing SVGDocument, with something more lightweight. */
- implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
+ implementation libs.batikAnim
api libs.axsl.constants
api libs.axsl.fotree
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-graphic/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -7,18 +7,17 @@
description = 'foray-graphic'
dependencies {
- api (group: 'org.apache.xmlgraphics', name: 'xmlgraphics-commons', version: versions.xmlgraphicsCommons)
- api (group: 'org.apache.xmlgraphics', name: 'batik-bridge', version: versions.batik)
- api (group: 'org.apache.xmlgraphics', name: 'batik-gvt', version: versions.batik)
- implementation (group: 'org.apache.xmlgraphics', name: 'batik-parser', version: versions.batik)
- implementation (group: 'org.apache.xmlgraphics', name: 'batik-transcoder', version: versions.batik)
- implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
- api (group: "org.apache.xmlgraphics", name: "batik-dom", version: versions.batik)
- implementation (group: "org.apache.xmlgraphics", name: "batik-util", version: versions.batik)
+ api libs.xmlgraphicsCommons
+ api libs.batikBridge
+ api libs.batikGvt
+ implementation libs.batikParser
+ implementation libs.batikTranscoder
+ implementation libs.batikAnim
+ api libs.batikDom
+ implementation libs.batikUtil
api (group: "xml-apis", name: "xml-apis", version: "1.4.01")
api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
-// api (group: 'net.sourceforge.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
- api (group: 'de.rototor.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
+ api libs.jeuclid
api libs.svg.lib
api libs.mathml.lib
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-orthography/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -9,7 +9,7 @@
dependencies {
api libs.commonsCli
api libs.commonsIo
- implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
+ implementation libs.icu4j
implementation libs.axsl.constants
api libs.axsl.fotree
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-pdf/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -7,7 +7,7 @@
description = 'foray-pdf'
dependencies {
- api (group: 'org.apache.xmlgraphics', name: 'batik-awt-util', version: versions.batik)
+ api libs.batikAwtUtil
api libs.axsl.constants
api libs.axsl.pdf
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-render/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -19,7 +19,7 @@
implementation libs.axsl.orthography
api libs.axsl.ps
/* TODO: Replace this dependency on batik-anim, used for parsing SVGDocument, with something more lightweight. */
- implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
+ implementation libs.batikAnim
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-xml/build.gradle
===================================================================
--- trunk/foray/foray-xml/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-xml/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -8,12 +8,12 @@
dependencies {
implementation libs.commonsCli
- implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
- implementation (group: 'org.apache.ws.xmlschema', name: 'xmlschema-core', version: versions.xmlSchemaCore)
+ implementation libs.xmlResolver
+ implementation libs.xmlSchemaCore
/* The Xerces parser is used because it handles numeric character references correctly, while the standard Java
parser currently does not. */
- implementation (group: 'xerces', name: 'xercesImpl', version: versions.xerces2_J)
- api (group: "org.apache.xmlgraphics", name: "batik-dom", version: versions.batik)
+ implementation libs.xerces2JImpl
+ api libs.batikDom
api libs.mathml.lib
implementation (project(':foray-common'))
Modified: trunk/foray/foray-zz-attic/build.gradle
===================================================================
--- trunk/foray/foray-zz-attic/build.gradle 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/foray-zz-attic/build.gradle 2025-06-25 15:12:30 UTC (rev 13867)
@@ -7,9 +7,9 @@
description = 'foray-zz-attic'
dependencies {
- implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation libs.commonsIo
api (group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.2')
- implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
+ implementation libs.icu4j
api libs.axsl.constants
implementation libs.axsl.primitive
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-25 13:43:07 UTC (rev 13866)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-25 15:12:30 UTC (rev 13867)
@@ -4,10 +4,10 @@
# ******************** See Note 1 below for information about dependency releases. ********************
-# Dependencies related to aXSL. These should be maintained at the same versions used by aXSL. */
+# Dependencies related to aXSL. These should be maintained at the same versions used by aXSL. */
svgDom = "1.1" # See aXSL master/build.gradle
mathMlDom = "2.0" # See aXSL master/build.gradle
-# End of aXSL-related dependencies. */
+# End of aXSL-related dependencies. */
axsl = "0.3-SNAPSHOT" # Latest is 0.3-SNAPSHOT as of 2022-11-26. See Note 2.
slf4j = "2.0.5" # Latest is 2.0.5 as of 2022-11-26.
@@ -16,7 +16,7 @@
commonsCli = "1.5.0" # Latest is 1.5.0 as of 2022-11-26.
xmlResolver = "1.2" # Latest is 1.2 as of 2022-11-26. See Note 3.
xmlSchemaCore = "2.3.0" # Latest is 2.3.0 as of 2023-08-05.
-xerces2_J = "2.12.2" # Latest is 2.12.2 as of 2023-08-05.
+xerces2J = "2.12.2" # Latest is 2.12.2 as of 2023-08-05.
ant = "1.10.12" # Latest is 1.10.12 as of 2022-11-26.
servletApi = "4.0.1" # Latest is 4.0.1 as of 2022-11-26.
xmlgraphicsCommons = "2.6" # Latest is 2.6 as of 2022-01-17.
@@ -101,10 +101,27 @@
commonsIo = { group = "commons-io", name = "commons-io", version.ref = "commonsIo" }
commonsCli = { group = "commons-cli", name = "commons-cli", version.ref = "commonsCli" }
commonsDiscovery = { group = "commons-discovery", name = "commons-discovery", version.ref = "commonsDiscovery" }
+xmlResolver = { group = "xml-resolver", name = "xml-resolver", version.ref = "xmlResolver" }
+xmlSchemaCore = { group = "org.apache.ws.xmlschema", name = "xmlschema-core", version.ref = "xmlSchemaCore" }
+xerces2JImpl = { group = "xerces", name = "xercesImpl", version.ref = "xerces2J" }
+servletApi = { group = "javax.servlet", name = "javax.servlet-api", version.ref = "servletApi" }
+ant = { group = "org.apache.ant", name = "ant", version.ref = "ant" }
+icu4j = { group = "com.ibm.icu", name = "icu4j", version.ref = "icu4j" }
+xmlgraphicsCommons = { group = "org.apache.xmlgraphics", name = "xmlgraphics-commons", version.ref = "xmlgraphicsCommons" }
+batikBridge = { group = "org.apache.xmlgraphics", name = "batik-bridge", version.ref = "batik" }
+batikGvt = { group = "org.apache.xmlgraphics", name = "batik-gvt", version.ref = "batik" }
+batikParser = { group = "org.apache.xmlgraphics", name = "batik-parser", version.ref = "batik" }
+batikTranscoder = { group = "org.apache.xmlgraphics", name = "batik-transcoder", version.ref = "batik" }
+batikAnim = { group = "org.apache.xmlgraphics", name = "batik-anim", version.ref = "batik" }
+batikDom = { group = "org.apache.xmlgraphics", name = "batik-dom", version.ref = "batik" }
+batikUtil = { group = "org.apache.xmlgraphics", name = "batik-util", version.ref = "batik" }
+batikAwtUtil = { group = "org.apache.xmlgraphics", name = "batik-awt-util", version.ref = "batik" }
+#jeuclid = { group = "net.sourceforge.jeuclid", name = "jeuclid-core", version.ref = "jeuclid" }
+jeuclid = { group = "de.rototor.jeuclid", name = "jeuclid-core", version.ref = "jeuclid" }
checker-framework = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
-# checkerFramework (group = 'org.checkerframework', name = 'checker', version = versions.checkerFramework)
+# checkerFramework (group = "org.checkerframework", name = "checker", version = versions.checkerFramework)
junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 17:59:16
|
Revision: 13868
http://sourceforge.net/p/foray/code/13868
Author: victormote
Date: 2025-06-25 17:59:13 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Replace some dependencies on ext.versions with dependencies on libs.versions.toml.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 15:12:30 UTC (rev 13867)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 17:59:13 UTC (rev 13868)
@@ -36,8 +36,6 @@
ext.versions = [
checkerFramework: '3.49.2', // Latest is 3.49.2 as of 2025-04-20.
- junit: '5.13.1', // Latest is 5.13.1 as of 2025-06-15.
- mockito: '4.9.0', // Latest is 4.9.0 as of 2022-11-26. See Note 5.
]
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-25 15:12:30 UTC (rev 13867)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-25 17:59:13 UTC (rev 13868)
@@ -5,12 +5,11 @@
}
dependencies {
- testImplementation (platform
- (group: 'org.junit', name: 'junit-bom', version: versions.junit))
- testImplementation (group: 'org.junit.jupiter', name: 'junit-jupiter')
- testRuntimeOnly (group: 'org.junit.platform', name: 'junit-platform-launcher')
+ testImplementation (platform libs.junitBom)
+ testImplementation libs.junitJupiter
+ testRuntimeOnly libs.junitPlatformLauncher
- testImplementation (group: 'org.mockito', name: 'mockito-core', version: versions.mockito)
+ testImplementation libs.mockito
}
test {
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-25 15:12:30 UTC (rev 13867)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-25 17:59:13 UTC (rev 13868)
@@ -8,9 +8,9 @@
dependencies {
/* Allow test fixtures to make assertions and use Mockito. */
- testFixturesImplementation (platform (group: 'org.junit', name: 'junit-bom', version: versions.junit))
- testFixturesImplementation (group: 'org.junit.jupiter', name: 'junit-jupiter')
- testFixturesImplementation (group: 'org.mockito', name: 'mockito-core', version: versions.mockito)
+ testFixturesImplementation (platform libs.junitBom)
+ testFixturesImplementation libs.junitJupiter
+ testFixturesImplementation libs.mockito
}
/* Last line of script. */
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-25 15:12:30 UTC (rev 13867)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-25 17:59:13 UTC (rev 13868)
@@ -123,9 +123,9 @@
checker-framework = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
# checkerFramework (group = "org.checkerframework", name = "checker", version = versions.checkerFramework)
-junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
-junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
-junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junit" }
+junitBom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
+junitJupiter = { group = "org.junit.jupiter", name = "junit-jupiter" }
+junitPlatformLauncher = { group = "org.junit.platform", name = "junit-platform-launcher" }
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 19:58:59
|
Revision: 13869
http://sourceforge.net/p/foray/code/13869
Author: victormote
Date: 2025-06-25 19:58:56 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Fix checker dependency.
Modified Paths:
--------------
trunk/foray/build.gradle
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/build.gradle
===================================================================
--- trunk/foray/build.gradle 2025-06-25 17:59:13 UTC (rev 13868)
+++ trunk/foray/build.gradle 2025-06-25 19:58:56 UTC (rev 13869)
@@ -30,13 +30,7 @@
id "java"
id "com.autonomousapps.dependency-analysis" version "1.0.0-rc02"
id "java-library-distribution"
- /* The Gradle Checker Framework Plugin (being invoked here) is a wrapper of, but is a separate product from, the
- Checker Framework, has its own release cycle, and its own release numbering system.
- https://github.com/kelloggm/checkerframework-gradle-plugin
- Documentation of the Checker Framework itself can be found at
- https://checkerframework.org/manual/#gradle
- */
- id "org.checkerframework" version "0.6.53"
+ alias(libs.plugins.checkerFramework) apply false
}
@@ -158,4 +152,24 @@
}
+allprojects {
+ apply plugin: "org.checkerframework"
+
+ checkerFramework {
+ checkers = [
+ "org.checkerframework.checker.signedness.SignednessChecker"
+ ]
+
+ /* Uncomment the following line temporarily to disable checker, for testing. */
+ /* We leave this checking turned off for now, pending resolution of build errors that we don't understand. */
+ skipCheckerFramework = true
+ }
+
+ dependencies {
+ checkerFramework libs.checkerFramework
+ compileOnly libs.checkerQual
+ testCompileOnly libs.checkerQual
+ }
+}
+
/* Last line of script. */
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 17:59:13 UTC (rev 13868)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 19:58:56 UTC (rev 13869)
@@ -5,7 +5,6 @@
id 'eclipse'
id 'checkstyle'
id 'maven-publish'
- id "org.checkerframework"
}
@@ -142,7 +141,6 @@
}
-
checkstyle {
configFile = new File(rootProject.projectDir.absolutePath + '/foray-00-dev/config/checkstyle/checkstyle-config.xml')
configProperties.put('foray.root', rootProject.projectDir)
@@ -149,24 +147,9 @@
toolVersion = "10.23"
}
+
tasks.withType(JavaCompile) {
options.deprecation = true
}
-checkerFramework {
- checkers = [
- "org.checkerframework.checker.signedness.SignednessChecker"
- ]
-
- /* Uncomment the following line temporarily to disable checker, for testing. */
- /* We leave this checking turned off for now, pending resolution of build errors that we don't understand. */
- skipCheckerFramework = true
-}
-
-dependencies {
- compileOnly (group: 'org.checkerframework', name: 'checker-qual', version: versions.checkerFramework)
- testCompileOnly (group: 'org.checkerframework', name: 'checker-qual', version: versions.checkerFramework)
- checkerFramework (group: 'org.checkerframework', name: 'checker', version: versions.checkerFramework)
-}
-
/* Last line of script. */
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-25 17:59:13 UTC (rev 13868)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-25 19:58:56 UTC (rev 13869)
@@ -120,8 +120,8 @@
jeuclid = { group = "de.rototor.jeuclid", name = "jeuclid-core", version.ref = "jeuclid" }
-checker-framework = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
-# checkerFramework (group = "org.checkerframework", name = "checker", version = versions.checkerFramework)
+checkerFramework = { group = "org.checkerframework", name = "checker", version.ref = "checkerFramework" }
+checkerQual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
junitBom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junitJupiter = { group = "org.junit.jupiter", name = "junit-jupiter" }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 20:31:11
|
Revision: 13870
http://sourceforge.net/p/foray/code/13870
Author: victormote
Date: 2025-06-25 20:31:08 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Remove versions, replacing remaining uses of it.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-linebreak/build.gradle
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 19:58:56 UTC (rev 13869)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-25 20:31:08 UTC (rev 13870)
@@ -33,11 +33,6 @@
ext.buildDate = new Date().format("yyyy-MM-dd 'at' HH:mm 'GMT'", TimeZone.getTimeZone("GMT"))
-ext.versions = [
- checkerFramework: '3.49.2', // Latest is 3.49.2 as of 2025-04-20.
-]
-
-
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2025-06-25 19:58:56 UTC (rev 13869)
+++ trunk/foray/foray-fotree/build.gradle 2025-06-25 20:31:08 UTC (rev 13870)
@@ -38,7 +38,7 @@
implementation (project(':foray-primitive'))
api (project(':foray-xml'))
- testImplementation(testFixtures(group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl))
+ testImplementation testFixtures(libs.axsl.fotree)
}
javadoc {
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2025-06-25 19:58:56 UTC (rev 13869)
+++ trunk/foray/foray-linebreak/build.gradle 2025-06-25 20:31:08 UTC (rev 13870)
@@ -1,26 +1,26 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
}
-description = 'foray-linebreak'
+description = "foray-linebreak"
dependencies {
- api libs.axsl.linebreak
- api libs.axsl.context
- api libs.axsl.kp.model
+ api libs.axsl.linebreak
+ api libs.axsl.context
+ api libs.axsl.kp.model
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
- testImplementation (project(':foray-orthography'))
- testImplementation (group: "org.axsl", name: "axsl-font", version: versions.axsl)
- testImplementation (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
- testImplementation (group: "org.axsl", name: "axsl-ps", version: versions.axsl)
- testImplementation (project(":foray-ps-data"))
- testImplementation (project(":foray-font-tf"))
+ testImplementation project(":foray-orthography")
+ testImplementation libs.axsl.font
+ testImplementation libs.axsl.orthography
+ testImplementation libs.axsl.ps
+ testImplementation project(":foray-ps-data")
+ testImplementation project(":foray-font-tf")
- testImplementation (testFixtures(group: "org.axsl", name: "axsl-kp-model", version: versions.axsl))
+ testImplementation testFixtures(libs.axsl.kp.model)
}
javadoc {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-25 21:51:30
|
Revision: 13872
http://sourceforge.net/p/foray/code/13872
Author: victormote
Date: 2025-06-25 21:51:29 +0000 (Wed, 25 Jun 2025)
Log Message:
-----------
Fix deprecation warning by upgrading dependency analysis plugin.
Modified Paths:
--------------
trunk/foray/build.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/build.gradle
===================================================================
--- trunk/foray/build.gradle 2025-06-25 20:31:51 UTC (rev 13871)
+++ trunk/foray/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
@@ -28,8 +28,8 @@
plugins {
id "foray.common-conventions"
id "java"
- id "com.autonomousapps.dependency-analysis" version "1.0.0-rc02"
id "java-library-distribution"
+ alias(libs.plugins.autonomousDependencyAnalysis)
alias(libs.plugins.checkerFramework) apply false
}
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-25 20:31:51 UTC (rev 13871)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-25 21:51:29 UTC (rev 13872)
@@ -27,6 +27,9 @@
checkerFramework = "3.49.2" # Latest is 3.49.2 as of 2025-04-20. See Note 7.
checkerFrameworkGradlePlugin = "0.6.55" # Latest is 0.6.55 as of 2025-06-24. See Note 7.
+autonomousDependencyAnalysis = "2.19.0" # Latest is 2.19.0 as of 2025-06-25.
+
+
junit = "5.13.1" # Latest is 5.13.1 as of 2025-06-15.
mockito = "4.9.0" # Latest is 4.9.0 as of 2022-11-26. See Note 5.
@@ -135,5 +138,6 @@
[plugins]
checkerFramework = { id = "org.checkerframework", version.ref = "checkerFrameworkGradlePlugin" }
+autonomousDependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "autonomousDependencyAnalysis" }
# Last line of libs.versions.toml File.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-26 12:31:03
|
Revision: 13873
http://sourceforge.net/p/foray/code/13873
Author: victormote
Date: 2025-06-26 12:31:00 +0000 (Thu, 26 Jun 2025)
Log Message:
-----------
Make gradle libs more consistent.
Modified Paths:
--------------
trunk/foray/build.gradle
trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
trunk/foray/foray-app/build.gradle
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-core/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps-data/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-xml/build.gradle
trunk/foray/foray-zz-attic/build.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/build.gradle
===================================================================
--- trunk/foray/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -166,9 +166,9 @@
}
dependencies {
- checkerFramework libs.checkerFramework
- compileOnly libs.checkerQual
- testCompileOnly libs.checkerQual
+ checkerFramework libs.checker.framework
+ compileOnly libs.checker.qual
+ testCompileOnly libs.checker.qual
}
}
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -5,9 +5,9 @@
}
dependencies {
- testImplementation (platform libs.junitBom)
- testImplementation libs.junitJupiter
- testRuntimeOnly libs.junitPlatformLauncher
+ testImplementation (platform libs.junit.bom)
+ testImplementation libs.junit.jupiter
+ testRuntimeOnly libs.junit.platform.launcher
testImplementation libs.mockito
}
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -8,8 +8,8 @@
dependencies {
/* Allow test fixtures to make assertions and use Mockito. */
- testFixturesImplementation (platform libs.junitBom)
- testFixturesImplementation libs.junitJupiter
+ testFixturesImplementation (platform libs.junit.bom)
+ testFixturesImplementation libs.junit.jupiter
testFixturesImplementation libs.mockito
}
Modified: trunk/foray/foray-app/build.gradle
===================================================================
--- trunk/foray/foray-app/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-app/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -8,48 +8,48 @@
description = 'foray-app'
dependencies {
- implementation libs.servletApi
- implementation libs.xmlResolver
- implementation libs.ant
- implementation libs.commonsIo
- implementation libs.commonsCli
+ implementation libs.servlet.api
+ implementation libs.xml.resolver
+ implementation libs.ant
+ implementation libs.commons.io
+ implementation libs.commons.cli
- implementation libs.axsl.font
- implementation libs.axsl.linebreak
- implementation libs.axsl.ps
- implementation libs.axsl.areatree
- implementation libs.axsl.output
- implementation libs.axsl.fotree
- implementation libs.axsl.galley
- implementation libs.axsl.orthography
- implementation libs.axsl.graphic
- implementation libs.axsl.layout
- implementation libs.axsl.speech
- implementation libs.axsl.mif
- implementation libs.axsl.pdf
+ implementation libs.axsl.font
+ implementation libs.axsl.linebreak
+ implementation libs.axsl.ps
+ implementation libs.axsl.areatree
+ implementation libs.axsl.output
+ implementation libs.axsl.fotree
+ implementation libs.axsl.galley
+ implementation libs.axsl.orthography
+ implementation libs.axsl.graphic
+ implementation libs.axsl.layout
+ implementation libs.axsl.speech
+ implementation libs.axsl.mif
+ implementation libs.axsl.pdf
- implementation (project(':foray-areatree'))
- implementation (project(':foray-common'))
- implementation (project(':foray-core'))
- implementation (project(':foray-font'))
- implementation (project(':foray-fotree'))
- implementation (project(':foray-graphic'))
- implementation (project(':foray-layout'))
- implementation (project(':foray-mif'))
- implementation (project(':foray-orthography'))
- implementation (project(':foray-output'))
- implementation (project(':foray-pdf'))
- implementation (project(':foray-pioneer'))
- implementation (project(':foray-ps'))
- implementation (project(':foray-render'))
- implementation (project(':foray-speech'))
- implementation (project(':foray-linebreak'))
+ implementation project(':foray-areatree')
+ implementation project(':foray-common')
+ implementation project(':foray-core')
+ implementation project(':foray-font')
+ implementation project(':foray-fotree')
+ implementation project(':foray-graphic')
+ implementation project(':foray-layout')
+ implementation project(':foray-mif')
+ implementation project(':foray-orthography')
+ implementation project(':foray-output')
+ implementation project(':foray-pdf')
+ implementation project(':foray-pioneer')
+ implementation project(':foray-ps')
+ implementation project(':foray-render')
+ implementation project(':foray-speech')
+ implementation project(':foray-linebreak')
- testFixturesImplementation (project(':foray-areatree'))
- testFixturesImplementation (project(':foray-core'))
- testFixturesImplementation (project(':foray-fotree'))
- testFixturesImplementation (project(':foray-pioneer'))
+ testFixturesImplementation project(':foray-areatree')
+ testFixturesImplementation project(':foray-core')
+ testFixturesImplementation project(':foray-fotree')
+ testFixturesImplementation project(':foray-pioneer')
testImplementation(testFixtures(libs.axsl.fotree))
}
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-areatree/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,18 +1,18 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-areatree'
+description = "foray-areatree"
dependencies {
- api libs.svg.lib
- api libs.mathml.lib
+ api libs.svg.dom
+ api libs.mathml.dom
- api libs.axsl.areatree
- api libs.axsl.font
- api libs.axsl.fotree
+ api libs.axsl.areatree
+ api libs.axsl.font
+ api libs.axsl.fotree
/* We dislike declaring a direct dependency on axsl-galley here as axsl-areatree is intended to be a direct superset
* of it, and a dependency on axsl-areatree should be sufficient. Indeed, from a gradle standpoint it is, as gradle
* handles the transitive dependency properly. However, there is no build pattern (known to us) that allows a module
@@ -19,16 +19,16 @@
* to declare that its API is a direct (non-transitive) superset of another module's API. Since we are using the
* autonomousapps dependency-analysis tool, which (for good reason) dislikes having transitive dependencies
* accidentally leak into the API of client code, we declare a direct dependency on axsl-galley here. */
- api libs.axsl.galley
- api libs.axsl.graphic
- api libs.axsl.i18n
- api libs.axsl.orthography
- api libs.axsl.value
- implementation libs.axsl.constants
- implementation libs.axsl.kp.model
+ api libs.axsl.galley
+ api libs.axsl.graphic
+ api libs.axsl.i18n
+ api libs.axsl.orthography
+ api libs.axsl.value
+ implementation libs.axsl.constants
+ implementation libs.axsl.kp.model
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
}
javadoc {
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-common/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,24 +1,24 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
/* TODO: foray-common should probably not have a dependency on logging. */
- id 'foray.logging-conventions'
+ id "foray.logging-conventions"
}
-description = 'foray-common'
+description = "foray-common"
dependencies {
- implementation libs.commonsIo
- implementation libs.icu4j
+ implementation libs.commons.io
+ implementation libs.icu4j
- implementation libs.axsl.primitive
- implementation libs.axsl.i18n
- implementation libs.axsl.kp.model
- implementation libs.axsl.ps
- implementation libs.axsl.constants
- implementation libs.axsl.value
+ implementation libs.axsl.primitive
+ implementation libs.axsl.i18n
+ implementation libs.axsl.kp.model
+ implementation libs.axsl.ps
+ implementation libs.axsl.constants
+ implementation libs.axsl.value
- implementation project(':foray-primitive')
+ implementation project(":foray-primitive")
}
javadoc {
@@ -29,10 +29,10 @@
/* We want the DTDs to live as part of the website files, so we need to copy them into the jar file here. */
jar {
- from rootProject.projectDir.absolutePath + '/foray-00-dev/doc/web/dtds/0.1/en/',
+ from rootProject.projectDir.absolutePath + "/foray-00-dev/doc/web/dtds/0.1/en/",
{
- include 'foray-config.dtd'
- into '/resources/org/foray/dtds/'
+ include "foray-config.dtd"
+ into "/resources/org/foray/dtds/"
}
}
Modified: trunk/foray/foray-core/build.gradle
===================================================================
--- trunk/foray/foray-core/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-core/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,27 +1,27 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-core'
+description = "foray-core"
dependencies {
- implementation libs.xmlResolver
+ implementation libs.xml.resolver
- api libs.axsl.areatree
- api libs.axsl.fotree
- api libs.axsl.font
- implementation libs.axsl.galley
- api libs.axsl.graphic
- api libs.axsl.layout
- api libs.axsl.orthography
- api libs.axsl.output
- api libs.axsl.speech
- api libs.axsl.linebreak
- implementation libs.axsl.constants
+ api libs.axsl.areatree
+ api libs.axsl.fotree
+ api libs.axsl.font
+ implementation libs.axsl.galley
+ api libs.axsl.graphic
+ api libs.axsl.layout
+ api libs.axsl.orthography
+ api libs.axsl.output
+ api libs.axsl.speech
+ api libs.axsl.linebreak
+ implementation libs.axsl.constants
- api (project(':foray-common'))
- api (project(':foray-xml'))
+ api project(":foray-common")
+ api project(":foray-xml")
}
javadoc {
@@ -32,10 +32,10 @@
/* We want the DTDs to live as part of the website files, so we need to copy them into the jar file here. */
jar {
- from rootProject.projectDir.absolutePath + '/doc/web/dtds/0.1/en/',
+ from rootProject.projectDir.absolutePath + "/doc/web/dtds/0.1/en/",
{
- include '*.dtd'
- into '/resources/org/foray/dtds/'
+ include "*.dtd"
+ into "/resources/org/foray/dtds/"
}
}
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-font/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,16 +1,16 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-font'
+description = "foray-font"
dependencies {
- api libs.commonsIo
- implementation libs.commonsDiscovery
- api libs.commonsCli
+ api libs.commons.io
+ implementation libs.commons.discovery
+ api libs.commons.cli
api libs.axsl.primitive
api libs.axsl.font
@@ -19,13 +19,13 @@
implementation libs.axsl.constants
api libs.axsl.value
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
- api (project(':foray-xml'))
- api (project(':foray-ps-data'))
- api (project(':foray-font-parse'))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
+ api project(":foray-xml")
+ api project(":foray-ps-data")
+ api project(":foray-font-parse")
- testRuntimeOnly (project(':foray-ps'))
+ testRuntimeOnly project(":foray-ps")
}
@@ -41,12 +41,12 @@
outputs.upToDateWhen { false }
description = "Parse and serialize the Base-14 metrics files"
classpath = sourceSets.main.runtimeClasspath
- mainClass = 'org.foray.font.format.type1.Type1MetricsSerializer'
- args('--input')
- args('src/main/data/base-14')
- args('--output')
- args('src/main/resources/resources/org/foray/font/base14')
- args('--pattern')
+ mainClass = "org.foray.font.format.type1.Type1MetricsSerializer"
+ args("--input")
+ args("src/main/data/base-14")
+ args("--output")
+ args("src/main/resources/resources/org/foray/font/base14")
+ args("--pattern")
args('^.*\\.afm$')
}
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-fotree/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,10 +1,10 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-fotree'
+description = "foray-fotree"
dependencies {
@@ -20,25 +20,25 @@
*/
- api libs.svg.lib
- api libs.mathml.lib
+ api libs.svg.dom
+ api libs.mathml.dom
/* TODO: Replace this dependency on batik-anim, used for parsing SVGDocument, with something more lightweight. */
- implementation libs.batikAnim
+ implementation libs.batik.anim
- api libs.axsl.constants
- api libs.axsl.fotree
- implementation libs.axsl.primitive
- api libs.axsl.i18n
- api libs.axsl.orthography
- api libs.axsl.kp.model
- implementation libs.axsl.constants
- api libs.axsl.value
+ api libs.axsl.constants
+ api libs.axsl.fotree
+ implementation libs.axsl.primitive
+ api libs.axsl.i18n
+ api libs.axsl.orthography
+ api libs.axsl.kp.model
+ implementation libs.axsl.constants
+ api libs.axsl.value
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
- api (project(':foray-xml'))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
+ api project(":foray-xml")
- testImplementation testFixtures(libs.axsl.fotree)
+ testImplementation testFixtures(libs.axsl.fotree)
}
javadoc {
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-graphic/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,37 +1,37 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-graphic'
+description = "foray-graphic"
dependencies {
- api libs.xmlgraphicsCommons
- api libs.batikBridge
- api libs.batikGvt
- implementation libs.batikParser
- implementation libs.batikTranscoder
- implementation libs.batikAnim
- api libs.batikDom
- implementation libs.batikUtil
- api (group: "xml-apis", name: "xml-apis", version: "1.4.01")
- api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
- api libs.jeuclid
- api libs.svg.lib
- api libs.mathml.lib
+ api libs.xmlgraphics.commons
+ api libs.batik.bridge
+ api libs.batik.gvt
+ implementation libs.batik.parser
+ implementation libs.batik.transcoder
+ implementation libs.batik.anim
+ api libs.batik.dom
+ implementation libs.batik.util
+ api (group: "xml-apis", name: "xml-apis", version: "1.4.01")
+ api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
+ api libs.jeuclid
+ api libs.svg.dom
+ api libs.mathml.dom
- api libs.axsl.constants
- api libs.axsl.primitive
- api libs.axsl.font
- api libs.axsl.graphic
- api libs.axsl.orthography
- api libs.axsl.ps
- api libs.axsl.value
+ api libs.axsl.constants
+ api libs.axsl.primitive
+ api libs.axsl.font
+ api libs.axsl.graphic
+ api libs.axsl.orthography
+ api libs.axsl.ps
+ api libs.axsl.value
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
- implementation (project(':foray-xml'))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
+ implementation project(":foray-xml")
}
javadoc {
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-orthography/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,27 +1,27 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-orthography'
+description = "foray-orthography"
dependencies {
- api libs.commonsCli
- api libs.commonsIo
- implementation libs.icu4j
+ api libs.commons.cli
+ api libs.commons.io
+ implementation libs.icu4j
- implementation libs.axsl.constants
- api libs.axsl.fotree
- api libs.axsl.i18n
- api libs.axsl.kp.model
- api libs.axsl.orthography
- api libs.axsl.primitive
- api libs.axsl.value
+ implementation libs.axsl.constants
+ api libs.axsl.fotree
+ api libs.axsl.i18n
+ api libs.axsl.kp.model
+ api libs.axsl.orthography
+ api libs.axsl.primitive
+ api libs.axsl.value
- api (project(':foray-common'))
- api (project(':foray-primitive'))
- api (project(':foray-xml'))
+ api project(":foray-common")
+ api project(":foray-primitive")
+ api project(":foray-xml")
}
@@ -37,12 +37,12 @@
outputs.upToDateWhen { false }
description = "Parse and serialize the hyphenation patterns"
classpath = sourceSets.main.runtimeClasspath
- mainClass = 'org.foray.orthography.util.PatternSerializer'
- args('--input')
- args('src/main/data/hyph-patterns')
- args('--output')
- args('src/main/resources/resources/org/foray/orthography/hyphPatterns')
- args('--pattern')
+ mainClass = "org.foray.orthography.util.PatternSerializer"
+ args("--input")
+ args("src/main/data/hyph-patterns")
+ args("--output")
+ args("src/main/resources/resources/org/foray/orthography/hyphPatterns")
+ args("--pattern")
args('^.*\\.xml$')
}
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-pdf/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,31 +1,31 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-pdf'
+description = "foray-pdf"
dependencies {
- api libs.batikAwtUtil
+ api libs.batik.awt.util
- api libs.axsl.constants
- api libs.axsl.pdf
- api libs.axsl.primitive
- api libs.axsl.font
- api libs.axsl.graphic
- api libs.axsl.orthography
- api libs.axsl.ps
- implementation libs.axsl.constants
- api libs.axsl.value
+ api libs.axsl.constants
+ api libs.axsl.pdf
+ api libs.axsl.primitive
+ api libs.axsl.font
+ api libs.axsl.graphic
+ api libs.axsl.orthography
+ api libs.axsl.ps
+ implementation libs.axsl.constants
+ api libs.axsl.value
- api (project(':foray-common'))
- implementation (project(':foray-primitive'))
- implementation (project(':foray-pdf-core'))
- implementation (project(":foray-ps-data"))
+ api project(":foray-common")
+ implementation project(":foray-primitive")
+ implementation project(":foray-pdf-core")
+ implementation project(":foray-ps-data")
- testImplementation (project(':foray-font'))
- testImplementation (project(':foray-ps'))
+ testImplementation project(":foray-font")
+ testImplementation project(":foray-ps")
}
javadoc {
Modified: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-primitive/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,14 +1,14 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
}
-description = 'foray-primitive'
+description = "foray-primitive"
dependencies {
- implementation libs.commonsIo
- api libs.axsl.constants
- api libs.axsl.primitive
+ implementation libs.commons.io
+ api libs.axsl.constants
+ api libs.axsl.primitive
}
javadoc {
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-ps/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,21 +1,21 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-ps'
+description = "foray-ps"
dependencies {
- implementation libs.commonsCli
+ implementation libs.commons.cli
- api libs.axsl.constants
- api libs.axsl.primitive
- api libs.axsl.ps
+ api libs.axsl.constants
+ api libs.axsl.primitive
+ api libs.axsl.ps
- implementation (project(':foray-common'))
- implementation (project(':foray-primitive'))
- implementation (project(':foray-ps-data'))
+ implementation project(":foray-common")
+ implementation project(":foray-primitive")
+ implementation project(":foray-ps-data")
}
Modified: trunk/foray/foray-ps-data/build.gradle
===================================================================
--- trunk/foray/foray-ps-data/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-ps-data/build.gradle 2025-06-26 12:31:00 UTC (rev 13873)
@@ -1,20 +1,20 @@
plugins {
- id 'foray.library-conventions'
- id 'foray.test-conventions'
- id 'foray.logging-conventions'
+ id "foray.library-conventions"
+ id "foray.test-conventions"
+ id "foray.logging-conventions"
}
-description = 'foray-ps-data'
+description = "foray-ps-data"
dependencies {
- implementation libs.commonsCli
+ implementation libs.commons.cli
- api libs.axsl.ps
+ api libs.axsl.ps
- implementation (project(':foray-common'))
- implementation (project(':foray-primitive'))
+ implementation project(":foray-common")
+ implementation project(":foray-primitive")
- testImplementation libs.commonsIo
+ testImplementation libs.commons.io
}
javadoc {
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2025-06-25 21:51:29 UTC (rev 13872)
+++ trunk/foray/foray-render/build.gradle 2025-06-26 12:31:00 UTC (rev...
[truncated message content] |
|
From: <vic...@us...> - 2025-06-26 14:40:09
|
Revision: 13875
http://sourceforge.net/p/foray/code/13875
Author: victormote
Date: 2025-06-26 14:40:06 +0000 (Thu, 26 Jun 2025)
Log Message:
-----------
Fix junit dependency.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-26 12:42:56 UTC (rev 13874)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-conventions.gradle 2025-06-26 14:40:06 UTC (rev 13875)
@@ -5,7 +5,6 @@
}
dependencies {
- testImplementation (platform libs.junit.bom)
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.platform.launcher
Modified: trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-26 12:42:56 UTC (rev 13874)
+++ trunk/foray/buildSrc/src/main/groovy/foray.test-fixtures-conventions.gradle 2025-06-26 14:40:06 UTC (rev 13875)
@@ -8,7 +8,6 @@
dependencies {
/* Allow test fixtures to make assertions and use Mockito. */
- testFixturesImplementation (platform libs.junit.bom)
testFixturesImplementation libs.junit.jupiter
testFixturesImplementation libs.mockito
}
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-26 12:42:56 UTC (rev 13874)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-26 14:40:06 UTC (rev 13875)
@@ -125,8 +125,7 @@
checker-framework = { group = "org.checkerframework", name = "checker", version.ref = "checkerFramework" }
checker-qual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerFramework" }
-junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
-junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter" }
+junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-26 15:44:48
|
Revision: 13876
http://sourceforge.net/p/foray/code/13876
Author: victormote
Date: 2025-06-26 15:44:45 +0000 (Thu, 26 Jun 2025)
Log Message:
-----------
Fix checkstyle config and versioning.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
trunk/foray/buildSrc/src/main/groovy/foray.library-conventions.gradle
trunk/foray/gradle/libs.versions.toml
Modified: trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-26 14:40:06 UTC (rev 13875)
+++ trunk/foray/buildSrc/src/main/groovy/foray.common-conventions.gradle 2025-06-26 15:44:45 UTC (rev 13876)
@@ -3,7 +3,6 @@
plugins {
id 'java'
id 'eclipse'
- id 'checkstyle'
id 'maven-publish'
}
@@ -33,6 +32,18 @@
ext.buildDate = new Date().format("yyyy-MM-dd 'at' HH:mm 'GMT'", TimeZone.getTimeZone("GMT"))
+ext.versions = [
+ /* IMPORTANT: Most dependency versions should be managed in gradle/libs.versions.toml. The versions recorded here
+ should apply only to dependencies that cannot be managed from that document, or for which we do not know how to
+ manage from that document. */
+
+ /* The latest version of checkstyle as of 2025-06-11 is 10.25. As of that same date, the current Eclipse plugin for
+ checkstyle uses Checkstyle 10.23.0. We will use that for now to avoid configuration conflicts between the two
+ versions. */
+ checkstyle: "10.23.0"
+]
+
+
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -136,13 +147,6 @@
}
-checkstyle {
- configFile = new File(rootProject.projectDir.absolutePath + '/foray-00-dev/config/checkstyle/checkstyle-config.xml')
- configProperties.put('foray.root', rootProject.projectDir)
- toolVersion = "10.23"
-}
-
-
tasks.withType(JavaCompile) {
options.deprecation = true
}
Modified: trunk/foray/buildSrc/src/main/groovy/foray.library-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.library-conventions.gradle 2025-06-26 14:40:06 UTC (rev 13875)
+++ trunk/foray/buildSrc/src/main/groovy/foray.library-conventions.gradle 2025-06-26 15:44:45 UTC (rev 13876)
@@ -3,7 +3,15 @@
plugins {
id 'foray.common-conventions'
id 'java-library'
+ id 'checkstyle'
}
+checkstyle {
+ configFile = new File(rootProject.projectDir.absolutePath + '/foray-00-dev/config/checkstyle/checkstyle-config.xml')
+ configProperties.put('foray.root', rootProject.projectDir)
+ toolVersion = versions.checkstyle
+}
+
+
/* Last line of script. */
Modified: trunk/foray/gradle/libs.versions.toml
===================================================================
--- trunk/foray/gradle/libs.versions.toml 2025-06-26 14:40:06 UTC (rev 13875)
+++ trunk/foray/gradle/libs.versions.toml 2025-06-26 15:44:45 UTC (rev 13876)
@@ -25,8 +25,8 @@
icu4j = "72.1" # Latest is 72.1 as of 2022-11-26.
-checkerFramework = "3.49.2" # Latest is 3.49.2 as of 2025-04-20. See Note 7.
-checkerFrameworkGradlePlugin = "0.6.55" # Latest is 0.6.55 as of 2025-06-24. See Note 7.
+checkerFramework = "3.49.2" # Latest is 3.49.2 as of 2025-04-20. See Note 6.
+checkerFrameworkGradlePlugin = "0.6.55" # Latest is 0.6.55 as of 2025-06-24. See Note 6.
autonomousDependencyAnalysis = "2.19.0" # Latest is 2.19.0 as of 2025-06-25.
@@ -40,8 +40,9 @@
#logbackClassic = "1.3.5" # Latest is 1.3.5 as of 2022-11-26.
# Build-time-only dependencies that should never be permanently used in build.gradle files. */
-checkstyle = "10.23" # Latest is 10.25 as of 2025-06-11. See Note 6.
+# checkstyle -- see axsl.common-conventions.gradle, ext.versions
+
# Notes on Dependency Releases (See above for references)
# ========================================================
# 1. Latest release information above is per www.mvnrepository.com, and ignores non-released artifacts (no alpha or
@@ -61,10 +62,7 @@
# Java version used to start Gradle. For now, using a JDK that matches the javaTargetCompatibility value above
# seems to solve the problem.
#
-# 6. The current (as of 2025-06-11) Eclipse plugin for checkstyle uses Checkstyle 10.23.
-# We will use that for now to avoid configuration conflicts between the two versions.
-#
-# 7. The version of the Checker Framework is irrelevant to us.
+# 6. The version of the Checker Framework is irrelevant to us.
# Instead, we use the Gradle Checker Framework Plugin which is a wrapper of, but a separate product from, the
# Checker Framework, having its own release cycle, and its own release numbering system.
# https://github.com/kelloggm/checkerframework-gradle-plugin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-06-26 16:03:26
|
Revision: 13877
http://sourceforge.net/p/foray/code/13877
Author: victormote
Date: 2025-06-26 16:03:23 +0000 (Thu, 26 Jun 2025)
Log Message:
-----------
Fix issues reported by checkstyle.
Modified Paths:
--------------
trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfParserConstants.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java
Added Paths:
-----------
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/package-info.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/package-info.java
Modified: trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2025-06-26 15:44:45 UTC (rev 13876)
+++ trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2025-06-26 16:03:23 UTC (rev 13877)
@@ -43,5 +43,6 @@
<!-- Permanently suppress some checks in data transfer interfaces. -->
<suppress checks="LeftCurly" files="src.main.java.org.foray.fontParse.ttf.handler.*"/>
<suppress checks="LeftCurly" files="src.main.java.org.foray.graphic.handler.*"/>
+ <suppress checks="LeftCurly" files="src.main.java.org.foray.pdf.PdfHandler.java"/>
</suppressions>
Modified: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfParserConstants.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfParserConstants.java 2025-06-26 15:44:45 UTC (rev 13876)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfParserConstants.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -34,7 +34,10 @@
import java.util.Arrays;
import java.util.List;
-public class PdfParserConstants {
+/**
+ * Constants used in PDF files.
+ */
+public final class PdfParserConstants {
/** The standard tokenizer configuration for parsing a PDF. */
public static final ByteSequenceTokenizerConfig STD_TOKENIZER_CONFIG =
@@ -67,4 +70,9 @@
public static final ByteSequenceTokenizerConfig STREAM_TOKENIZER_CONFIG =
new ByteSequenceTokenizerConfig(PDF_STREAM_DELIMITERS, null, null, null);
+ /**
+ * Private constructor. This is a utility class and should not be instantiated.
+ */
+ private PdfParserConstants() { }
+
}
Added: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/package-info.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/package-info.java (rev 0)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/package-info.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 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$
+ */
+
+/**
+ * <p>Classes used to parse PDF documents.</p>
+ */
+
+package org.foray.pdf;
Property changes on: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java 2025-06-26 15:44:45 UTC (rev 13876)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -28,6 +28,9 @@
package org.foray.pdf;
+/**
+ * Handler for events fired by {@link PdfParser}.
+ */
public interface PdfHandler {
default void pdfVersion(final String value) { return; }
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java 2025-06-26 15:44:45 UTC (rev 13876)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -35,6 +35,13 @@
*/
public class PdfParser {
+ /**
+ * Parses a PDF File, firing events reporting the content.
+ * @param input The input to be parsed.
+ * @param offset The offset in {@code input} at which parsing should begin.
+ * @param handler The handler of the events fired by this parser.
+ * @throws IOException For IO errors.
+ */
public void parse(final PdfRandomAccessInput input, final int offset, final PdfHandler handler)
throws IOException {
input.seek(offset);
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java 2025-06-26 15:44:45 UTC (rev 13876)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -66,12 +66,12 @@
}
@Override
- public int lastIndexOf(ByteSequence sequence, int fromIndex) {
+ public int lastIndexOf(final ByteSequence sequence, final int fromIndex) {
return getByteSequence().lastIndexOf(sequence);
}
@Override
- public int indexOf(ByteSequence sequence, int fromIndex) {
+ public int indexOf(final ByteSequence sequence, final int fromIndex) {
return getByteSequence().indexOf(sequence, fromIndex);
}
Added: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/package-info.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/package-info.java (rev 0)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/package-info.java 2025-06-26 16:03:23 UTC (rev 13877)
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2025 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$
+ */
+
+/**
+ * <p>Classes shared by other PDF projects.</p>
+ */
+
+package org.foray.pdf;
Property changes on: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ 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...> - 2025-11-22 21:17:30
|
Revision: 13882
http://sourceforge.net/p/foray/code/13882
Author: victormote
Date: 2025-11-22 21:17:27 +0000 (Sat, 22 Nov 2025)
Log Message:
-----------
Minor improvements to PDF parsing.
Modified Paths:
--------------
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java
trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/util/DumpNamedDestinations.java
Modified: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2025-11-21 23:46:58 UTC (rev 13881)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2025-11-22 21:17:27 UTC (rev 13882)
@@ -100,6 +100,9 @@
/** String used to mark the beginning of the trailer. */
public static final ByteArray TRAILER_MARKER = new ByteArray("trailer");
+ /** String used to mark the offset of the last cross-reference section. */
+ public static final ByteArray START_XREF_MARKER = new ByteArray("startxref");
+
/**
* Comment marker for the beginning of a PDF: "%PDF-".
* @see "PDF Reference, Sixth Edition (PDF version 1.7), Section 3.1.2."
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java 2025-11-21 23:46:58 UTC (rev 13881)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfHandler.java 2025-11-22 21:17:27 UTC (rev 13882)
@@ -34,5 +34,6 @@
public interface PdfHandler {
default void pdfVersion(final String value) { return; }
+ default void startXref(final long value) { return; }
}
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java 2025-11-21 23:46:58 UTC (rev 13881)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfParser.java 2025-11-22 21:17:27 UTC (rev 13882)
@@ -58,10 +58,20 @@
+ /* *** Parse the startxref. *** */
+ input.seek(input.length() - 100);
+ final int startxrefMarker = input.lastIndexOf(PdfConstants.START_XREF_MARKER, input.getOffset());
+ input.seek(startxrefMarker);
+ /* Read the "startxref" line. */
+ input.readLine();
+ /* Read the starxref value. */
+ final long startxref = Long.parseLong(input.readLine());
+ handler.startXref(startxref);
/* *** Parse the Trailer. *** */
-// final int trailerIndex = input.lastIndexOf(PdfConstants.TRAILER_MARKER, 0);
+// input.seek(trailerIndex);
+// handler.trailerOffset(input.getOffset());
// final int trailerDictStart = input.indexOf(PdfConstants.OPEN_DICTIONARY, trailerIndex);
// final int trailerDictEnd = input.indexOf(PdfConstants.CLOSE_DICTIONARY, trailerDictStart) +
// PdfConstants.CLOSE_DICTIONARY.length();
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java 2025-11-21 23:46:58 UTC (rev 13881)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/PdfRandomAccessInput.java 2025-11-22 21:17:27 UTC (rev 13882)
@@ -66,13 +66,16 @@
}
@Override
- public int lastIndexOf(final ByteSequence sequence, final int fromIndex) {
+ public int lastIndexOf(final ByteSequence sequence, final long fromIndex) {
return getByteSequence().lastIndexOf(sequence);
}
@Override
- public int indexOf(final ByteSequence sequence, final int fromIndex) {
- return getByteSequence().indexOf(sequence, fromIndex);
+ public int indexOf(final ByteSequence sequence, final long fromIndex) {
+ if (fromIndex > Integer.MAX_VALUE) {
+ throw new IllegalArgumentException("Offset exceeds max integer value: " + fromIndex);
+ }
+ return getByteSequence().indexOf(sequence, (int) fromIndex);
}
}
@@ -93,7 +96,7 @@
* @return The offset of the occurrence of {@code sequence}.
* @see ByteSequencePlus#indexOf(ByteSequence, int)
*/
- int indexOf(ByteSequence sequence, int fromIndex);
+ int indexOf(ByteSequence sequence, long fromIndex);
/**
* Returns the last index of a given sequence in the content.
@@ -102,7 +105,7 @@
* @return The offset of the last occurrence of {@code sequence}.
* @see ByteSequencePlus#lastIndexOf(ByteSequence, int)
*/
- int lastIndexOf(ByteSequence sequence, int fromIndex);
+ int lastIndexOf(ByteSequence sequence, long fromIndex);
/* Checkstyle: Restart method name checking. */
Modified: trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/util/DumpNamedDestinations.java
===================================================================
--- trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/util/DumpNamedDestinations.java 2025-11-21 23:46:58 UTC (rev 13881)
+++ trunk/foray/foray-pdf-parse/src/main/java/org/foray/pdf/util/DumpNamedDestinations.java 2025-11-22 21:17:27 UTC (rev 13882)
@@ -68,9 +68,13 @@
@Override
public void pdfVersion(final String value) {
this.output.println("PDF version: " + value);
- return;
}
+ @Override
+ public void startXref(final long value) {
+ this.output.println("startxref: " + value);
+ }
+
/**
* Command-line interface.
* @param args The command-line arguments.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|