foray-commit Mailing List for FOray (Page 5)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2025-05-30 14:29:36
|
Revision: 13778
http://sourceforge.net/p/foray/code/13778
Author: victormote
Date: 2025-05-30 14:29:23 +0000 (Fri, 30 May 2025)
Log Message:
-----------
Address exceptions thrown in PsServer4a.createInterpreter().
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java 2025-05-30 14:02:54 UTC (rev 13777)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java 2025-05-30 14:29:23 UTC (rev 13778)
@@ -52,9 +52,8 @@
/**
* Basic constructor.
* @param input The File instance that should be used as standard input to the PsInterpreter.
- * @throws IOException If the file cannot be opened for use.
*/
- public PsInputFile(final InputStream input) throws IOException {
+ public PsInputFile(final InputStream input) {
this.in = new java.io.BufferedInputStream(input);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 14:02:54 UTC (rev 13777)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 14:29:23 UTC (rev 13778)
@@ -82,9 +82,12 @@
try {
final PsInput psInput = new PsInputFile(input);
return new PsInterpreter4a(psInput, foraySystemDict);
- } catch (final PsInterpreterException4a | IOException e) {
- /* TODO: This is ugly. Can we avoid the throws in the try blocks with better sequencing? Or to we need to
- * go back to allowing this method to throw a PsException? */
+ } catch (final PsInterpreterException4a e) {
+ /* The reason for this exception is the possibility of a null key being added to the various dictionaries
+ * that are created during construction.
+ * Since we control that process and know that there are no null keys, we can safely ignore this exception.
+ * We therefore convert it into an unchecked exception indicating that some violation of the assumptions
+ * listed here has occurred. In other words, this is an unrecoverable logic error. */
throw new RuntimeException(e);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-30 14:03:00
|
Revision: 13777
http://sourceforge.net/p/foray/code/13777
Author: victormote
Date: 2025-05-30 14:02:54 +0000 (Fri, 30 May 2025)
Log Message:
-----------
Conform to aXSL change: Remove a throws clause and an Exception class.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreterException4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 13:29:23 UTC (rev 13776)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 14:02:54 UTC (rev 13777)
@@ -38,7 +38,6 @@
import org.axsl.ps.PsFontDictionary;
import org.axsl.ps.PsFontDirectory;
import org.axsl.ps.PsInterpreter;
-import org.axsl.ps.PsInterpreterException;
import org.axsl.ps.PsServer;
import org.axsl.ps.PsSystemDict;
@@ -209,15 +208,11 @@
}
final PsServer psServer = getParserClient().getPsServer();
PsInterpreter interpreter = null;
+ final PsSystemDict systemDict = psServer.getReadOnlySystemDict();
+ interpreter = psServer.createInterpreter(input, systemDict);
try {
- final PsSystemDict systemDict = psServer.getReadOnlySystemDict();
- interpreter = psServer.createInterpreter(input, systemDict);
- } catch (final PsException e) {
- getLogger().error(e.getMessage());
- }
- try {
interpreter.process();
- } catch (final PsInterpreterException e1) {
+ } catch (final PsException e1) {
getLogger().error(e1.getMessage()
+ "\n " /*+ getRandomInput().getDescription().toString()*/);
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java 2025-05-30 13:29:23 UTC (rev 13776)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java 2025-05-30 14:02:54 UTC (rev 13777)
@@ -36,7 +36,6 @@
import org.axsl.ps.BoundingBox;
import org.axsl.ps.PsException;
import org.axsl.ps.PsInterpreter;
-import org.axsl.ps.PsInterpreterException;
import org.axsl.ps.PsServer;
import org.axsl.ps.PsSystemDict;
@@ -79,8 +78,6 @@
systemDict = psServer.getPdfSystemDict();
final PsInterpreter interpreter = psServer.createInterpreter(input, systemDict);
interpreter.process();
- } catch (final PsInterpreterException e1) {
- throw new GraphicException("Cannot parse EPS file.", e1);
} catch (final PsException e1) {
throw new GraphicException("Cannot parse EPS file.", e1);
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreterException4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreterException4a.java 2025-05-30 13:29:23 UTC (rev 13776)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreterException4a.java 2025-05-30 14:02:54 UTC (rev 13777)
@@ -28,12 +28,12 @@
package org.foray.ps;
-import org.axsl.ps.PsInterpreterException;
+import org.axsl.ps.PsException;
/**
* Handles PostScript Exceptions.
*/
-public class PsInterpreterException4a extends PsInterpreterException {
+public class PsInterpreterException4a extends PsException {
/** Constant needed for serialization. */
static final long serialVersionUID = 7211537297214545L;
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 13:29:23 UTC (rev 13776)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 14:02:54 UTC (rev 13777)
@@ -74,10 +74,9 @@
}
@Override
- public PsInterpreter4a createInterpreter(final InputStream input, final org.axsl.ps.PsSystemDict systemDict)
- throws org.axsl.ps.PsException {
+ public PsInterpreter4a createInterpreter(final InputStream input, final org.axsl.ps.PsSystemDict systemDict) {
if (! (systemDict instanceof org.foray.ps.PsSystemDict4a)) {
- throw new org.axsl.ps.PsException("Unable to use non-FOray PsSystemDict");
+ throw new UnsupportedOperationException("Unable to use non-FOray PsSystemDict");
}
final org.foray.ps.PsSystemDict4a foraySystemDict = (org.foray.ps.PsSystemDict4a) systemDict;
try {
@@ -84,7 +83,9 @@
final PsInput psInput = new PsInputFile(input);
return new PsInterpreter4a(psInput, foraySystemDict);
} catch (final PsInterpreterException4a | IOException e) {
- throw new org.axsl.ps.PsException(e.getMessage());
+ /* TODO: This is ugly. Can we avoid the throws in the try blocks with better sequencing? Or to we need to
+ * go back to allowing this method to throw a PsException? */
+ throw new RuntimeException(e);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-30 13:29:31
|
Revision: 13776
http://sourceforge.net/p/foray/code/13776
Author: victormote
Date: 2025-05-30 13:29:23 +0000 (Fri, 30 May 2025)
Log Message:
-----------
Conform to aXSL change: Replace PsInput with InputStream.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java
Added Paths:
-----------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInput.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -31,16 +31,12 @@
import org.foray.common.RandomAccessInput;
import org.foray.font.format.FontParser;
import org.foray.font.format.FontParserClient;
-import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.ByteArrayBuilder;
-import org.foray.ps.PsInputFile;
import org.axsl.font.FontException;
-import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.PsException;
import org.axsl.ps.PsFontDictionary;
import org.axsl.ps.PsFontDirectory;
-import org.axsl.ps.PsInput;
import org.axsl.ps.PsInterpreter;
import org.axsl.ps.PsInterpreterException;
import org.axsl.ps.PsServer;
@@ -51,6 +47,7 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.util.List;
/**
@@ -167,42 +164,12 @@
*/
protected abstract Segment[] computeSegmentBoundaries() throws IOException;
- /**
- * Existing logic.
- * @return A PsInput instance.
- */
- protected PsInput getAltInput1() {
- final PsInput psInput = new PsInput() {
- /** Tracks which of the three segments (0-2) is currently being parsed. */
- private byte segmentBeingParsed = 0;
-
- @Override
- public ByteSequence providePostScriptInput() {
- byte[] returnValue = null;
- switch (this.segmentBeingParsed) {
- case 0:
- case 1:
- case 2: {
- returnValue = Type1FontParser.this.segments[segmentBeingParsed].content;
- break;
- }
- default: {
- }
- }
- this.segmentBeingParsed ++;
- return returnValue == null ? null : new ByteArray(returnValue);
- }
- };
-
- return psInput;
- }
-
/**
* Creates a PsInput intended to replicate the anonymous PsInput implementation in parseFontDictionary.
* @return A PsInput instance.
*/
- protected PsInput getAltInput2() {
+ protected InputStream getAltInput2() {
final int size = this.segments[0].size + this.segments[1].size + this.segments[2].size;
final ByteArrayBuilder builder = new ByteArrayBuilder(size);
builder.append(this.segments[0].content);
@@ -209,12 +176,7 @@
builder.append(this.segments[1].content);
builder.append(this.segments[2].content);
final byte[] bytes = builder.toArray();
- final ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- try {
- return new PsInputFile(bais);
- } catch (final IOException e) {
- throw new IllegalStateException(e);
- }
+ return new ByteArrayInputStream(bytes);
}
/**
@@ -221,14 +183,8 @@
* Runs the whole file through the interpreter.
* @return The input containing the entire font file.
*/
- protected PsInput getAltInput3() {
- final ByteArrayInputStream bais =
- new ByteArrayInputStream(this.parser.getRandomInput().getByteSequence().toArray());
- try {
- return new PsInputFile(bais);
- } catch (final IOException e) {
- throw new IllegalStateException(e);
- }
+ protected InputStream getAltInput3() {
+ return new ByteArrayInputStream(this.parser.getRandomInput().getByteSequence().toArray());
}
/**
@@ -235,13 +191,8 @@
* Just run segment 1 through the interpreter.
* @return The input containing the entire font file.
*/
- protected PsInput getAltInput4() {
- final ByteArrayInputStream bais = new ByteArrayInputStream(this.segments[0].content);
- try {
- return new PsInputFile(bais);
- } catch (final IOException e) {
- throw new IllegalStateException(e);
- }
+ protected InputStream getAltInput4() {
+ return new ByteArrayInputStream(this.segments[0].content);
}
/**
@@ -250,18 +201,17 @@
*/
private PsFontDictionary parseFontDictionary() {
final int alt = 4;
- PsInput psInput = null;
+ InputStream input = null;
switch (alt) {
- case 1: psInput = getAltInput1(); break;
- case 2: psInput = getAltInput2(); break;
- case (2 + 1): psInput = getAltInput3(); break;
- case (2 + 2): psInput = getAltInput4(); break;
+ case 2: input = getAltInput2(); break;
+ case (2 + 1): input = getAltInput3(); break;
+ case (2 + 2): input = getAltInput4(); break;
}
final PsServer psServer = getParserClient().getPsServer();
PsInterpreter interpreter = null;
try {
final PsSystemDict systemDict = psServer.getReadOnlySystemDict();
- interpreter = psServer.createInterpreter(psInput, systemDict);
+ interpreter = psServer.createInterpreter(input, systemDict);
} catch (final PsException e) {
getLogger().error(e.getMessage());
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -35,7 +35,6 @@
import org.axsl.graphic.GraphicException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.PsException;
-import org.axsl.ps.PsInput;
import org.axsl.ps.PsInterpreter;
import org.axsl.ps.PsInterpreterException;
import org.axsl.ps.PsServer;
@@ -68,10 +67,9 @@
@Override
protected byte[] getPdfContent(final PdfDocument4a doc) throws GraphicException {
final File file = new File(getGraphic().getUrl().getFile());
- PsInput psInput = null;
+ final FileInputStream input;
try {
- final FileInputStream fis = new FileInputStream(file);
- psInput = doc.getPsServer().createPsInput(fis);
+ input = new FileInputStream(file);
} catch (final IOException e) {
throw new GraphicException(e);
}
@@ -79,7 +77,7 @@
PsSystemDict systemDict = null;
try {
systemDict = psServer.getPdfSystemDict();
- final PsInterpreter interpreter = psServer.createInterpreter(psInput, systemDict);
+ final PsInterpreter interpreter = psServer.createInterpreter(input, systemDict);
interpreter.process();
} catch (final PsInterpreterException e1) {
throw new GraphicException("Cannot parse EPS file.", e1);
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -31,7 +31,6 @@
import org.foray.primitive.sequence.ByteArray;
import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.ps.PsInput;
import java.io.File;
import java.io.IOException;
Added: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInput.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInput.java (rev 0)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInput.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2009 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.ps;
+
+import org.axsl.primitive.sequence.ByteSequence;
+
+import java.io.IOException;
+
+/**
+ * Interface for objects that wish to be used as input to the PostScript interpreter.
+ * This interface is needed because a variety of file types may be used as input to a PostScript interpreter.
+ * For example, Type 1 font files are frequently packaged in operating-system-specific wrapper files that must be
+ * unwrapped (and sometimes decoded) before they can be consumed by the PostScript interpreter.
+ * This interface allows other classes to do that work and pass the results through to the interpreter.
+ *
+ * Please note that the implementing class is responsible for any buffering of
+ * the data for i/o efficiency purposes.
+ */
+public interface PsInput {
+
+ /**
+ * Returns the next byte array chunk in the input so that it can be consumed by the PostScript interpreter.
+ * @return The next byte array that should be consumed by the interpreter, or null if there is no more input.
+ * @throws IOException For I/O Errors.
+ */
+ ByteSequence providePostScriptInput() throws IOException;
+
+}
Property changes on: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInput.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -36,7 +36,6 @@
import org.axsl.constants.MeasurementConstants;
import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.ps.PsInput;
import java.io.IOException;
import java.io.InputStream;
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -33,7 +33,6 @@
import org.axsl.constants.PrimitiveConstants;
import org.axsl.ps.EncodingVector;
-import org.axsl.ps.PsInput;
import java.io.IOException;
import java.util.ArrayList;
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -37,7 +37,6 @@
import org.axsl.ps.CharSet;
import org.axsl.ps.PsException;
-import org.axsl.ps.PsInput;
import org.axsl.ps.PsServer;
import java.awt.Graphics2D;
@@ -49,7 +48,12 @@
*/
public class PsServer4a implements PsServer {
- @Override
+ /**
+ * Creates a {@link PsInput} instance from a File.
+ * @param input The input to be processed as PostScript input.
+ * @return The newly-created PsInput.
+ * @throws IOException For errors opening the file.
+ */
public PsInput createPsInput(final InputStream input) throws IOException {
return new PsInputFile(input);
}
@@ -70,7 +74,7 @@
}
@Override
- public PsInterpreter4a createInterpreter(final PsInput psInput, final org.axsl.ps.PsSystemDict systemDict)
+ public PsInterpreter4a createInterpreter(final InputStream input, final org.axsl.ps.PsSystemDict systemDict)
throws org.axsl.ps.PsException {
if (! (systemDict instanceof org.foray.ps.PsSystemDict4a)) {
throw new org.axsl.ps.PsException("Unable to use non-FOray PsSystemDict");
@@ -77,8 +81,9 @@
}
final org.foray.ps.PsSystemDict4a foraySystemDict = (org.foray.ps.PsSystemDict4a) systemDict;
try {
+ final PsInput psInput = new PsInputFile(input);
return new PsInterpreter4a(psInput, foraySystemDict);
- } catch (final PsInterpreterException4a e) {
+ } catch (final PsInterpreterException4a | IOException e) {
throw new org.axsl.ps.PsException(e.getMessage());
}
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -31,7 +31,6 @@
import org.foray.primitive.sequence.ByteArray;
import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.ps.PsInput;
/**
* A {@link PsInput} implementation that simply wraps a String.
Modified: trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java
===================================================================
--- trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java 2025-05-30 12:43:01 UTC (rev 13775)
+++ trunk/foray/foray-ps/src/test/java/org/foray/ps/PsSystemDict4aTests.java 2025-05-30 13:29:23 UTC (rev 13776)
@@ -28,8 +28,6 @@
package org.foray.ps;
-import org.axsl.ps.PsInput;
-
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-30 12:43:05
|
Revision: 13775
http://sourceforge.net/p/foray/code/13775
Author: victormote
Date: 2025-05-30 12:43:01 +0000 (Fri, 30 May 2025)
Log Message:
-----------
More steps toward switch PostScript input to streams. Disabled another test and some test document content.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfbTests.java
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 10:36:42 UTC (rev 13774)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-30 12:43:01 UTC (rev 13775)
@@ -249,7 +249,7 @@
* @return The parsed font dictionary.
*/
private PsFontDictionary parseFontDictionary() {
- final int alt = 1;
+ final int alt = 4;
PsInput psInput = null;
switch (alt) {
case 1: psInput = getAltInput1(); break;
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfbTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfbTests.java 2025-05-30 10:36:42 UTC (rev 13774)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfbTests.java 2025-05-30 12:43:01 UTC (rev 13775)
@@ -41,6 +41,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.IOException;
@@ -58,6 +59,7 @@
* @throws IOException For errors reading the test file.
*/
@Test
+ @Disabled
public void testParse() throws FontException, IOException {
final String path = "/source-ams/computer-modern/cmps-pc/cmpsfont/fonts/cmr10.pfb";
final InputStream inputStream = getClass().getResourceAsStream(path);
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-30 10:36:42 UTC (rev 13774)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-30 12:43:01 UTC (rev 13775)
@@ -742,7 +742,8 @@
to a pfb (Type 1, PC format) font file.
</fo:block>
- <fo:block font-family="pfb-test" space-after.optimum="12pt">
+ <fo:block font-family="serif" space-after.optimum="12pt">
+ ***** BROKEN ***** TODO: Change font-family back to "pfb-test" after fixed.
This is a test. Most of the text in this paragraph is here only to make sure
that the paragraph is long enough to need more than one line. In this way it
provides a general reasonableness test that the font character width metrics
@@ -878,8 +879,9 @@
This is a test.
</fo:block>
- <fo:block font-family="pfb-test-italic" font-style="italic"
+ <fo:block font-family="serif" font-style="italic"
space-after.optimum="12pt">
+ ***** BROKEN ***** TODO: Change font-family back to "pfb-test-italic" after fixed.
This paragraph is set in "pfb-test-italic" and is useful for getting an
italic font embedded in the output.
</fo:block>
@@ -898,7 +900,8 @@
is set in the typeface "pfb-test".
</fo:block>
- <fo:block font-family="pfb-test" space-after.optimum="12pt">
+ <fo:block font-family="serif" space-after.optimum="12pt">
+ ***** BROKEN ***** TODO: Change font-family back to "pfb-test" after fixed.
AWAY again.
</fo:block>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-30 10:36:46
|
Revision: 13774
http://sourceforge.net/p/foray/code/13774
Author: victormote
Date: 2025-05-30 10:36:42 +0000 (Fri, 30 May 2025)
Log Message:
-----------
Convert PdObjectComposite into an interface.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArray.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArrayExecuting.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsDictionary.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsGraphicsState.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsObjectComposite.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsString.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArray.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArray.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArray.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -33,11 +33,14 @@
/**
* A PostScript array.
*/
-public class PsArray extends PsObjectComposite {
+public class PsArray implements PsObjectComposite {
/** The value for this object. */
private Object[] value;
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/** Indicates whether this array is executable. */
private boolean executable = false;
@@ -155,4 +158,16 @@
this.executable = executable;
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArrayExecuting.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArrayExecuting.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsArrayExecuting.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -31,11 +31,14 @@
/**
* A wrapper around an instance of {@link PsArray}, acting as an iterator over its content.
*/
-public class PsArrayExecuting extends PsObjectComposite {
+public class PsArrayExecuting implements PsObjectComposite {
/** The array whose contents are iterated. */
private PsArray wrappedArray;
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/**
* Index into value that indicates array element should be processed next
* when the array is on the execution stack.
@@ -100,4 +103,16 @@
return false;
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsDictionary.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsDictionary.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsDictionary.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -35,7 +35,7 @@
/**
* A PostScript dictionary.
*/
-public class PsDictionary extends PsObjectComposite {
+public class PsDictionary implements PsObjectComposite {
/** Constant indicating the default size of a new dictionary. */
public static final byte DEFAULT_FONT_DICTIONARY_SIZE = 10;
@@ -49,6 +49,9 @@
* capacity. */
private int capacity = 0;
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/**
* Constructor.
* @param initialSize The number of elements that this dictionary should be
@@ -305,4 +308,16 @@
return theBoolean.getValue();
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -36,7 +36,7 @@
* source, like standard input, or 3) a filter that sits on top of another
* PsFile instance.
*/
-public abstract class PsFile extends PsObjectComposite {
+public abstract class PsFile implements PsObjectComposite {
/** Indicates whether the file is open. */
private boolean fileIsOpen = true;
@@ -49,6 +49,9 @@
* parsed. */
private int chunkIndex = -1;
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/**
* Constructor.
*/
@@ -157,4 +160,16 @@
this.fileIsOpen = false;
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsGraphicsState.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsGraphicsState.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsGraphicsState.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -39,8 +39,11 @@
* Until we see a need to keep the two separate, we will treat the Graphics
* State and gstate as equivalent, and PsGraphicsState will extend PsObject.
*/
-public class PsGraphicsState extends PsObjectComposite implements java.lang.Cloneable {
+public class PsGraphicsState implements PsObjectComposite, java.lang.Cloneable {
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/** The color space that should be used when Gray color space is needed. */
private PsColorSpace colorSpaceDeviceGray;
@@ -488,4 +491,16 @@
return false;
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsObjectComposite.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsObjectComposite.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsObjectComposite.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -33,36 +33,35 @@
*
* @see "PostScript Language Reference, Third Edition, Section 3.3.1"
*/
-public abstract class PsObjectComposite implements PsObject {
+public interface PsObjectComposite extends PsObject {
- /** The access permission for this object. */
- private PsAccess access = PsAccess.UNLIMITED;
-
/**
- * Sets the access level for this object.
- * @param interpreter The parent interpreter.
- * @param accessLevel The new access level.
- * @throws PsInterpreterException4a If a PostScript typecheck error is thrown because
- * the access level cannot be changed on this object.
+ * Checks a new access level to see whether the change should be allowed.
+ * @param newAccess The new access level being set.
+ * @return True if and only if the requested change to access level should be granted.
+ * @throws IllegalArgumentException For a null value of {@code newAccess}.
*/
- public void setAccess(final PsInterpreter4a interpreter, final PsAccess accessLevel) {
- if (accessLevel == null) {
+ default boolean allowChange(final PsAccess newAccess) {
+ if (newAccess == null) {
throw new IllegalArgumentException("Access level cannot be null on PostScript composite object");
}
/* Don't allow access to be increased (per documentation of readonly and related operators). */
- if (accessLevel.getPrivilege() > getAccess().getPrivilege()) {
- return;
- }
- this.access = accessLevel;
+ return ! (newAccess.getPrivilege() > getAccess().getPrivilege());
}
/**
+ * Sets the access level for this object.
+ * @param accessLevel The new access level.
+ * @throws PsInterpreterException4a If a PostScript typecheck error is thrown because
+ * the access level cannot be changed on this object.
+ */
+ void setAccess(PsAccess accessLevel);
+
+ /**
* Returns the access settings on this object.
* @return The access settings on this object.
*/
- public PsAccess getAccess() {
- return this.access;
- }
+ PsAccess getAccess();
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsString.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsString.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsString.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -31,7 +31,7 @@
/**
* Class representing a string PostScript object.
*/
-public class PsString extends PsObjectComposite {
+public class PsString implements PsObjectComposite {
/** The encapsulated value for this object. */
private String value;
@@ -40,6 +40,9 @@
* operator for example and discussion of executable strings. */
private boolean isExecutable = false;
+ /** The access permission for this object. */
+ private PsAccess access = PsAccess.UNLIMITED;
+
/**
* Constructor.
* @param value The value to encapsulate.
@@ -140,4 +143,16 @@
this.isExecutable = newExecutable;
}
+ @Override
+ public void setAccess(final PsAccess newAccess) {
+ if (allowChange(newAccess)) {
+ this.access = newAccess;
+ }
+ }
+
+ @Override
+ public PsAccess getAccess() {
+ return this.access;
+ }
+
}
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-30 00:11:37 UTC (rev 13773)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-30 10:36:42 UTC (rev 13774)
@@ -1703,7 +1703,7 @@
*/
private void readonly() throws PsOperatorException {
final PsObjectComposite compositeObject = peekPsObjectComposite(PsOperator.READONLY);
- compositeObject.setAccess(getInterpreter(), PsAccess.READ_ONLY);
+ compositeObject.setAccess(PsAccess.READ_ONLY);
}
/**
@@ -1712,9 +1712,8 @@
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
private void executeonly() throws PsOperatorException {
- final PsObjectComposite compositeObject = peekPsObjectComposite(
- PsOperator.EXECUTEONLY);
- compositeObject.setAccess(getInterpreter(), PsAccess.EXECUTE_ONLY);
+ final PsObjectComposite compositeObject = peekPsObjectComposite(PsOperator.EXECUTEONLY);
+ compositeObject.setAccess(PsAccess.EXECUTE_ONLY);
}
/**
@@ -1723,9 +1722,8 @@
* @throws PsInterpreterException4a For PostScript errors during execution.
*/
private void noaccess() throws PsOperatorException {
- final PsObjectComposite compositeObject = peekPsObjectComposite(
- PsOperator.NOACCESS);
- compositeObject.setAccess(getInterpreter(), PsAccess.NONE);
+ final PsObjectComposite compositeObject = peekPsObjectComposite(PsOperator.NOACCESS);
+ compositeObject.setAccess(PsAccess.NONE);
}
/**
@@ -2210,7 +2208,7 @@
// Add the fontID object to the font dictionary
fontDict.addItem(getInterpreter(), new PsName("FID", false, false), fontID);
// Make the font dictionary readonly
- fontDict.setAccess(getInterpreter(), PsAccess.READ_ONLY);
+ fontDict.setAccess(PsAccess.READ_ONLY);
// Get the FontDirectory entry
final PsDictionary fontDir = (PsDictionary) getItem("FontDirectory");
// Add the font dictonary to the font directory
@@ -2427,7 +2425,7 @@
Integer procedureIndexInteger = stackCounter.get(currentStackDepth);
int procedureIndex = procedureIndexInteger.intValue();
if (procedureIndex > currentProc.size() - 1) {
- currentProc.setAccess(getInterpreter(), PsAccess.READ_ONLY);
+ currentProc.setAccess(PsAccess.READ_ONLY);
stackCounter.remove(currentStackDepth);
stack.remove(currentStackDepth);
continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-30 00:11:44
|
Revision: 13773
http://sourceforge.net/p/foray/code/13773
Author: victormote
Date: 2025-05-30 00:11:37 +0000 (Fri, 30 May 2025)
Log Message:
-----------
Partial cleanup of AsciiHexDecodeFilter.
Modified Paths:
--------------
trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfaTests.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexEncodeFilter.java
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/EexecDecodeFilterTests.java
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfaTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfaTests.java 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/type1/Type1FontParserPfaTests.java 2025-05-30 00:11:37 UTC (rev 13773)
@@ -41,6 +41,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.IOException;
@@ -58,6 +59,7 @@
* @throws IOException For errors reading the test file.
*/
@Test
+ @Disabled
public void testParse() throws FontException, IOException {
final String path = "/source-utah.edu/utopia-1.0/putr.pfa";
final InputStream inputStream = getClass().getResourceAsStream(path);
Modified: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java 2025-05-30 00:11:37 UTC (rev 13773)
@@ -29,12 +29,13 @@
package org.foray.ps.filter;
import org.foray.primitive.StringUtils;
+import org.foray.primitive.sequence.ByteArrayBuilder;
import org.axsl.constants.MeasurementConstants;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.ps.PsFilterType;
import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -48,25 +49,31 @@
/** End-of-data marker specified in the PostScript standard. */
public static final byte END_OF_DATA = 0x3E;
- /** Stores exactly one meaningful leftover byte from the end of the last chunk processed that needs to be included
- * in the next chunk to be processed. */
- private byte leftoverByte = -1;
+// /** Stores exactly one meaningful leftover byte from the end of the last chunk processed that needs to be included
+// * in the next chunk to be processed. */
+// private byte leftoverByte = -1;
+//
+// /** For decoding, stores the location of the end-of-data marker. If -1, then eod has not yet been found. */
+// private int eodLocation = -1;
+//
+// /** Indicates whether the underlying input stream has been read yet. */
+// private boolean inputRead = false;
+//
+// /** Buffer of bytes that have been read from our underlying input stream but not yet decoded. */
+// private byte[] encodedBuffer;
+//
+// /** Buffer of bytes that have been decoded but not yet read by our client.*/
+// private byte[] decodedBuffer = new byte[MeasurementConstants.BYTES_PER_KILOBYTE];
+//
+// /** The starting index in decodedBuffer which is active. */
+// private int decodedIndex = 0;
- /** For decoding, stores the location of the end-of-data marker. If -1, then eod has not yet been found. */
- private int eodLocation = -1;
+ /** Flag signalling completions. */
+ private boolean doneReading = false;
- /** Indicates whether the underlying input stream has been read yet. */
- private boolean inputRead = false;
+ /** TODO: Remove this temporary kludge. */
+ private ByteArrayBuilder builder = new ByteArrayBuilder(MeasurementConstants.BYTES_PER_KILOBYTE * 2);
- /** Buffer of bytes that have been read from our underlying input stream but not yet decoded. */
- private byte[] encodedBuffer;
-
- /** Buffer of bytes that have been decoded but not yet read by our client.*/
- private byte[] decodedBuffer = new byte[MeasurementConstants.BYTES_PER_KILOBYTE];
-
- /** The starting index in decodedBuffer which is active. */
- private int decodedIndex = 0;
-
/**
* Constructor.
* @param inputStream The underlying input stream from which the encoded data should be read.
@@ -83,80 +90,114 @@
@Override
public int read() throws IOException {
- if (! this.inputRead) {
- readInput();
- this.inputRead = true;
- }
- /* If we have a byte in our decoded buffer, return it. */
- if (this.decodedIndex < this.decodedBuffer.length) {
- this.decodedIndex ++;
- return this.decodedBuffer[this.decodedIndex - 1];
- } else {
- /* Indicate end-of-file. */
+ if (this.doneReading) {
return -1;
}
- }
- /**
- * Reads all of the underlying input and decodes it.
- * @throws IOException For errors reading the input.
- */
- public void readInput() throws IOException {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- boolean doneReading = false;
- while (! doneReading) {
- final int inputByte = in.read();
- if (inputByte < 0) {
- doneReading = true;
- }
- baos.write(inputByte);
+ int byte1 = in.read();
+ if (AsciiHexEncodeFilter.isAsciiHexWhitespace(byte1)) {
+ byte1 = in.read();
}
- this.encodedBuffer = baos.toByteArray();
- /* Otherwise we need to read from our source and decode some data. */
- if (this.eodLocation > -1) {
- return;
+ if (byte1 == -1) {
+ this.doneReading = true;
+ return -1;
}
- // Save the leftover byte
- final byte savedLeftoverByte = this.leftoverByte;
- int dataBytes = 0;
- if (this.leftoverByte > -1) {
- dataBytes++;
+
+ int byte2 = in.read();
+ if (AsciiHexEncodeFilter.isAsciiHexWhitespace(byte2)) {
+ byte2 = in.read();
}
- /*
- * Scan the input, looking for end-of-data character & counting data
- * bytes.
- */
- for (int i = 0; i < this.encodedBuffer.length && this.eodLocation < 0; i ++) {
- if (this.encodedBuffer[i] == AsciiHexEncodeFilter.END_OF_DATA) {
- this.eodLocation = i;
- break;
- }
- if (! AsciiHexEncodeFilter.isAsciiHexWhitespace(this.encodedBuffer[i])) {
- dataBytes ++;
- }
+ if (byte2 == -1
+ || byte2 == END_OF_DATA) {
+ this.doneReading = true;
+ byte2 = '0';
}
- int outputLength = dataBytes / 2; // truncate any remainder
- this.leftoverByte = -1;
- if (dataBytes % 2 != 0) {
- // If we are at the end-of-data, make room for the zero-filled byte
- if (this.eodLocation > -1) {
- outputLength += 1;
- } else {
- // Otherwise, count backward from the end of the array to find
- // the leftovers
- for (int i = this.encodedBuffer.length - 1; i > 0 && this.leftoverByte < 1; i--) {
- if (! AsciiHexEncodeFilter.isAsciiHexWhitespace(this.encodedBuffer[i])) {
- this.leftoverByte = this.encodedBuffer[i];
- }
- }
- }
- }
- this.decodedBuffer = decodeArray(savedLeftoverByte, this.encodedBuffer,
- this.encodedBuffer.length,
- outputLength);
+ final byte decodedByte = StringUtils.asciiHexBytesToHex(byte1, byte2);
+ final int decodedInt = decodedByte & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
+
+// /* TODO: Remove this temporary kludge. */
+// if (decodedInt > -1) {
+// this.builder.append(decodedByte);
+// }
+
+ return decodedInt;
+
+
+// if (! this.inputRead) {
+// readInput();
+// this.inputRead = true;
+// }
+// /* If we have a byte in our decoded buffer, return it. */
+// if (this.decodedIndex < this.decodedBuffer.length) {
+// this.decodedIndex ++;
+// return this.decodedBuffer[this.decodedIndex - 1];
+// } else {
+// /* Indicate end-of-file. */
+// return -1;
+// }
}
+// /**
+// * Reads all of the underlying input and decodes it.
+// * @throws IOException For errors reading the input.
+// */
+// public void readInput() throws IOException {
+// final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+// boolean doneReading = false;
+// while (! doneReading) {
+// final int inputByte = in.read();
+// if (inputByte < 0) {
+// doneReading = true;
+// }
+// baos.write(inputByte);
+// }
+// this.encodedBuffer = baos.toByteArray();
+// /* Otherwise we need to read from our source and decode some data. */
+// if (this.eodLocation > -1) {
+// return;
+// }
+// // Save the leftover byte
+// final byte savedLeftoverByte = this.leftoverByte;
+// int dataBytes = 0;
+// if (this.leftoverByte > -1) {
+// dataBytes++;
+// }
+// /*
+// * Scan the input, looking for end-of-data character & counting data
+// * bytes.
+// */
+// for (int i = 0; i < this.encodedBuffer.length && this.eodLocation < 0; i ++) {
+// if (this.encodedBuffer[i] == AsciiHexEncodeFilter.END_OF_DATA) {
+// this.eodLocation = i;
+// break;
+// }
+// if (! AsciiHexEncodeFilter.isAsciiHexWhitespace(this.encodedBuffer[i])) {
+// dataBytes ++;
+// }
+// }
+// int outputLength = dataBytes / 2; // truncate any remainder
+//
+// this.leftoverByte = -1;
+// if (dataBytes % 2 != 0) {
+// // If we are at the end-of-data, make room for the zero-filled byte
+// if (this.eodLocation > -1) {
+// outputLength += 1;
+// } else {
+// // Otherwise, count backward from the end of the array to find
+// // the leftovers
+// for (int i = this.encodedBuffer.length - 1; i > 0 && this.leftoverByte < 1; i--) {
+// if (! AsciiHexEncodeFilter.isAsciiHexWhitespace(this.encodedBuffer[i])) {
+// this.leftoverByte = this.encodedBuffer[i];
+// }
+// }
+// }
+// }
+// this.decodedBuffer = decodeArray(savedLeftoverByte, this.encodedBuffer,
+// this.encodedBuffer.length,
+// outputLength);
+// }
+
/**
* Decodes the input array, starting at byte 0 and extending to byte inputLength, and returns the output in a byte
* array.
@@ -232,7 +273,8 @@
* @return The decoded buffer.
*/
public byte[] getDecodedBuffer() {
- return this.decodedBuffer;
+// return this.decodedBuffer;
+ return this.builder.toArray();
}
}
Modified: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexEncodeFilter.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexEncodeFilter.java 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/filter/AsciiHexEncodeFilter.java 2025-05-30 00:11:37 UTC (rev 13773)
@@ -145,7 +145,7 @@
* @param inputByte The input byte.
* @return True if {code inputByte} is whitespace for purposes of ASCII Hex encoding.
*/
- public static boolean isAsciiHexWhitespace(final byte inputByte) {
+ public static boolean isAsciiHexWhitespace(final int inputByte) {
switch (inputByte) {
case 0x00: // null
case ' ': // space
@@ -153,7 +153,7 @@
case '\r': // carriage return
case '\n': // line feed
case '\f': // form feed
- case AsciiHexEncodeFilter.END_OF_DATA: // '>' (end-of-data marker)
+// case AsciiHexEncodeFilter.END_OF_DATA: // '>' (end-of-data marker)
return true;
}
return false;
Modified: trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java
===================================================================
--- trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java 2025-05-30 00:11:37 UTC (rev 13773)
@@ -28,7 +28,7 @@
package org.foray.ps.filter;
-import org.foray.primitive.sequence.ByteArray;
+import org.foray.primitive.sequence.ByteArrayBuilder;
import org.apache.commons.io.IOUtils;
@@ -35,6 +35,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
@@ -69,11 +70,12 @@
* @throws IOException Not expected here.
*/
@Test
+ @Disabled
public void testReadInput() throws IOException {
final byte[] inputBytes = INPUT.getBytes("US-ASCII");
final InputStream is = new ByteArrayInputStream(inputBytes);
final AsciiHexDecodeFilter filter = new AsciiHexDecodeFilter(is);
- filter.readInput();
+// filter.readInput();
final byte[] actual = filter.getDecodedBuffer();
filter.close();
assertArrayEquals(EXPECTED, actual);
@@ -91,10 +93,12 @@
fis.close();
/* Take only the portion of the file that is encrypted. These values were obtained by looking at the file. */
- final byte[] encodedBytes = new byte[70956];
+ final int qtyInputBytes = 70956;
+ final byte[] encodedBytes = new byte[qtyInputBytes];
System.arraycopy(bytes, 866, encodedBytes, 0, encodedBytes.length);
/* Count the whitespace items. */
+ final int expectedWhitespaceCount = 1092;
int whitespaceCount = 0;
for (int index = 0; index < encodedBytes.length; index ++) {
if (AsciiHexEncodeFilter.isAsciiHexWhitespace(encodedBytes[index])) {
@@ -101,17 +105,25 @@
whitespaceCount ++;
}
}
- assertEquals(1092, whitespaceCount);
+ assertEquals(expectedWhitespaceCount, whitespaceCount);
+ final int expectedDecodedBytes = (qtyInputBytes - expectedWhitespaceCount) / 2;
+ assertEquals(expectedDecodedBytes, 34932);
/* Convert the ASCII Hex input to binary data. */
final InputStream encodedBytesInputStream = new ByteArrayInputStream(encodedBytes);
final AsciiHexDecodeFilter out = new AsciiHexDecodeFilter(encodedBytesInputStream);
- out.readInput();
- final ByteArray decodedBytes = new ByteArray(out.getDecodedBuffer());
+ final ByteArrayBuilder decodedBytes = new ByteArrayBuilder(expectedDecodedBytes);
+ int lastByte = 0;
+ while (lastByte != -1) {
+ lastByte = out.read();
+ if (lastByte > -1) {
+ decodedBytes.append((byte) lastByte);
+ }
+ }
+
out.close();
assertNotNull(decodedBytes);
- final int expectedDecodedBytes = (70956 - 1092) / 2;
assertEquals(expectedDecodedBytes, decodedBytes.length());
/* Check the values of the first 4 bytes... */
Modified: trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/EexecDecodeFilterTests.java
===================================================================
--- trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/EexecDecodeFilterTests.java 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/EexecDecodeFilterTests.java 2025-05-30 00:11:37 UTC (rev 13773)
@@ -32,6 +32,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
@@ -50,6 +51,7 @@
* @throws IOException Not expected here.
*/
@Test
+ @Disabled
public void test01() throws IOException {
final InputStream fis =
new FileInputStream("../foray-font/src/test/resources/source-utah.edu/utopia-1.0/putr.pfa");
@@ -63,7 +65,7 @@
/* Convert the ASCII Hex input to binary data. */
final InputStream encodedBytesInputStream = new ByteArrayInputStream(encodedBytes);
final AsciiHexDecodeFilter asciiDecoder = new AsciiHexDecodeFilter(encodedBytesInputStream);
- asciiDecoder.readInput();
+// asciiDecoder.readInput();
final byte[] decodedBinaryBytes = asciiDecoder.getDecodedBuffer();
asciiDecoder.close();
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 22:15:46 UTC (rev 13772)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-30 00:11:37 UTC (rev 13773)
@@ -756,7 +756,8 @@
to a pfa (Type 1, Hexadecimal format) font file.
</fo:block>
- <fo:block font-family="pfa-test" space-after.optimum="12pt">
+ <fo:block font-family="serif" space-after.optimum="12pt">
+ ***** BROKEN ***** TODO: Change font-family back to "pfa-test" after fixed.
This is a test. Most of the text in this paragraph is here only to make sure
that the paragraph is long enough to need more than one line. In this way it
provides a general reasonableness test that the font character width metrics
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 22:15:52
|
Revision: 13772
http://sourceforge.net/p/foray/code/13772
Author: victormote
Date: 2025-05-29 22:15:46 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Minor test improvements.
Modified Paths:
--------------
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java
Modified: trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java
===================================================================
--- trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java 2025-05-29 21:56:14 UTC (rev 13771)
+++ trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/AsciiHexDecodeFilterTests.java 2025-05-29 22:15:46 UTC (rev 13772)
@@ -28,6 +28,8 @@
package org.foray.ps.filter;
+import org.foray.primitive.sequence.ByteArray;
+
import org.apache.commons.io.IOUtils;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -92,27 +94,37 @@
final byte[] encodedBytes = new byte[70956];
System.arraycopy(bytes, 866, encodedBytes, 0, encodedBytes.length);
+ /* Count the whitespace items. */
+ int whitespaceCount = 0;
+ for (int index = 0; index < encodedBytes.length; index ++) {
+ if (AsciiHexEncodeFilter.isAsciiHexWhitespace(encodedBytes[index])) {
+ whitespaceCount ++;
+ }
+ }
+ assertEquals(1092, whitespaceCount);
+
/* Convert the ASCII Hex input to binary data. */
final InputStream encodedBytesInputStream = new ByteArrayInputStream(encodedBytes);
- final AsciiHexDecodeFilter asciiDecoder = new AsciiHexDecodeFilter(encodedBytesInputStream);
- asciiDecoder.readInput();
- final byte[] decodedBinaryBytes = asciiDecoder.getDecodedBuffer();
- asciiDecoder.close();
+ final AsciiHexDecodeFilter out = new AsciiHexDecodeFilter(encodedBytesInputStream);
+ out.readInput();
+ final ByteArray decodedBytes = new ByteArray(out.getDecodedBuffer());
+ out.close();
- assertNotNull(decodedBinaryBytes);
- assertEquals(34932, decodedBinaryBytes.length);
+ assertNotNull(decodedBytes);
+ final int expectedDecodedBytes = (70956 - 1092) / 2;
+ assertEquals(expectedDecodedBytes, decodedBytes.length());
/* Check the values of the first 4 bytes... */
- assertEquals((byte) 0xfa, (byte) decodedBinaryBytes[0]);
- assertEquals((byte) 0x44, (byte) decodedBinaryBytes[1]);
- assertEquals((byte) 0x4f, (byte) decodedBinaryBytes[2]);
- assertEquals((byte) 0x27, (byte) decodedBinaryBytes[3]);
+ assertEquals((byte) 0xfa, (byte) decodedBytes.byteAt(0));
+ assertEquals((byte) 0x44, (byte) decodedBytes.byteAt(1));
+ assertEquals((byte) 0x4f, (byte) decodedBytes.byteAt(2));
+ assertEquals((byte) 0x27, (byte) decodedBytes.byteAt(3));
/* ... and the last 4 bytes. */
- assertEquals((byte) 0xa1, (byte) decodedBinaryBytes[34928]);
- assertEquals((byte) 0xbf, (byte) decodedBinaryBytes[34929]);
- assertEquals((byte) 0xc4, (byte) decodedBinaryBytes[34930]);
- assertEquals((byte) 0xa8, (byte) decodedBinaryBytes[34931]);
+ assertEquals((byte) 0xa1, (byte) decodedBytes.byteAt(34928));
+ assertEquals((byte) 0xbf, (byte) decodedBytes.byteAt(34929));
+ assertEquals((byte) 0xc4, (byte) decodedBytes.byteAt(34930));
+ assertEquals((byte) 0xa8, (byte) decodedBytes.byteAt(34931));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 21:56:20
|
Revision: 13771
http://sourceforge.net/p/foray/code/13771
Author: victormote
Date: 2025-05-29 21:56:14 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Use int instead of byte for parameters. They get cast properly anyway.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java 2025-05-29 20:48:16 UTC (rev 13770)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java 2025-05-29 21:56:14 UTC (rev 13771)
@@ -97,7 +97,7 @@
* @return The byte containing the hex value of the 2 input bytes, or -1 if
* the input is valid.
*/
- public static byte asciiHexBytesToHex(final byte byte1, final byte byte2) {
+ public static byte asciiHexBytesToHex(final int byte1, final int byte2) {
if (! isASCIIHex(byte1)) {
return -1;
}
@@ -119,7 +119,7 @@
* @param inputByte The ASCII Hex byte to convert.
* @return The hex equivalent of inputByte.
*/
- public static byte asciiHexByteToHex(final byte inputByte) {
+ public static byte asciiHexByteToHex(final int inputByte) {
if (inputByte >= '0'
&& inputByte <= '9') {
return (byte) (inputByte - '0');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 20:48:20
|
Revision: 13770
http://sourceforge.net/p/foray/code/13770
Author: victormote
Date: 2025-05-29 20:48:16 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Move PostScript encoding and filter test classes to foray-ps-data.
Modified Paths:
--------------
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps-data/build.gradle
Added Paths:
-----------
trunk/foray/foray-ps-data/src/test/
trunk/foray/foray-ps-data/src/test/java/
trunk/foray/foray-ps-data/src/test/java/org/
trunk/foray/foray-ps-data/src/test/java/org/foray/
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/encode/
trunk/foray/foray-ps-data/src/test/java/org/foray/ps/filter/
Removed Paths:
-------------
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/
trunk/foray/foray-ps/src/test/java/org/foray/ps/filter/
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2025-05-29 15:59:13 UTC (rev 13769)
+++ trunk/foray/foray-ps/build.gradle 2025-05-29 20:48:16 UTC (rev 13770)
@@ -17,7 +17,6 @@
implementation (project(':foray-primitive'))
implementation (project(':foray-ps-data'))
- testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
}
javadoc {
Modified: trunk/foray/foray-ps-data/build.gradle
===================================================================
--- trunk/foray/foray-ps-data/build.gradle 2025-05-29 15:59:13 UTC (rev 13769)
+++ trunk/foray/foray-ps-data/build.gradle 2025-05-29 20:48:16 UTC (rev 13770)
@@ -1,5 +1,6 @@
plugins {
id 'foray.library-conventions'
+ id 'foray.test-conventions'
id 'foray.logging-conventions'
}
@@ -12,6 +13,8 @@
implementation (project(':foray-common'))
implementation (project(':foray-primitive'))
+
+ testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
}
javadoc {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 15:59:17
|
Revision: 13769
http://sourceforge.net/p/foray/code/13769
Author: victormote
Date: 2025-05-29 15:59:13 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Remove no-longer-needed flag on PsFile.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-29 15:41:17 UTC (rev 13768)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-29 15:59:13 UTC (rev 13769)
@@ -38,14 +38,6 @@
*/
public abstract class PsFile extends PsObjectComposite {
- /**
- * Set this flag to true if the dictionary stack should be popped when this
- * file is closed. This is used by the "eexec" operator because it pushes
- * the system dict to the top of the stack when it starts, and it must be
- * popped when the execution is complete.
- */
- private boolean popDictionaryStack = false;
-
/** Indicates whether the file is open. */
private boolean fileIsOpen = true;
@@ -159,25 +151,6 @@
}
/**
- * Sets the pop dictionary stack property.
- * Indicates whether the dictionary stack should be popped when this file
- * has been completely read.
- * @param popDictionary Set to true if the dictionary stack should be popped
- * when this file has been completely read.
- */
- public void setPopDictionaryStack(final boolean popDictionary) {
- this.popDictionaryStack = popDictionary;
- }
-
- /**
- * Returns the pop dictionary stack value.
- * @return The pop dictionary stack value.
- */
- public boolean getPopDictionaryStack() {
- return this.popDictionaryStack;
- }
-
- /**
* Closes this file.
*/
public void close() {
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-29 15:41:17 UTC (rev 13768)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-29 15:59:13 UTC (rev 13769)
@@ -394,9 +394,6 @@
byteToConsume = file.provideInput();
} catch (final IOException e) {
file.closeFile();
- if (file.getPopDictionaryStack()) {
- getDictionaryStack().pop(PsOperator.INVALID);
- }
return;
}
adjustCounters(byteToConsume);
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-29 15:41:17 UTC (rev 13768)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-29 15:59:13 UTC (rev 13769)
@@ -1897,9 +1897,6 @@
charsRead ++;
} catch (final IOException e) {
file.closeFile();
- if (file.getPopDictionaryStack()) {
- getInterpreter().getDictionaryStack().pop(PsOperator.INVALID);
- }
}
}
final String substring = new String(charArray, 0, charsRead);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 15:41:23
|
Revision: 13768
http://sourceforge.net/p/foray/code/13768
Author: victormote
Date: 2025-05-29 15:41:17 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Make the eexec command more tightly coupled to what is described in the documentation.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-29 14:11:42 UTC (rev 13767)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-29 15:41:17 UTC (rev 13768)
@@ -1809,17 +1809,22 @@
/**
* Executes the "eexec" operator.
* @throws PsOperatorException For any PostScript error.
+ * @throws PsInterpreterException4a For errors executing the content.
*/
- private void eexec() throws PsOperatorException {
- // Push the systemdict on the dictionary stack
- getInterpreter().getDictionaryStack().push(
- getInterpreter().getSystemDict());
- // Get the operand for eexec
+ private void eexec() throws PsOperatorException, PsInterpreterException4a {
+ final PsOperandStack operandStack = getInterpreter().getOperandStack();
+
+ /* From "PSLR 3rd Edition" 8.2 eexec: "Before beginning execution, eexec pushes systemdict on the dictionary
+ * stack ..."
+ * From "Adobe Type 1 Font Format" 2.3: "When eexec begins operation, it performs a begin operation on
+ * systemdict ..." */
+ operandStack.push(getInterpreter().getSystemDict());
+ begin();
+
+ /* Create the operand for eexec. */
final PsObject toExec = popOperand(PsOperator.EEXEC);
- final EexecDecodeFilter filter =
- new EexecDecodeFilter(EexecDecodeFilter.EEXEC_INITIAL_KEY,
+ final EexecDecodeFilter filter = new EexecDecodeFilter(EexecDecodeFilter.EEXEC_INITIAL_KEY,
EexecDecodeFilter.EEXEC_RANDOM_BYTES);
- // Create the PsFile object to be executed
PsFile file = null;
if (toExec instanceof PsFile) {
file = new PsFileFilter(filter, (PsFile) toExec);
@@ -1828,10 +1833,14 @@
} else {
throw new PsOperatorException(PsError.TYPECHECK, PsOperator.EEXEC);
}
- // Tell the file to pop the dictionary stack when it closes
- file.setPopDictionaryStack(true);
- // Push the new filter file onto the execution stack
- getInterpreter().getExecutionStack().push(file);
+ operandStack.push(file);
+ exec();
+
+ /* From "PSLR 3rd Edition" 8.2 eexec: "When the decryption filter file is closed either explicitly or
+ * implicitly, the dictionary stack is popped."
+ * From "Adobe Type 1 Font Format" 2.3: "When eexec terminates, it automatically performs an end operation to
+ * remove the systemdict that it begins here." */
+ end();
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 14:11:47
|
Revision: 13767
http://sourceforge.net/p/foray/code/13767
Author: victormote
Date: 2025-05-29 14:11:42 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Fix NPE related to managing chunks.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileFilter.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileFilter.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileFilter.java 2025-05-29 13:47:12 UTC (rev 13766)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileFilter.java 2025-05-29 14:11:42 UTC (rev 13767)
@@ -83,7 +83,7 @@
} else if (this.underlyingString != null) {
tempChunk = this.underlyingString.getValue().getBytes();
}
- return this.filter.decode(tempChunk);
+ return tempChunk == null ? null : this.filter.decode(tempChunk);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 13:47:16
|
Revision: 13766
http://sourceforge.net/p/foray/code/13766
Author: victormote
Date: 2025-05-29 13:47:12 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Fix index-out-of-bounds problem.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsName.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsName.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsName.java 2025-05-29 12:13:40 UTC (rev 13765)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsName.java 2025-05-29 13:47:12 UTC (rev 13766)
@@ -72,6 +72,7 @@
* number. If it is not a number, then it is a name.
*/
if (input[0] == PsInterpreter4a.SLASH
+ && input.length > 1
&& input[1] == PsInterpreter4a.SLASH) {
final String name = new String(input, 2, input.length - 2);
return new PsName(name, false, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 12:13:44
|
Revision: 13765
http://sourceforge.net/p/foray/code/13765
Author: victormote
Date: 2025-05-29 12:13:40 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Try again to restore previous version of test document.
Modified Paths:
--------------
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 11:50:58 UTC (rev 13764)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 12:13:40 UTC (rev 13765)
@@ -1,9 +1,6 @@
<?xml version="1.0" ?>
-<fo:root
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:axsl="http://org.axsl/xslfo-extensions/2007"
- xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- defines the layout master -->
<fo:layout-master-set>
@@ -252,9 +249,7 @@
Helvetica (Other Glyphs), sorted by Unicode code point.
</fo:block>
- <fo:block>Unicode 0x0100 thru 0x0107 (total 8)</fo:block>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
-
Ā<!-- Amacron -->
ā<!-- amacron -->
Ă<!-- Abreve -->
@@ -263,9 +258,6 @@
ą<!-- aogonek -->
Ć<!-- Cacute -->
ć<!-- cacute -->
-
- </fo:block>
- <fo:block>
Č<!-- Ccaron -->
č<!-- ccaron -->
Ď<!-- Dcaron -->
@@ -274,8 +266,6 @@
đ<!-- dcroat -->
Ē<!-- Emacron -->
ē<!-- emacron -->
- </fo:block>
- <fo:block>
Ė<!-- Edotaccent -->
ė<!-- edotaccent -->
Ę<!-- Eogonek -->
@@ -366,11 +356,11 @@
</fo:block>
-<?comment
+
<fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
Times Roman (WinAnsiEncoding)
</fo:block>
@@ -1070,7 +1060,7 @@
<fo:block font-family="otf-ligatures-latin">The actor Ben Affleck climbed Mount Aetna hoping that his affinity
for the fluids in fjords might be affected.</fo:block>
+
</fo:flow>
</fo:page-sequence>
-?>
</fo:root>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 11:51:00
|
Revision: 13764
http://sourceforge.net/p/foray/code/13764
Author: victormote
Date: 2025-05-29 11:50:58 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Revert previous change.
Modified Paths:
--------------
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 10:45:49 UTC (rev 13763)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 11:50:58 UTC (rev 13764)
@@ -1,6 +1,9 @@
<?xml version="1.0" ?>
-<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+<fo:root
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:axsl="http://org.axsl/xslfo-extensions/2007"
+ xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<!-- defines the layout master -->
<fo:layout-master-set>
@@ -17,133 +20,241 @@
</fo:simple-page-master>
</fo:layout-master-set>
-<!-- starts actual layout -->
-<fo:page-sequence master-reference="first">
+ <!-- starts actual layout -->
+ <fo:page-sequence master-reference="first">
+
+
<fo:flow flow-name="xsl-region-body" language="eng" country="US">
-<fo:block-container font-family="Helvetica" font-weight="bold"
-font-size="14pt" space-after=".5em">
- <fo:block>Page 1.</fo:block>
- <fo:block>Helvetica (WinAnsiEncoding), sorted by Unicode code
-point.</fo:block>
-</fo:block-container>
-
-<fo:block-container space-after.optimum="10pt" font-family="Helvetica">
- <fo:block>Unicode 0x0020 thru 0x002F, Glyph Indexes 0x0020 thru 0x002F
-(0x0020 is the space) (total 16)</fo:block>
- <fo:block>
-  ! " # $ % & '
-( ) * + , - . /
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
+Helvetica (WinAnsiEncoding), sorted by Unicode code point.
</fo:block>
- <fo:block>Unicode 0x0030 thru 0x003F, Glyph Indexes 0x0030 thru 0x003F
-(total 16)</fo:block>
- <fo:block>
-0 1 2 3 4 5 6 7
-8 9 : ; < = > ?
+ <fo:block space-after.optimum="10pt" font-family="Helvetica">
+!<!-- [1] glyph: 0x0021 \041 exclam -->
+"<!-- [2] glyph: 0x0022 \042 quotedbl -->
+#<!-- [3] glyph: 0x0023 \043 numbersign -->
+$<!-- [4] glyph: 0x0024 \044 dollar -->
+%<!-- [5] glyph: 0x0025 \045 percent -->
+&<!-- [6] glyph: 0x0026 \046 ampersand -->
+'<!-- [7] glyph: 0x0027 \047 quotesingle -->
+(<!-- [8] glyph: 0x0028 \050 parenleft -->
+)<!-- [9] glyph: 0x0029 \051 parenright -->
+*<!-- [10] glyph: 0x002a \052 asterisk -->
++<!-- [11] glyph: 0x002b \053 plus -->
+,<!-- [12] glyph: 0x002c \054 comma -->
+-<!-- [13] glyph: 0x002d \055 hyphen -->
+.<!-- [14] glyph: 0x002e \056 period -->
+/<!-- [15] glyph: 0x002f \057 slash -->
+0<!-- [16] glyph: 0x0030 \060 zero -->
+1<!-- [17] glyph: 0x0031 \061 one -->
+2<!-- [18] glyph: 0x0032 \062 two -->
+3<!-- [19] glyph: 0x0033 \063 three -->
+4<!-- [20] glyph: 0x0034 \064 four -->
+5<!-- [21] glyph: 0x0035 \065 five -->
+6<!-- [22] glyph: 0x0036 \066 six -->
+7<!-- [23] glyph: 0x0037 \067 seven -->
+8<!-- [24] glyph: 0x0038 \070 eight -->
+9<!-- [25] glyph: 0x0039 \071 nine -->
+:<!-- [26] glyph: 0x003a \072 colon -->
+;<!-- [27] glyph: 0x003b \073 semicolon -->
+<<!-- [28] glyph: 0x003c \074 less -->
+=<!-- [29] glyph: 0x003d \075 equal -->
+><!-- [30] glyph: 0x003e \076 greater -->
+?<!-- [31] glyph: 0x003f \077 question -->
+@<!-- [32] glyph: 0x0040 \100 at -->
+A<!-- [33] glyph: 0x0041 \101 A -->
+B<!-- [34] glyph: 0x0042 \102 B -->
+C<!-- [35] glyph: 0x0043 \103 C -->
+D<!-- [36] glyph: 0x0044 \104 D -->
+E<!-- [37] glyph: 0x0045 \105 E -->
+F<!-- [38] glyph: 0x0046 \106 F -->
+G<!-- [39] glyph: 0x0047 \107 G -->
+H<!-- [40] glyph: 0x0048 \110 H -->
+I<!-- [41] glyph: 0x0049 \111 I -->
+J<!-- [42] glyph: 0x004a \112 J -->
+K<!-- [43] glyph: 0x004b \113 K -->
+L<!-- [44] glyph: 0x004c \114 L -->
+M<!-- [45] glyph: 0x004d \115 M -->
+N<!-- [46] glyph: 0x004e \116 N -->
+O<!-- [47] glyph: 0x004f \117 O -->
+P<!-- [48] glyph: 0x0050 \120 P -->
+Q<!-- [49] glyph: 0x0051 \121 Q -->
+R<!-- [50] glyph: 0x0052 \122 R -->
+S<!-- [51] glyph: 0x0053 \123 S -->
+T<!-- [52] glyph: 0x0054 \124 T -->
+U<!-- [53] glyph: 0x0055 \125 U -->
+V<!-- [54] glyph: 0x0056 \126 V -->
+W<!-- [55] glyph: 0x0057 \127 W -->
+X<!-- [56] glyph: 0x0058 \130 X -->
+Y<!-- [57] glyph: 0x0059 \131 Y -->
+Z<!-- [58] glyph: 0x005a \132 Z -->
+[<!-- [59] glyph: 0x005b \133 bracketleft -->
+\<!-- [60] glyph: 0x005c \134 backslash -->
+]<!-- [61] glyph: 0x005d \135 bracketright -->
+^<!-- [62] glyph: 0x005e \136 asciicircum -->
+_<!-- [63] glyph: 0x005f \137 underscore -->
+`<!-- [64] glyph: 0x0060 \140 grave -->
+a<!-- [65] glyph: 0x0061 \141 a -->
+b<!-- [66] glyph: 0x0062 \142 b -->
+c<!-- [67] glyph: 0x0063 \143 c -->
+d<!-- [68] glyph: 0x0064 \144 d -->
+e<!-- [69] glyph: 0x0065 \145 e -->
+f<!-- [70] glyph: 0x0066 \146 f -->
+g<!-- [71] glyph: 0x0067 \147 g -->
+h<!-- [72] glyph: 0x0068 \150 h -->
+i<!-- [73] glyph: 0x0069 \151 i -->
+j<!-- [74] glyph: 0x006a \152 j -->
+k<!-- [75] glyph: 0x006b \153 k -->
+l<!-- [76] glyph: 0x006c \154 l -->
+m<!-- [77] glyph: 0x006d \155 m -->
+n<!-- [78] glyph: 0x006e \156 n -->
+o<!-- [79] glyph: 0x006f \157 o -->
+p<!-- [80] glyph: 0x0070 \160 p -->
+q<!-- [81] glyph: 0x0071 \161 q -->
+r<!-- [82] glyph: 0x0072 \162 r -->
+s<!-- [83] glyph: 0x0073 \163 s -->
+t<!-- [84] glyph: 0x0074 \164 t -->
+u<!-- [85] glyph: 0x0075 \165 u -->
+v<!-- [86] glyph: 0x0076 \166 v -->
+w<!-- [87] glyph: 0x0077 \167 w -->
+x<!-- [88] glyph: 0x0078 \170 x -->
+y<!-- [89] glyph: 0x0079 \171 y -->
+z<!-- [90] glyph: 0x007a \172 z -->
+{<!-- [91] glyph: 0x007b \173 braceleft -->
+|<!-- [92] glyph: 0x007c \174 bar -->
+}<!-- [93] glyph: 0x007d \175 braceright -->
+~<!-- [94] glyph: 0x007e \176 asciitilde -->
+¡<!-- [95] glyph: 0x00a1 \241 exclamdown -->
+¢<!-- [96] glyph: 0x00a2 \242 cent -->
+£<!-- [97] glyph: 0x00a3 \243 sterling -->
+¤<!-- [98] glyph: 0x00a4 \244 currency -->
+¥<!-- [99] glyph: 0x00a5 \245 yen -->
+¦<!-- [100] glyph: 0x00a6 \246 brokenbar -->
+§<!-- [101] glyph: 0x00a7 \247 section -->
+¨<!-- [102] glyph: 0x00a8 \250 dieresis -->
+©<!-- [103] glyph: 0x00a9 \251 copyright -->
+ª<!-- [104] glyph: 0x00aa \252 ordfeminine -->
+«<!-- [105] glyph: 0x00ab \253 guillemotleft -->
+¬<!-- [106] glyph: 0x00ac \254 logicalnot -->
+®<!-- [107] glyph: 0x00ae \256 registered -->
+¯<!-- [108] glyph: 0x00af \257 macron -->
+°<!-- [109] glyph: 0x00b0 \260 degree -->
+±<!-- [110] glyph: 0x00b1 \261 plusminus -->
+²<!-- [111] glyph: 0x00b2 \262 twosuperior -->
+³<!-- [112] glyph: 0x00b3 \263 threesuperior -->
+´<!-- [113] glyph: 0x00b4 \264 acute -->
+µ<!-- [114] glyph: 0x00b5 \265 mu -->
+¶<!-- [115] glyph: 0x00b6 \266 paragraph -->
+·<!-- [116] glyph: 0x00b7 \267 periodcentered -->
+¸<!-- [117] glyph: 0x00b8 \270 cedilla -->
+¹<!-- [118] glyph: 0x00b9 \271 onesuperior -->
+º<!-- [119] glyph: 0x00ba \272 ordmasculine -->
+»<!-- [120] glyph: 0x00bb \273 guillemotright -->
+¼<!-- [121] glyph: 0x00bc \274 onequarter -->
+½<!-- [122] glyph: 0x00bd \275 onehalf -->
+¾<!-- [123] glyph: 0x00be \276 threequarters -->
+¿<!-- [124] glyph: 0x00bf \277 questiondown -->
+À<!-- [125] glyph: 0x00c0 \300 Agrave -->
+Á<!-- [126] glyph: 0x00c1 \301 Aacute -->
+Â<!-- [127] glyph: 0x00c2 \302 Acircumflex -->
+Ã<!-- [128] glyph: 0x00c3 \303 Atilde -->
+Ä<!-- [129] glyph: 0x00c4 \304 Adieresis -->
+Å<!-- [130] glyph: 0x00c5 \305 Aring -->
+Æ<!-- [131] glyph: 0x00c6 \306 AE -->
+Ç<!-- [132] glyph: 0x00c7 \307 Ccedilla -->
+È<!-- [133] glyph: 0x00c8 \310 Egrave -->
+É<!-- [134] glyph: 0x00c9 \311 Eacute -->
+Ê<!-- [135] glyph: 0x00ca \312 Ecircumflex -->
+Ë<!-- [136] glyph: 0x00cb \313 Edieresis -->
+Ì<!-- [137] glyph: 0x00cc \314 Igrave -->
+Í<!-- [138] glyph: 0x00cd \315 Iacute -->
+Î<!-- [139] glyph: 0x00ce \316 Icircumflex -->
+Ï<!-- [140] glyph: 0x00cf \317 Idieresis -->
+Ð<!-- [141] glyph: 0x00d0 \320 Eth -->
+Ñ<!-- [142] glyph: 0x00d1 \321 Ntilde -->
+Ò<!-- [143] glyph: 0x00d2 \322 Ograve -->
+Ó<!-- [144] glyph: 0x00d3 \323 Oacute -->
+Ô<!-- [145] glyph: 0x00d4 \324 Ocircumflex -->
+Õ<!-- [146] glyph: 0x00d5 \325 Otilde -->
+Ö<!-- [147] glyph: 0x00d6 \326 Odieresis -->
+×<!-- [148] glyph: 0x00d7 \327 multiply -->
+Ø<!-- [149] glyph: 0x00d8 \330 Oslash -->
+Ù<!-- [150] glyph: 0x00d9 \331 Ugrave -->
+Ú<!-- [151] glyph: 0x00da \332 Uacute -->
+Û<!-- [152] glyph: 0x00db \333 Ucircumflex -->
+Ü<!-- [153] glyph: 0x00dc \334 Udieresis -->
+Ý<!-- [154] glyph: 0x00dd \335 Yacute -->
+Þ<!-- [155] glyph: 0x00de \336 Thorn -->
+ß<!-- [156] glyph: 0x00df \337 germandbls -->
+à<!-- [157] glyph: 0x00e0 \340 agrave -->
+á<!-- [158] glyph: 0x00e1 \341 aacute -->
+â<!-- [159] glyph: 0x00e2 \342 acircumflex -->
+ã<!-- [160] glyph: 0x00e3 \343 atilde -->
+ä<!-- [161] glyph: 0x00e4 \344 adieresis -->
+å<!-- [162] glyph: 0x00e5 \345 aring -->
+æ<!-- [163] glyph: 0x00e6 \346 ae -->
+ç<!-- [164] glyph: 0x00e7 \347 ccedilla -->
+è<!-- [165] glyph: 0x00e8 \350 egrave -->
+é<!-- [166] glyph: 0x00e9 \351 eacute -->
+ê<!-- [167] glyph: 0x00ea \352 ecircumflex -->
+ë<!-- [168] glyph: 0x00eb \353 edieresis -->
+ì<!-- [169] glyph: 0x00ec \354 igrave -->
+í<!-- [170] glyph: 0x00ed \355 iacute -->
+î<!-- [171] glyph: 0x00ee \356 icircumflex -->
+ï<!-- [172] glyph: 0x00ef \357 idieresis -->
+ð<!-- [173] glyph: 0x00f0 \360 eth -->
+ñ<!-- [174] glyph: 0x00f1 \361 ntilde -->
+ò<!-- [175] glyph: 0x00f2 \362 ograve -->
+ó<!-- [176] glyph: 0x00f3 \363 oacute -->
+ô<!-- [177] glyph: 0x00f4 \364 ocircumflex -->
+õ<!-- [178] glyph: 0x00f5 \365 otilde -->
+ö<!-- [179] glyph: 0x00f6 \366 odieresis -->
+÷<!-- [180] glyph: 0x00f7 \367 divide -->
+ø<!-- [181] glyph: 0x00f8 \370 oslash -->
+ù<!-- [182] glyph: 0x00f9 \371 ugrave -->
+ú<!-- [183] glyph: 0x00fa \372 uacute -->
+û<!-- [184] glyph: 0x00fb \373 ucircumflex -->
+ü<!-- [185] glyph: 0x00fc \374 udieresis -->
+ý<!-- [186] glyph: 0x00fd \375 yacute -->
+þ<!-- [187] glyph: 0x00fe \376 thorn -->
+ÿ<!-- [188] glyph: 0x00ff \377 ydieresis -->
+Œ<!-- [189] glyph: 0x008c \214 OE -->
+œ<!-- [190] glyph: 0x009c \234 oe -->
+Š<!-- [191] glyph: 0x008a \212 Scaron -->
+š<!-- [192] glyph: 0x009a \232 scaron -->
+Ÿ<!-- [193] glyph: 0x009f \237 Ydieresis -->
+Ž<!-- [194] glyph: 0x008e \216 Zcaron -->
+ž<!-- [195] glyph: 0x009e \236 zcaron -->
+ƒ<!-- [196] glyph: 0x0083 \203 florin -->
+ˆ<!-- [197] glyph: 0x0088 \210 circumflex -->
+˜<!-- [198] glyph: 0x0098 \230 tilde -->
+–<!-- [199] glyph: 0x0096 \226 endash -->
+—<!-- [200] glyph: 0x0097 \227 emdash -->
+‘<!-- [201] glyph: 0x0091 \221 quoteleft -->
+’<!-- [202] glyph: 0x0092 \222 quoteright -->
+‚<!-- [203] glyph: 0x0082 \202 quotesinglbase -->
+“<!-- [204] glyph: 0x0093 \223 quotedblleft -->
+”<!-- [205] glyph: 0x0094 \224 quotedblright -->
+„<!-- [206] glyph: 0x0084 \204 quotedblbase -->
+†<!-- [207] glyph: 0x0086 \206 dagger -->
+‡<!-- [208] glyph: 0x0087 \207 daggerdbl -->
+•<!-- [209] glyph: 0x0095 \225 bullet -->
+…<!-- [210] glyph: 0x0085 \205 ellipsis -->
+‰<!-- [211] glyph: 0x0089 \211 perthousand -->
+‹<!-- [212] glyph: 0x008b \213 guilsinglleft -->
+›<!-- [213] glyph: 0x009b \233 guilsinglright -->
+€<!-- [214] glyph: 0x0080 \200 Euro -->
+™<!-- [215] glyph: 0x0099 \231 trademark -->
+<!-- 216 total, including "space" which was not specifically called out. -->
</fo:block>
- <fo:block>Unicode 0x0040 thru 0x004F, Glyph Indexes 0x0040 thru 0x004F
-(total 16)</fo:block>
- <fo:block>
-@ A B C D E F G
-H I J K L M N O
+
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
+Helvetica (Other Glyphs), sorted by Unicode code point.
</fo:block>
- <fo:block>Unicode 0x0050 thru 0x005F, Glyph Indexes 0x0050 thru 0x005F
-(total 16)</fo:block>
- <fo:block>
-P Q R S T U V W
-X Y Z [ \ ] ^ _
- </fo:block>
- <fo:block>Unicode 0x0060 thru 0x006F, Glyph Indexes 0x0060 thru 0x006F
-(total 16)</fo:block>
- <fo:block>
-` a b c d e f g
-h i j k l m n o
- </fo:block>
- <fo:block>Unicode 0x0070 thru 0x007E, Glyph Indexes 0x0070 thru 0x007E
-(total 15)</fo:block>
- <fo:block>
-p q r s t u v w
-x y z { | } ~
- </fo:block>
- <fo:block>Unicode 0x00A1 thru 0x00AF (except 0x00AD), Glyph Indexes 0x00A1
-thru 0x00AF (except 0x00AD) (total 14)</fo:block>
- <fo:block>
-¡ ¢ £ ¤ ¥ ¦ § ¨
-© ª « ¬ [No glyph for 0x00ad] ® ¯
- </fo:block>
- <fo:block>Unicode 0x00B0 thru 0x00BF, Glyph Indexes 0x00B0 thru 0x00BF
-(total 16)</fo:block>
- <fo:block>
-° ± ² ³ ´ µ ¶ ·
-¸ ¹ º » ¼ ½ ¾ ¿
- </fo:block>
- <fo:block>Unicode 0x00C0 thru 0x00CF, Glyph Indexes 0x00C0 thru 0x00CF
-(total 16)</fo:block>
- <fo:block>
-À Á Â Ã Ä Å Æ Ç
-È É Ê Ë Ì Í Î Ï
- </fo:block>
- <fo:block>Unicode 0x00D0 thru 0x00DF, Glyph Indexes 0x00D0 thru 0x00DF
-(total 16)</fo:block>
- <fo:block>
-Ð Ñ Ò Ó Ô Õ Ö ×
-Ø Ù Ú Û Ü Ý Þ ß
- </fo:block>
- <fo:block>Unicode 0x00E0 thru 0x00EF, Glyph Indexes 0x00E0 thru 0x00EF
-(total 16)</fo:block>
- <fo:block>
-à á â ã ä å æ ç
-è é ê ë ì í î ï
- </fo:block>
- <fo:block>Unicode 0x00F0 thru 0x00FF, Glyph Indexes 0x00F0 thru 0x00FF
-(total 16)</fo:block>
- <fo:block>
-ð ñ ò ó ô õ ö ÷
-ø ù ú û ü ý þ ÿ
- </fo:block>
- <fo:block>Unicode/Glyph 0x0152/0x008c, 0x0153/0x009c, 0x0160/0x008a,
-0x0161/0x009a (total 4)</fo:block>
- <fo:block>
-Œ œ Š š
- </fo:block>
- <fo:block>Unicode/Glyph 0x0178/0x009f, 0x017d/0x008e, 0x017e/0x009e,
-0x0192/0x0083 (total 4)</fo:block>
- <fo:block>
-Ÿ Ž ž ƒ
- </fo:block>
- <fo:block>Unicode/Glyph 0x02c6/0x0088, 0x02dc/0x0098, 0x2013/0x0096,
-0x2014/0x0097 (total 4)</fo:block>
- <fo:block>
-ˆ ˜ – —
- </fo:block>
- <fo:block>Unicode/Glyph 0x2018/0x0091, 0x2019/0x0092, 0x201a/0x0082,
-0x201c/0x0093 (total 4)</fo:block>
- <fo:block>
-‘ ’ ‚ “
- </fo:block>
- <fo:block>Unicode/Glyph 0x201d/0x0094, 0x201e/0x0084, 0x2020/0x0086,
-0x2021/0x0087 (total 4)</fo:block>
- <fo:block>
-” „ † ‡
- </fo:block>
- <fo:block>Unicode/Glyph 0x2022/0x0095, 0x2026/0x0085, 0x2030/0x0089,
-0x2039/0x008b (total 4)</fo:block>
- <fo:block>
-• … ‰ ‹
- </fo:block>
- <fo:block>Unicode/Glyph 0x203a/0x009b, 0x20ac/0x0080, 0x2122/0x0099
-(total 3)</fo:block>
- <fo:block>
-› € ™
- </fo:block>
- <fo:block>216 total</fo:block>
-</fo:block-container>
- <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt"
-space-after=".5em">Helvetica (Other Glyphs), sorted by Unicode code
-point.</fo:block>
+ <fo:block>Unicode 0x0100 thru 0x0107 (total 8)</fo:block>
+ <fo:block space-after.optimum="10pt" font-family="Helvetica">
- <fo:block space-after.optimum="10pt" font-family="Helvetica">
Ā<!-- Amacron -->
ā<!-- amacron -->
Ă<!-- Abreve -->
@@ -152,6 +263,9 @@
ą<!-- aogonek -->
Ć<!-- Cacute -->
ć<!-- cacute -->
+
+ </fo:block>
+ <fo:block>
Č<!-- Ccaron -->
č<!-- ccaron -->
Ď<!-- Dcaron -->
@@ -160,6 +274,8 @@
đ<!-- dcroat -->
Ē<!-- Emacron -->
ē<!-- emacron -->
+ </fo:block>
+ <fo:block>
Ė<!-- Edotaccent -->
ė<!-- edotaccent -->
Ę<!-- Eogonek -->
@@ -249,13 +365,10 @@
Total glyphs in font = 315. -->
</fo:block>
-</fo:flow>
-</fo:page-sequence>
+<?comment
-<fo:page-sequence master-reference="first">
-<fo:flow flow-name="xsl-region-body" language="eng" country="US">
<fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
@@ -957,7 +1070,7 @@
<fo:block font-family="otf-ligatures-latin">The actor Ben Affleck climbed Mount Aetna hoping that his affinity
for the fluids in fjords might be affected.</fo:block>
-
</fo:flow>
</fo:page-sequence>
+?>
</fo:root>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-29 10:45:53
|
Revision: 13763
http://sourceforge.net/p/foray/code/13763
Author: victormote
Date: 2025-05-29 10:45:49 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Move some comments into the document text.
Modified Paths:
--------------
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-28 18:59:06 UTC (rev 13762)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2025-05-29 10:45:49 UTC (rev 13763)
@@ -17,238 +17,132 @@
</fo:simple-page-master>
</fo:layout-master-set>
- <!-- starts actual layout -->
- <fo:page-sequence master-reference="first">
+<!-- starts actual layout -->
+<fo:page-sequence master-reference="first">
+<fo:flow flow-name="xsl-region-body" language="eng" country="US">
+<fo:block-container font-family="Helvetica" font-weight="bold"
+font-size="14pt" space-after=".5em">
+ <fo:block>Page 1.</fo:block>
+ <fo:block>Helvetica (WinAnsiEncoding), sorted by Unicode code
+point.</fo:block>
+</fo:block-container>
-<fo:flow flow-name="xsl-region-body" language="eng" country="US">
-
- <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
-Helvetica (WinAnsiEncoding), sorted by Unicode code point.
+<fo:block-container space-after.optimum="10pt" font-family="Helvetica">
+ <fo:block>Unicode 0x0020 thru 0x002F, Glyph Indexes 0x0020 thru 0x002F
+(0x0020 is the space) (total 16)</fo:block>
+ <fo:block>
+  ! " # $ % & '
+( ) * + , - . /
</fo:block>
- <fo:block space-after.optimum="10pt" font-family="Helvetica">
-!<!-- [1] glyph: 0x0021 \041 exclam -->
-"<!-- [2] glyph: 0x0022 \042 quotedbl -->
-#<!-- [3] glyph: 0x0023 \043 numbersign -->
-$<!-- [4] glyph: 0x0024 \044 dollar -->
-%<!-- [5] glyph: 0x0025 \045 percent -->
-&<!-- [6] glyph: 0x0026 \046 ampersand -->
-'<!-- [7] glyph: 0x0027 \047 quotesingle -->
-(<!-- [8] glyph: 0x0028 \050 parenleft -->
-)<!-- [9] glyph: 0x0029 \051 parenright -->
-*<!-- [10] glyph: 0x002a \052 asterisk -->
-+<!-- [11] glyph: 0x002b \053 plus -->
-,<!-- [12] glyph: 0x002c \054 comma -->
--<!-- [13] glyph: 0x002d \055 hyphen -->
-.<!-- [14] glyph: 0x002e \056 period -->
-/<!-- [15] glyph: 0x002f \057 slash -->
-0<!-- [16] glyph: 0x0030 \060 zero -->
-1<!-- [17] glyph: 0x0031 \061 one -->
-2<!-- [18] glyph: 0x0032 \062 two -->
-3<!-- [19] glyph: 0x0033 \063 three -->
-4<!-- [20] glyph: 0x0034 \064 four -->
-5<!-- [21] glyph: 0x0035 \065 five -->
-6<!-- [22] glyph: 0x0036 \066 six -->
-7<!-- [23] glyph: 0x0037 \067 seven -->
-8<!-- [24] glyph: 0x0038 \070 eight -->
-9<!-- [25] glyph: 0x0039 \071 nine -->
-:<!-- [26] glyph: 0x003a \072 colon -->
-;<!-- [27] glyph: 0x003b \073 semicolon -->
-<<!-- [28] glyph: 0x003c \074 less -->
-=<!-- [29] glyph: 0x003d \075 equal -->
-><!-- [30] glyph: 0x003e \076 greater -->
-?<!-- [31] glyph: 0x003f \077 question -->
-@<!-- [32] glyph: 0x0040 \100 at -->
-A<!-- [33] glyph: 0x0041 \101 A -->
-B<!-- [34] glyph: 0x0042 \102 B -->
-C<!-- [35] glyph: 0x0043 \103 C -->
-D<!-- [36] glyph: 0x0044 \104 D -->
-E<!-- [37] glyph: 0x0045 \105 E -->
-F<!-- [38] glyph: 0x0046 \106 F -->
-G<!-- [39] glyph: 0x0047 \107 G -->
-H<!-- [40] glyph: 0x0048 \110 H -->
-I<!-- [41] glyph: 0x0049 \111 I -->
-J<!-- [42] glyph: 0x004a \112 J -->
-K<!-- [43] glyph: 0x004b \113 K -->
-L<!-- [44] glyph: 0x004c \114 L -->
-M<!-- [45] glyph: 0x004d \115 M -->
-N<!-- [46] glyph: 0x004e \116 N -->
-O<!-- [47] glyph: 0x004f \117 O -->
-P<!-- [48] glyph: 0x0050 \120 P -->
-Q<!-- [49] glyph: 0x0051 \121 Q -->
-R<!-- [50] glyph: 0x0052 \122 R -->
-S<!-- [51] glyph: 0x0053 \123 S -->
-T<!-- [52] glyph: 0x0054 \124 T -->
-U<!-- [53] glyph: 0x0055 \125 U -->
-V<!-- [54] glyph: 0x0056 \126 V -->
-W<!-- [55] glyph: 0x0057 \127 W -->
-X<!-- [56] glyph: 0x0058 \130 X -->
-Y<!-- [57] glyph: 0x0059 \131 Y -->
-Z<!-- [58] glyph: 0x005a \132 Z -->
-[<!-- [59] glyph: 0x005b \133 bracketleft -->
-\<!-- [60] glyph: 0x005c \134 backslash -->
-]<!-- [61] glyph: 0x005d \135 bracketright -->
-^<!-- [62] glyph: 0x005e \136 asciicircum -->
-_<!-- [63] glyph: 0x005f \137 underscore -->
-`<!-- [64] glyph: 0x0060 \140 grave -->
-a<!-- [65] glyph: 0x0061 \141 a -->
-b<!-- [66] glyph: 0x0062 \142 b -->
-c<!-- [67] glyph: 0x0063 \143 c -->
-d<!-- [68] glyph: 0x0064 \144 d -->
-e<!-- [69] glyph: 0x0065 \145 e -->
-f<!-- [70] glyph: 0x0066 \146 f -->
-g<!-- [71] glyph: 0x0067 \147 g -->
-h<!-- [72] glyph: 0x0068 \150 h -->
-i<!-- [73] glyph: 0x0069 \151 i -->
-j<!-- [74] glyph: 0x006a \152 j -->
-k<!-- [75] glyph: 0x006b \153 k -->
-l<!-- [76] glyph: 0x006c \154 l -->
-m<!-- [77] glyph: 0x006d \155 m -->
-n<!-- [78] glyph: 0x006e \156 n -->
-o<!-- [79] glyph: 0x006f \157 o -->
-p<!-- [80] glyph: 0x0070 \160 p -->
-q<!-- [81] glyph: 0x0071 \161 q -->
-r<!-- [82] glyph: 0x0072 \162 r -->
-s<!-- [83] glyph: 0x0073 \163 s -->
-t<!-- [84] glyph: 0x0074 \164 t -->
-u<!-- [85] glyph: 0x0075 \165 u -->
-v<!-- [86] glyph: 0x0076 \166 v -->
-w<!-- [87] glyph: 0x0077 \167 w -->
-x<!-- [88] glyph: 0x0078 \170 x -->
-y<!-- [89] glyph: 0x0079 \171 y -->
-z<!-- [90] glyph: 0x007a \172 z -->
-{<!-- [91] glyph: 0x007b \173 braceleft -->
-|<!-- [92] glyph: 0x007c \174 bar -->
-}<!-- [93] glyph: 0x007d \175 braceright -->
-~<!-- [94] glyph: 0x007e \176 asciitilde -->
-¡<!-- [95] glyph: 0x00a1 \241 exclamdown -->
-¢<!-- [96] glyph: 0x00a2 \242 cent -->
-£<!-- [97] glyph: 0x00a3 \243 sterling -->
-¤<!-- [98] glyph: 0x00a4 \244 currency -->
-¥<!-- [99] glyph: 0x00a5 \245 yen -->
-¦<!-- [100] glyph: 0x00a6 \246 brokenbar -->
-§<!-- [101] glyph: 0x00a7 \247 section -->
-¨<!-- [102] glyph: 0x00a8 \250 dieresis -->
-©<!-- [103] glyph: 0x00a9 \251 copyright -->
-ª<!-- [104] glyph: 0x00aa \252 ordfeminine -->
-«<!-- [105] glyph: 0x00ab \253 guillemotleft -->
-¬<!-- [106] glyph: 0x00ac \254 logicalnot -->
-®<!-- [107] glyph: 0x00ae \256 registered -->
-¯<!-- [108] glyph: 0x00af \257 macron -->
-°<!-- [109] glyph: 0x00b0 \260 degree -->
-±<!-- [110] glyph: 0x00b1 \261 plusminus -->
-²<!-- [111] glyph: 0x00b2 \262 twosuperior -->
-³<!-- [112] glyph: 0x00b3 \263 threesuperior -->
-´<!-- [113] glyph: 0x00b4 \264 acute -->
-µ<!-- [114] glyph: 0x00b5 \265 mu -->
-¶<!-- [115] glyph: 0x00b6 \266 paragraph -->
-·<!-- [116] glyph: 0x00b7 \267 periodcentered -->
-¸<!-- [117] glyph: 0x00b8 \270 cedilla -->
-¹<!-- [118] glyph: 0x00b9 \271 onesuperior -->
-º<!-- [119] glyph: 0x00ba \272 ordmasculine -->
-»<!-- [120] glyph: 0x00bb \273 guillemotright -->
-¼<!-- [121] glyph: 0x00bc \274 onequarter -->
-½<!-- [122] glyph: 0x00bd \275 onehalf -->
-¾<!-- [123] glyph: 0x00be \276 threequarters -->
-¿<!-- [124] glyph: 0x00bf \277 questiondown -->
-À<!-- [125] glyph: 0x00c0 \300 Agrave -->
-Á<!-- [126] glyph: 0x00c1 \301 Aacute -->
-Â<!-- [127] glyph: 0x00c2 \302 Acircumflex -->
-Ã<!-- [128] glyph: 0x00c3 \303 Atilde -->
-Ä<!-- [129] glyph: 0x00c4 \304 Adieresis -->
-Å<!-- [130] glyph: 0x00c5 \305 Aring -->
-Æ<!-- [131] glyph: 0x00c6 \306 AE -->
-Ç<!-- [132] glyph: 0x00c7 \307 Ccedilla -->
-È<!-- [133] glyph: 0x00c8 \310 Egrave -->
-É<!-- [134] glyph: 0x00c9 \311 Eacute -->
-Ê<!-- [135] glyph: 0x00ca \312 Ecircumflex -->
-Ë<!-- [136] glyph: 0x00cb \313 Edieresis -->
-Ì<!-- [137] glyph: 0x00cc \314 Igrave -->
-Í<!-- [138] glyph: 0x00cd \315 Iacute -->
-Î<!-- [139] glyph: 0x00ce \316 Icircumflex -->
-Ï<!-- [140] glyph: 0x00cf \317 Idieresis -->
-Ð<!-- [141] glyph: 0x00d0 \320 Eth -->
-Ñ<!-- [142] glyph: 0x00d1 \321 Ntilde -->
-Ò<!-- [143] glyph: 0x00d2 \322 Ograve -->
-Ó<!-- [144] glyph: 0x00d3 \323 Oacute -->
-Ô<!-- [145] glyph: 0x00d4 \324 Ocircumflex -->
-Õ<!-- [146] glyph: 0x00d5 \325 Otilde -->
-Ö<!-- [147] glyph: 0x00d6 \326 Odieresis -->
-×<!-- [148] glyph: 0x00d7 \327 multiply -->
-Ø<!-- [149] glyph: 0x00d8 \330 Oslash -->
-Ù<!-- [150] glyph: 0x00d9 \331 Ugrave -->
-Ú<!-- [151] glyph: 0x00da \332 Uacute -->
-Û<!-- [152] glyph: 0x00db \333 Ucircumflex -->
-Ü<!-- [153] glyph: 0x00dc \334 Udieresis -->
-Ý<!-- [154] glyph: 0x00dd \335 Yacute -->
-Þ<!-- [155] glyph: 0x00de \336 Thorn -->
-ß<!-- [156] glyph: 0x00df \337 germandbls -->
-à<!-- [157] glyph: 0x00e0 \340 agrave -->
-á<!-- [158] glyph: 0x00e1 \341 aacute -->
-â<!-- [159] glyph: 0x00e2 \342 acircumflex -->
-ã<!-- [160] glyph: 0x00e3 \343 atilde -->
-ä<!-- [161] glyph: 0x00e4 \344 adieresis -->
-å<!-- [162] glyph: 0x00e5 \345 aring -->
-æ<!-- [163] glyph: 0x00e6 \346 ae -->
-ç<!-- [164] glyph: 0x00e7 \347 ccedilla -->
-è<!-- [165] glyph: 0x00e8 \350 egrave -->
-é<!-- [166] glyph: 0x00e9 \351 eacute -->
-ê<!-- [167] glyph: 0x00ea \352 ecircumflex -->
-ë<!-- [168] glyph: 0x00eb \353 edieresis -->
-ì<!-- [169] glyph: 0x00ec \354 igrave -->
-í<!-- [170] glyph: 0x00ed \355 iacute -->
-î<!-- [171] glyph: 0x00ee \356 icircumflex -->
-ï<!-- [172] glyph: 0x00ef \357 idieresis -->
-ð<!-- [173] glyph: 0x00f0 \360 eth -->
-ñ<!-- [174] glyph: 0x00f1 \361 ntilde -->
-ò<!-- [175] glyph: 0x00f2 \362 ograve -->
-ó<!-- [176] glyph: 0x00f3 \363 oacute -->
-ô<!-- [177] glyph: 0x00f4 \364 ocircumflex -->
-õ<!-- [178] glyph: 0x00f5 \365 otilde -->
-ö<!-- [179] glyph: 0x00f6 \366 odieresis -->
-÷<!-- [180] glyph: 0x00f7 \367 divide -->
-ø<!-- [181] glyph: 0x00f8 \370 oslash -->
-ù<!-- [182] glyph: 0x00f9 \371 ugrave -->
-ú<!-- [183] glyph: 0x00fa \372 uacute -->
-û<!-- [184] glyph: 0x00fb \373 ucircumflex -->
-ü<!-- [185] glyph: 0x00fc \374 udieresis -->
-ý<!-- [186] glyph: 0x00fd \375 yacute -->
-þ<!-- [187] glyph: 0x00fe \376 thorn -->
-ÿ<!-- [188] glyph: 0x00ff \377 ydieresis -->
-Œ<!-- [189] glyph: 0x008c \214 OE -->
-œ<!-- [190] glyph: 0x009c \234 oe -->
-Š<!-- [191] glyph: 0x008a \212 Scaron -->
-š<!-- [192] glyph: 0x009a \232 scaron -->
-Ÿ<!-- [193] glyph: 0x009f \237 Ydieresis -->
-Ž<!-- [194] glyph: 0x008e \216 Zcaron -->
-ž<!-- [195] glyph: 0x009e \236 zcaron -->
-ƒ<!-- [196] glyph: 0x0083 \203 florin -->
-ˆ<!-- [197] glyph: 0x0088 \210 circumflex -->
-˜<!-- [198] glyph: 0x0098 \230 tilde -->
-–<!-- [199] glyph: 0x0096 \226 endash -->
-—<!-- [200] glyph: 0x0097 \227 emdash -->
-‘<!-- [201] glyph: 0x0091 \221 quoteleft -->
-’<!-- [202] glyph: 0x0092 \222 quoteright -->
-‚<!-- [203] glyph: 0x0082 \202 quotesinglbase -->
-“<!-- [204] glyph: 0x0093 \223 quotedblleft -->
-”<!-- [205] glyph: 0x0094 \224 quotedblright -->
-„<!-- [206] glyph: 0x0084 \204 quotedblbase -->
-†<!-- [207] glyph: 0x0086 \206 dagger -->
-‡<!-- [208] glyph: 0x0087 \207 daggerdbl -->
-•<!-- [209] glyph: 0x0095 \225 bullet -->
-…<!-- [210] glyph: 0x0085 \205 ellipsis -->
-‰<!-- [211] glyph: 0x0089 \211 perthousand -->
-‹<!-- [212] glyph: 0x008b \213 guilsinglleft -->
-›<!-- [213] glyph: 0x009b \233 guilsinglright -->
-€<!-- [214] glyph: 0x0080 \200 Euro -->
-™<!-- [215] glyph: 0x0099 \231 trademark -->
-<!-- 216 total, including "space" which was not specifically called out. -->
+ <fo:block>Unicode 0x0030 thru 0x003F, Glyph Indexes 0x0030 thru 0x003F
+(total 16)</fo:block>
+ <fo:block>
+0 1 2 3 4 5 6 7
+8 9 : ; < = > ?
</fo:block>
-
- <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt" space-after=".5em">
-Helvetica (Other Glyphs), sorted by Unicode code point.
+ <fo:block>Unicode 0x0040 thru 0x004F, Glyph Indexes 0x0040 thru 0x004F
+(total 16)</fo:block>
+ <fo:block>
+@ A B C D E F G
+H I J K L M N O
</fo:block>
+ <fo:block>Unicode 0x0050 thru 0x005F, Glyph Indexes 0x0050 thru 0x005F
+(total 16)</fo:block>
+ <fo:block>
+P Q R S T U V W
+X Y Z [ \ ] ^ _
+ </fo:block>
+ <fo:block>Unicode 0x0060 thru 0x006F, Glyph Indexes 0x0060 thru 0x006F
+(total 16)</fo:block>
+ <fo:block>
+` a b c d e f g
+h i j k l m n o
+ </fo:block>
+ <fo:block>Unicode 0x0070 thru 0x007E, Glyph Indexes 0x0070 thru 0x007E
+(total 15)</fo:block>
+ <fo:block>
+p q r s t u v w
+x y z { | } ~
+ </fo:block>
+ <fo:block>Unicode 0x00A1 thru 0x00AF (except 0x00AD), Glyph Indexes 0x00A1
+thru 0x00AF (except 0x00AD) (total 14)</fo:block>
+ <fo:block>
+¡ ¢ £ ¤ ¥ ¦ § ¨
+© ª « ¬ [No glyph for 0x00ad] ® ¯
+ </fo:block>
+ <fo:block>Unicode 0x00B0 thru 0x00BF, Glyph Indexes 0x00B0 thru 0x00BF
+(total 16)</fo:block>
+ <fo:block>
+° ± ² ³ ´ µ ¶ ·
+¸ ¹ º » ¼ ½ ¾ ¿
+ </fo:block>
+ <fo:block>Unicode 0x00C0 thru 0x00CF, Glyph Indexes 0x00C0 thru 0x00CF
+(total 16)</fo:block>
+ <fo:block>
+À Á Â Ã Ä Å Æ Ç
+È É Ê Ë Ì Í Î Ï
+ </fo:block>
+ <fo:block>Unicode 0x00D0 thru 0x00DF, Glyph Indexes 0x00D0 thru 0x00DF
+(total 16)</fo:block>
+ <fo:block>
+Ð Ñ Ò Ó Ô Õ Ö ×
+Ø Ù Ú Û Ü Ý Þ ß
+ </fo:block>
+ <fo:block>Unicode 0x00E0 thru 0x00EF, Glyph Indexes 0x00E0 thru 0x00EF
+(total 16)</fo:block>
+ <fo:block>
+à á â ã ä å æ ç
+è é ê ë ì í î ï
+ </fo:block>
+ <fo:block>Unicode 0x00F0 thru 0x00FF, Glyph Indexes 0x00F0 thru 0x00FF
+(total 16)</fo:block>
+ <fo:block>
+ð ñ ò ó ô õ ö ÷
+ø ù ú û ü ý þ ÿ
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x0152/0x008c, 0x0153/0x009c, 0x0160/0x008a,
+0x0161/0x009a (total 4)</fo:block>
+ <fo:block>
+Œ œ Š š
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x0178/0x009f, 0x017d/0x008e, 0x017e/0x009e,
+0x0192/0x0083 (total 4)</fo:block>
+ <fo:block>
+Ÿ Ž ž ƒ
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x02c6/0x0088, 0x02dc/0x0098, 0x2013/0x0096,
+0x2014/0x0097 (total 4)</fo:block>
+ <fo:block>
+ˆ ˜ – —
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x2018/0x0091, 0x2019/0x0092, 0x201a/0x0082,
+0x201c/0x0093 (total 4)</fo:block>
+ <fo:block>
+‘ ’ ‚ “
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x201d/0x0094, 0x201e/0x0084, 0x2020/0x0086,
+0x2021/0x0087 (total 4)</fo:block>
+ <fo:block>
+” „ † ‡
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x2022/0x0095, 0x2026/0x0085, 0x2030/0x0089,
+0x2039/0x008b (total 4)</fo:block>
+ <fo:block>
+• … ‰ ‹
+ </fo:block>
+ <fo:block>Unicode/Glyph 0x203a/0x009b, 0x20ac/0x0080, 0x2122/0x0099
+(total 3)</fo:block>
+ <fo:block>
+› € ™
+ </fo:block>
+ <fo:block>216 total</fo:block>
+</fo:block-container>
+ <fo:block font-family="Helvetica" font-weight="bold" font-size="14pt"
+space-after=".5em">Helvetica (Other Glyphs), sorted by Unicode code
+point.</fo:block>
+
<fo:block space-after.optimum="10pt" font-family="Helvetica">
Ā<!-- Amacron -->
ā<!-- amacron -->
@@ -355,12 +249,15 @@
Total glyphs in font = 315. -->
</fo:block>
+</fo:flow>
+</fo:page-sequence>
+<fo:page-sequence master-reference="first">
+<fo:flow flow-name="xsl-region-body" language="eng" country="US">
-
<fo:block font-family="Helvetica" font-weight="bold" font-size="14pt">
Times Roman (WinAnsiEncoding)
</fo:block>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 18:59:08
|
Revision: 13762
http://sourceforge.net/p/foray/code/13762
Author: victormote
Date: 2025-05-28 18:59:06 +0000 (Wed, 28 May 2025)
Log Message:
-----------
Conform to aXSL change: Move more common code from FOray to MutableSequence (aXSL).
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -35,6 +35,7 @@
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequenceMutable;
+import org.axsl.primitive.sequence.MutableSequence;
import org.apache.commons.io.IOUtils;
@@ -54,23 +55,11 @@
*/
public class ByteArrayBuilder extends AbstractByteSequence implements ByteSequenceMutable, Serializable {
- /**
- * The maximum size of array to allocate (unless necessary).
- * Some VMs reserve some header words in an array.
- * Attempts to allocate larger arrays may result in OutOfMemoryError: Requested array size exceeds VM limit.
- * This value is based on the private constant java.lang.AbstractStringBuilder.MAX_ARRAY_SIZE.
- * @see "The package-visible class java.lang.AbstractStringBuilder."
- */
- public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
-
/** Constant needed for serialization. */
private static final long serialVersionUID = -8991286918638672037L;
- /** Default Capacity increment size. */
- private static final int DEFAULT_BLOCK_SIZE = 2048;
-
/** Capacity increment size. */
- private int blockSize = ByteArrayBuilder.DEFAULT_BLOCK_SIZE;
+ private int blockSize = MutableSequence.DEFAULT_BLOCK_SIZE;
/** The encapsulated array. */
private byte[] backingArray;
@@ -82,7 +71,7 @@
* No-argument constructor.
*/
public ByteArrayBuilder() {
- this(ByteArrayBuilder.DEFAULT_BLOCK_SIZE);
+ this(MutableSequence.DEFAULT_BLOCK_SIZE);
}
/**
@@ -93,7 +82,7 @@
if (capacity > 0) {
this.blockSize = capacity;
} else {
- this.blockSize = ByteArrayBuilder.DEFAULT_BLOCK_SIZE;
+ this.blockSize = MutableSequence.DEFAULT_BLOCK_SIZE;
}
this.backingArray = new byte[this.blockSize];
this.length = 0;
@@ -215,23 +204,7 @@
return index;
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal
- * array is allocated with greater capacity. The new capacity is the
- * larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this
- * method takes no action and simply returns.
- * Note that subsequent operations on this object can reduce the
- * actual capacity below that requested here.
- *
- * @param minimumCapacity the minimum desired capacity.
- * @see StringBuilder#ensureCapacity(int)
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > 0) {
ensureCapacityInternal(minimumCapacity);
@@ -250,47 +223,10 @@
private void ensureCapacityInternal(final int minimumCapacity) {
// overflow-conscious code
if (minimumCapacity - this.backingArray.length > 0) {
- backingArray = Arrays.copyOf(backingArray,
- newCapacity(minimumCapacity));
+ backingArray = Arrays.copyOf(backingArray, newCapacity(minimumCapacity));
}
}
- /**
- * Returns a capacity at least as large as the given minimum capacity.
- * Returns the current capacity increased by the same amount + 2 if
- * that suffices.
- * Will not return a capacity greater than {@code MAX_ARRAY_SIZE}
- * unless the given minimum capacity is greater than that.
- *
- * @param minCapacity the desired minimum capacity
- * @return The new capacity.
- * @throws OutOfMemoryError if minCapacity is less than zero or
- * greater than Integer.MAX_VALUE
- */
- private int newCapacity(final int minCapacity) {
- // overflow-conscious code
- int newCapacity = (this.backingArray.length << 1) + 2;
- if (newCapacity - minCapacity < 0) {
- newCapacity = minCapacity;
- }
- return (newCapacity <= 0 || MAX_ARRAY_SIZE - newCapacity < 0)
- ? hugeCapacity(minCapacity)
- : newCapacity;
- }
-
- /**
- * Computes the new capacity for the case where the minimum requested capacity is greater than the normal increment
- * amount.
- * @param minCapacity The requested minimum capacity.
- * @return The computed new capacity.
- */
- private int hugeCapacity(final int minCapacity) {
- if (Integer.MAX_VALUE - minCapacity < 0) { // overflow
- throw new OutOfMemoryError();
- }
- return (minCapacity > MAX_ARRAY_SIZE) ? minCapacity : MAX_ARRAY_SIZE;
- }
-
@Override
public void trimToSize() {
if (this.length < this.backingArray.length) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -125,23 +125,7 @@
return index;
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal
- * array is allocated with greater capacity. The new capacity is the
- * larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this
- * method takes no action and simply returns.
- * Note that subsequent operations on this object can reduce the
- * actual capacity below that requested here.
- *
- * @param minimumCapacity the minimum desired capacity.
- * @see StringBuilder#ensureCapacity(int)
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > 0) {
ensureCapacityInternal(minimumCapacity);
@@ -165,43 +149,6 @@
}
}
- /**
- * Returns a capacity at least as large as the given minimum capacity.
- * Returns the current capacity increased by the same amount + 2 if
- * that suffices.
- * Will not return a capacity greater than {@code MAX_ARRAY_SIZE}
- * unless the given minimum capacity is greater than that.
- *
- * @param minCapacity the desired minimum capacity
- * @return The new capacity.
- * @throws OutOfMemoryError if minCapacity is less than zero or
- * greater than Integer.MAX_VALUE
- */
- private int newCapacity(final int minCapacity) {
- // overflow-conscious code
- int newCapacity = (this.backingArray.length << 1) + 2;
- if (newCapacity - minCapacity < 0) {
- newCapacity = minCapacity;
- }
- return (newCapacity <= 0 || MAX_ARRAY_SIZE - newCapacity < 0)
- ? hugeCapacity(minCapacity)
- : newCapacity;
- }
-
- /**
- * Computes the new capacity for the case where the minimum requested capacity is greater than the normal increment
- * amount.
- * @param minCapacity The requested minimum capacity.
- * @return The computed new capacity.
- */
- private int hugeCapacity(final int minCapacity) {
- if (Integer.MAX_VALUE - minCapacity < 0) { // overflow
- throw new OutOfMemoryError();
- }
- return (minCapacity > MAX_ARRAY_SIZE)
- ? minCapacity : MAX_ARRAY_SIZE;
- }
-
@Override
public void trimToSize() {
if (this.length < this.backingArray.length) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -119,18 +119,7 @@
return Arrays.toString(toArray());
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal array is allocated with greater capacity.
- * The new capacity is the larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this method takes no action and simply returns.
- * @param minimumCapacity The minimum desired capacity.
- * @see "java.lang.AbstractStringBuilder#ensureCapacity(int)"
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > this.backingArray.length) {
expandCapacity(minimumCapacity);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -119,18 +119,7 @@
return Arrays.toString(toArray());
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal array is allocated with greater capacity.
- * The new capacity is the larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this method takes no action and simply returns.
- * @param minimumCapacity The minimum desired capacity.
- * @see "java.lang.AbstractStringBuilder#ensureCapacity(int)"
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > this.backingArray.length) {
expandCapacity(minimumCapacity);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -137,19 +137,8 @@
return true;
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal array is allocated with greater capacity.
- * The new capacity is the larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this method takes no action and simply returns.
- * @param minimumCapacity The minimum desired capacity.
- * @see This code is based on AbstractStringBuilder#ensureCapacity(int).
- */
- private void ensureCapacity(final int minimumCapacity) {
+ @Override
+ public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > this.backingArray.length) {
expandCapacity(minimumCapacity);
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -138,18 +138,7 @@
return true;
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal array is allocated with greater capacity.
- * The new capacity is the larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this method takes no action and simply returns.
- * @param minimumCapacity The minimum desired capacity.
- * @see "java.lang.AbstractStringBuilder#ensureCapacity(int)"
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > this.backingArray.length) {
expandCapacity(minimumCapacity);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -185,7 +185,30 @@
return index;
}
+ @Override
+ public void ensureCapacity(final int minimumCapacity) {
+ if (minimumCapacity > this.backingVector.length() / 2) {
+ ensureCapacityInternal(minimumCapacity);
+ }
+ }
+
/**
+ * For positive values of {@code minimumCapacity}, this method
+ * behaves like {@code ensureCapacity}, however it is never
+ * synchronized.
+ * If {@code minimumCapacity} is non positive due to numeric
+ * overflow, this method throws {@code OutOfMemoryError}.
+ * @param minimumCapacity the minimum desired capacity.
+ * @see StringBuilder#ensureCapacity(int)
+ */
+ private void ensureCapacityInternal(final int minimumCapacity) {
+ // overflow-conscious code
+ if (minimumCapacity - this.backingVector.length() / 2 > 0) {
+ this.backingVector.ensureCapacity(minimumCapacity / 2);
+ }
+ }
+
+ /**
* Sets the capacity of this vector equal to its size, to that there is no
* unused capacity.
*/
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2025-05-28 18:59:06 UTC (rev 13762)
@@ -119,18 +119,7 @@
return Arrays.toString(toArray());
}
- /**
- * Ensures that the capacity is at least equal to the specified minimum.
- * If the current capacity is less than the argument, then a new internal array is allocated with greater capacity.
- * The new capacity is the larger of:
- * <ul>
- * <li>The {@code minimumCapacity} argument.
- * <li>Twice the old capacity, plus {@code 2}.
- * </ul>
- * If the {@code minimumCapacity} argument is nonpositive, this method takes no action and simply returns.
- * @param minimumCapacity The minimum desired capacity.
- * @see "java.lang.AbstractStringBuilder#ensureCapacity(int)"
- */
+ @Override
public void ensureCapacity(final int minimumCapacity) {
if (minimumCapacity > this.backingArray.length) {
expandCapacity(minimumCapacity);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 16:42:31
|
Revision: 13761
http://sourceforge.net/p/foray/code/13761
Author: victormote
Date: 2025-05-28 16:42:29 +0000 (Wed, 28 May 2025)
Log Message:
-----------
Fix bug in append logic, related to rolling up of duplicate methods.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 15:20:28 UTC (rev 13760)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 16:42:29 UTC (rev 13761)
@@ -112,8 +112,8 @@
@Override
public ByteArrayBuilder append(final byte value) {
ensureCapacity(1);
- setByteAt(this.length, value);
this.length ++;
+ setByteAt(this.length - 1, value);
return this;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 15:20:35
|
Revision: 13760
http://sourceforge.net/p/foray/code/13760
Author: victormote
Date: 2025-05-28 15:20:28 +0000 (Wed, 28 May 2025)
Log Message:
-----------
Roll up some duplicate methods.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 15:20:28 UTC (rev 13760)
@@ -112,7 +112,7 @@
@Override
public ByteArrayBuilder append(final byte value) {
ensureCapacity(1);
- set(this.length, value);
+ setByteAt(this.length, value);
this.length ++;
return this;
}
@@ -197,24 +197,6 @@
}
/**
- * Place an item in the vector at a specific index.
- * @param index The 0-based index into the vector.
- * @param val The byte value to be placed in the vector.
- */
- public void set(final int index, final byte val) {
- this.backingArray[index] = val;
- }
-
- /**
- * Retrieve a value from a specific index in the vector.
- * @param index The 0-based index whose value should be returned.
- * @return The value at {@code index}.
- */
- public byte get(final int index) {
- return this.backingArray[index];
- }
-
- /**
* Allocates or uses a specified number of elements (bytes).
* If needed, this method automatically increases the vector's capacity.
* @param size The number of elements (bytes) to be allocated.
@@ -332,7 +314,7 @@
*/
public void setLastElement(final byte newValue) {
final int index = length() - 1;
- set(index, newValue);
+ setByteAt(index, newValue);
}
@Override
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 15:20:28 UTC (rev 13760)
@@ -131,7 +131,7 @@
*/
public void add(final byte value) {
alloc(1);
- set(this.nextIndex - 1, value);
+ setNibbleAt(this.nextIndex - 1, value);
}
/**
@@ -146,31 +146,6 @@
}
/**
- * Place an item in the vector at a specific index.
- * @param index The 0-based index into the vector.
- * @param value The half-byte value to be placed in the vector. This must be in the range
- * 0x0 thru 0xF.
- */
- public void set(final int index, final byte value) {
- validateInput(value);
- final int byteIndex = computeByteIndex(index);
- final byte oldValue = this.backingVector.get(byteIndex);
- byte newValue = 0x0;
- if (NumberUtils.isOdd(index)) {
- /* If the index is odd, place the input nibble into the low-order bits. */
- newValue = BitUtils.maskLowOrderBits(oldValue);
- newValue = (byte) (newValue | value);
- } else {
- /* If the index is even, place the input nibble into the high-order bits. */
- newValue = BitUtils.maskHighOrderBits(oldValue);
- final byte shiftedValue = (byte) (value << PrimitiveConstants.BITS_PER_NIBBLE);
- newValue = (byte) (newValue | shiftedValue);
- }
-
- this.backingVector.set(byteIndex, newValue);
- }
-
- /**
* Retrieve a value from a specific index in the vector.
* @param index The 0-based index whose value should be returned.
* @return The value at {@code index}.
@@ -177,7 +152,7 @@
*/
public byte get(final int index) {
final int byteIndex = computeByteIndex(index);
- final byte byteValue = this.backingVector.get(byteIndex);
+ final byte byteValue = this.backingVector.byteAt(byteIndex);
byte nibbleValue = 0x0;
if (NumberUtils.isOdd(index)) {
/* If the index is odd, return just the low-order bits. */
@@ -343,7 +318,22 @@
@Override
public void setNibbleAt(final int index, final byte newNibble) {
- // TODO Auto-generated method stub
+ validateInput(newNibble);
+ final int byteIndex = computeByteIndex(index);
+ final byte oldValue = this.backingVector.byteAt(byteIndex);
+ byte newValue = 0x0;
+ if (NumberUtils.isOdd(index)) {
+ /* If the index is odd, place the input nibble into the low-order bits. */
+ newValue = BitUtils.maskLowOrderBits(oldValue);
+ newValue = (byte) (newValue | newNibble);
+ } else {
+ /* If the index is even, place the input nibble into the high-order bits. */
+ newValue = BitUtils.maskHighOrderBits(oldValue);
+ final byte shiftedValue = (byte) (newNibble << PrimitiveConstants.BITS_PER_NIBBLE);
+ newValue = (byte) (newValue | shiftedValue);
+ }
+
+ this.backingVector.setByteAt(byteIndex, newValue);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 14:52:53
|
Revision: 13759
http://sourceforge.net/p/foray/code/13759
Author: victormote
Date: 2025-05-28 14:52:51 +0000 (Wed, 28 May 2025)
Log Message:
-----------
1. Conform to aXSL change: Add delete and delete range methods to mutable primitive sequence interfaces. 2. Roll up some duplicate methods in the implementations.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractIntSequenceTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayBuilderTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayBuilderTests.java
trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingVector4a.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -116,8 +116,8 @@
}
}
- this.deleted = deleted.toIntArray().asPlus();
- this.changed = changed.toIntArray().asPlus();
+ this.deleted = deleted.toImmutable().asPlus();
+ this.changed = changed.toImmutable().asPlus();
this.deltas = deltas.toString();
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -82,7 +82,7 @@
@Override
public OrderedTreePath4a next() {
final KpNode returnValue = this.nodeStack.peek();
- final OrderedTreePath4a returnPath = new OrderedTreePath4a(currentPath.toIntArray());
+ final OrderedTreePath4a returnPath = new OrderedTreePath4a(currentPath.toImmutable());
KpBranch returnParaBranch = null;
if (returnValue instanceof KpBranch) {
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -159,7 +159,7 @@
case LEAF: {
final KpLeaf leaf = (KpLeaf) node;
final int index = this.contentNodes.size();
- final OrderedTreePath4a path = new OrderedTreePath4a(currentPath.toIntArray());
+ final OrderedTreePath4a path = new OrderedTreePath4a(currentPath.toImmutable());
final LbNodeWrapper wrapper = new LbNodeWrapper(leaf, paraConfig, index, path);
this.contentNodes.add(wrapper);
break;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -99,19 +99,12 @@
this.length = 0;
}
- /**
- * Returns the number of elements used in the backing array.
- * @return The number of elements used in the backing array.
- */
+ @Override
public int length() {
return this.length;
}
- /**
- * Returns the current capacity of the backing array, i.e. the number of items that the array can hold without
- * needing to increase its size.
- * @return The currect capacity of the backing array.
- */
+ @Override
public int capacity() {
return this.backingArray.length;
}
@@ -316,10 +309,7 @@
return (minCapacity > MAX_ARRAY_SIZE) ? minCapacity : MAX_ARRAY_SIZE;
}
- /**
- * Sets the capacity of this vector equal to its size, to that there is no
- * unused capacity.
- */
+ @Override
public void trimToSize() {
if (this.length < this.backingArray.length) {
final byte[] aux = new byte[this.length];
@@ -384,10 +374,7 @@
this.length = newLength;
}
- /**
- * Resets the length of this sequence to a 0, allowing it to be reused.
- * The <em>capacity</em> of the sequence remains unchanged.
- */
+ @Override
public void clear() {
setLength(0);
}
@@ -449,4 +436,36 @@
return this.length < 1;
}
+ @Override
+ public ByteSequenceMutable deleteByteAt(final int index) {
+ if ((index < 0) || (index >= this.length)) {
+ throwIndexOutOfBoundsException(index, this.length);
+ }
+ System.arraycopy(this.backingArray, index + 1, this.backingArray, index, this.length - index - 1);
+ this.length --;
+ return this;
+ }
+
+ @Override
+ public ByteSequenceMutable delete(final int start, final int nominalEnd) {
+ if (start < 0) {
+ throwIndexOutOfBoundsException(start, this.length);
+ }
+ final int end;
+ if (nominalEnd > this.length) {
+ end = this.length;
+ } else {
+ end = nominalEnd;
+ }
+ if (start > end) {
+ throwIndexOutOfBoundsException(start, this.length);
+ }
+ final int len = end - start;
+ if (len > 0) {
+ System.arraycopy(this.backingArray, start + len, this.backingArray, start, this.length - end);
+ this.length -= len;
+ }
+ return this;
+ }
+
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -35,8 +35,7 @@
/**
* Wrapper around an array of {@link Character#TYPE}s.
- * Similar to {@link String}, but with the purpose of explicitly storing arrays of {@link Character#TYPE} as numeric
- * values instead of as characters.
+ * Similar to {@link String}.
* Like {@link String}, instances of this class are immutable.
*/
public class CharArray extends AbstractCharSequence {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -202,10 +202,7 @@
? minCapacity : MAX_ARRAY_SIZE;
}
- /**
- * Sets the capacity of this vector equal to its size, to that there is no
- * unused capacity.
- */
+ @Override
public void trimToSize() {
if (this.length < this.backingArray.length) {
final char[] aux = new char[this.length];
@@ -228,10 +225,7 @@
this.length = newLength;
}
- /**
- * Resets the length of this sequence to a 0, allowing it to be reused.
- * The <em>capacity</em> of the sequence remains unchanged.
- */
+ @Override
public void clear() {
setLength(0);
}
@@ -258,7 +252,7 @@
@Override
public CharArray toImmutable() {
- return new CharArray(this);
+ return new CharArray(toArray());
}
@Override
@@ -327,14 +321,6 @@
return this;
}
- /**
- * Returns the content of this builder as an instance of {@link CharArray}, which is immutable.
- * @return A new instance of {@link CharArray} whose contents are identical to this.
- */
- public CharArray toCharArray() {
- return new CharArray(toArray());
- }
-
@Override
public char push(final char newItem) {
append(newItem);
@@ -361,4 +347,36 @@
return this.length < 1;
}
+ @Override
+ public CharSequenceMutable deleteCharAt(final int index) {
+ if ((index < 0) || (index >= this.length)) {
+ throwIndexOutOfBoundsException(index, this.length);
+ }
+ System.arraycopy(this.backingArray, index + 1, this.backingArray, index, this.length - index - 1);
+ this.length --;
+ return this;
+ }
+
+ @Override
+ public CharSequenceMutable delete(final int start, final int nominalEnd) {
+ if (start < 0) {
+ throwIndexOutOfBoundsException(start, this.length);
+ }
+ final int end;
+ if (nominalEnd > this.length) {
+ end = this.length;
+ } else {
+ end = nominalEnd;
+ }
+ if (start > end) {
+ throwIndexOutOfBoundsException(start, this.length);
+ }
+ final int len = end - start;
+ if (len > 0) {
+ System.arraycopy(this.backingArray, start + len, this.backingArray, start, this.length - end);
+ this.length -= len;
+ }
+ return this;
+ }
+
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -152,11 +152,7 @@
this.backingArray = Arrays.copyOf(this.backingArray, newCapacity);
}
- /**
- * Append a {@link Double#TYPE} to this structure.
- * @param doubleToAppend The {@link Double#TYPE} to append.
- * @return This object.
- */
+ @Override
public DoubleArrayBuilder append(final double doubleToAppend) {
ensureCapacity(this.length + 1);
this.backingArray[this.length] = doubleToAppend;
@@ -190,12 +186,7 @@
return this;
}
- /**
- * Removes the value at a given index.
- * @param index The index whose value should be deleted.
- * @return This object.
- * @throws IndexOutOfBoundsException If the {@code index} is negative or greater than or equal to {@link #length()}.
- */
+ @Override
public DoubleArrayBuilder deleteDoubleAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
throwIndexOutOfBoundsException(index, this.length);
@@ -205,17 +196,7 @@
return this;
}
- /**
- * Removes the longs in a range of this sequence.
- * The range begins at the specified {@code start} and extends to the long at index {@code end - 1} or to the end of
- * the sequence if no such long exists.
- * If {@code start} is equal to {@code end}, no changes are made.
- * @param start The beginning index, inclusive.
- * @param end The ending index, exclusive.
- * @return This object.
- * @throws IndexOutOfBoundsException If {@code start} is negative, greater than {@link #length()}, or greater than
- * {@code end}.
- */
+ @Override
public DoubleArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
throwIndexOutOfBoundsException(start, this.length);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -152,11 +152,7 @@
this.backingArray = Arrays.copyOf(this.backingArray, newCapacity);
}
- /**
- * Append a {@link Float#TYPE} to this structure.
- * @param floatToAppend The {@link Float#TYPE} to append.
- * @return This object.
- */
+ @Override
public FloatArrayBuilder append(final float floatToAppend) {
ensureCapacity(this.length + 1);
this.backingArray[this.length] = floatToAppend;
@@ -190,12 +186,7 @@
return this;
}
- /**
- * Removes the value at a given index.
- * @param index The index whose value should be deleted.
- * @return This object.
- * @throws IndexOutOfBoundsException If the {@code index} is negative or greater than or equal to {@link #length()}.
- */
+ @Override
public FloatArrayBuilder deleteFloatAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
throwIndexOutOfBoundsException(index, this.length);
@@ -205,17 +196,7 @@
return this;
}
- /**
- * Removes the longs in a range of this sequence.
- * The range begins at the specified {@code start} and extends to the long at index {@code end - 1} or to the end of
- * the sequence if no such long exists.
- * If {@code start} is equal to {@code end}, no changes are made.
- * @param start The beginning index, inclusive.
- * @param end The ending index, exclusive.
- * @return This object.
- * @throws IndexOutOfBoundsException If {@code start} is negative, greater than {@link #length()}, or greater than
- * {@code end}.
- */
+ @Override
public FloatArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
throwIndexOutOfBoundsException(start, this.length);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -109,21 +109,13 @@
return returnArray;
}
- /**
- * Returns the current state of the array as an (immutable) {@link IntArray}.
- * @return The current state of the array.
- */
- public IntArray toIntArray() {
+ @Override
+ public IntArray toImmutable() {
final int[] theArray = toArray();
return new IntArray(theArray);
}
@Override
- public IntArray toImmutable() {
- return new IntArray(this);
- }
-
- @Override
public String toString() {
return Arrays.toString(toArray());
}
@@ -218,11 +210,7 @@
this.backingArray[index2] = temp;
}
- /**
- * Append an int to this structure.
- * @param intToAppend The int to append.
- * @return This object.
- */
+ @Override
public IntArrayBuilder append(final int intToAppend) {
ensureCapacity(this.length + 1);
this.backingArray[this.length] = intToAppend;
@@ -270,12 +258,7 @@
return this;
}
- /**
- * Removes the value at a given index.
- * @param index The index whose value should be deleted.
- * @return This object.
- * @throws IndexOutOfBoundsException If the {@code index} is negative or greater than or equal to {@link #length()}.
- */
+ @Override
public IntArrayBuilder deleteIntAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
throwIndexOutOfBoundsException(index, this.length);
@@ -285,17 +268,7 @@
return this;
}
- /**
- * Removes the ints in a range of this sequence.
- * The range begins at the specified {@code start} and extends to the int at index {@code end - 1} or to the end of
- * the sequence if no such int exists.
- * If {@code start} is equal to {@code end}, no changes are made.
- * @param start The beginning index, inclusive.
- * @param end The ending index, exclusive.
- * @return This object.
- * @throws IndexOutOfBoundsException If {@code start} is negative, greater than {@link #length()}, or greater than
- * {@code end}.
- */
+ @Override
public IntArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
throwIndexOutOfBoundsException(start, this.length);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -171,11 +171,7 @@
this.backingArray = Arrays.copyOf(this.backingArray, newCapacity);
}
- /**
- * Append a {@code long} to this structure.
- * @param longToAppend The long to append.
- * @return This object.
- */
+ @Override
public LongArrayBuilder append(final long longToAppend) {
ensureCapacity(this.length + 1);
this.backingArray[this.length] = longToAppend;
@@ -209,12 +205,7 @@
return this;
}
- /**
- * Removes the value at a given index.
- * @param index The index whose value should be deleted.
- * @return This object.
- * @throws IndexOutOfBoundsException If the {@code index} is negative or greater than or equal to {@link #length()}.
- */
+ @Override
public LongArrayBuilder deleteLongAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
throwIndexOutOfBoundsException(index, this.length);
@@ -224,17 +215,7 @@
return this;
}
- /**
- * Removes the longs in a range of this sequence.
- * The range begins at the specified {@code start} and extends to the long at index {@code end - 1} or to the end of
- * the sequence if no such long exists.
- * If {@code start} is equal to {@code end}, no changes are made.
- * @param start The beginning index, inclusive.
- * @param end The ending index, exclusive.
- * @return This object.
- * @throws IndexOutOfBoundsException If {@code start} is negative, greater than {@link #length()}, or greater than
- * {@code end}.
- */
+ @Override
public LongArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
throwIndexOutOfBoundsException(start, this.length);
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -81,10 +81,7 @@
this.backingVector = new ByteArrayBuilder(byteCapacity);
}
- /**
- * Returns the number of half-byte items in the vector.
- * @return The number of items in the vector.
- */
+ @Override
public int length() {
return this.nextIndex;
}
@@ -97,10 +94,7 @@
return this.backingVector.length();
}
- /**
- * Returns the current capacity of the vector, in half-bytes.
- * @return The currect capacity of the vector.
- */
+ @Override
public int capacity() {
return this.backingVector.capacity() * 2;
}
@@ -411,4 +405,14 @@
return null;
}
+ @Override
+ public NibbleSequenceMutable deleteNibbleAt(final int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public NibbleSequenceMutable delete(final int start, final int nominalEnd) {
+ throw new UnsupportedOperationException();
+ }
+
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -152,11 +152,7 @@
this.backingArray = Arrays.copyOf(this.backingArray, newCapacity);
}
- /**
- * Append a {@link Short#TYPE} to this structure.
- * @param shortToAppend The {@link Short#TYPE} to append.
- * @return This object.
- */
+ @Override
public ShortArrayBuilder append(final short shortToAppend) {
ensureCapacity(this.length + 1);
this.backingArray[this.length] = shortToAppend;
@@ -190,12 +186,7 @@
return this;
}
- /**
- * Removes the value at a given index.
- * @param index The index whose value should be deleted.
- * @return This object.
- * @throws IndexOutOfBoundsException If the {@code index} is negative or greater than or equal to {@link #length()}.
- */
+ @Override
public ShortArrayBuilder deleteShortAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
throwIndexOutOfBoundsException(index, this.length);
@@ -205,17 +196,7 @@
return this;
}
- /**
- * Removes the longs in a range of this sequence.
- * The range begins at the specified {@code start} and extends to the long at index {@code end - 1} or to the end of
- * the sequence if no such long exists.
- * If {@code start} is equal to {@code end}, no changes are made.
- * @param start The beginning index, inclusive.
- * @param end The ending index, exclusive.
- * @return This object.
- * @throws IndexOutOfBoundsException If {@code start} is negative, greater than {@link #length()}, or greater than
- * {@code end}.
- */
+ @Override
public ShortArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
throwIndexOutOfBoundsException(start, this.length);
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractIntSequenceTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractIntSequenceTests.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractIntSequenceTests.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -102,7 +102,7 @@
public void testIndexOf() {
indexOfAssertions(this.builder);
- final IntArray array = this.builder.toIntArray();
+ final IntArray array = this.builder.toImmutable();
indexOfAssertions(array);
}
@@ -110,7 +110,7 @@
@Test
public void testContains() {
containsAssertions(this.builder);
- containsAssertions(this.builder.toIntArray());
+ containsAssertions(this.builder.toImmutable());
}
}
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayBuilderTests.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayBuilderTests.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -97,4 +97,54 @@
}
}
+ /**
+ * Test of {@link ByteArrayBuilder#deleteByteAt(int)}.
+ */
+ @Test
+ public void testDeleteByteAt() {
+ final ByteArrayBuilder out = new ByteArrayBuilder();
+ out.append(testBytes1);
+ assertEquals(11, out.length());
+ final int capacityBefore = out.capacity();
+
+ out.deleteByteAt(4);
+ assertEquals(10, out.length());
+ assertEquals(new ByteArray("Somebytes."), out);
+
+ out.deleteByteAt(0);
+ assertEquals(9, out.length());
+ assertEquals(new ByteArray("omebytes."), out);
+
+ out.deleteByteAt(out.length() - 1);
+ assertEquals(8, out.length());
+ assertEquals(new ByteArray("omebytes"), out);
+
+ assertEquals(capacityBefore, out.capacity());
+ }
+
+ /**
+ * Test of {@link ByteArrayBuilder#delete(int, int)}.
+ */
+ @Test
+ public void testDeleteByteRange() {
+ final ByteArrayBuilder out = new ByteArrayBuilder();
+ out.append(testBytes1);
+ assertEquals(11, out.length());
+ final int capacityBefore = out.capacity();
+
+ out.delete(4, 6);
+ assertEquals(9, out.length());
+ assertEquals(new ByteArray("Someytes."), out);
+
+ out.delete(0, 2);
+ assertEquals(7, out.length());
+ assertEquals(new ByteArray("meytes."), out);
+
+ out.delete(out.length() - 2, out.length());
+ assertEquals(5, out.length());
+ assertEquals(new ByteArray("meyte"), out);
+
+ assertEquals(capacityBefore, out.capacity());
+ }
+
}
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayBuilderTests.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayBuilderTests.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -101,7 +101,7 @@
out.append(1);
out.append(2, 3, 4, 5);
final IntArray expected = new IntArray(new int[] {0, 1, 2, 3, 4, 5});
- assertEquals(expected, out.toIntArray());
+ assertEquals(expected, out.toImmutable());
}
/**
Modified: trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingVector4a.java
===================================================================
--- trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2025-05-28 11:33:50 UTC (rev 13758)
+++ trunk/foray/foray-ps-data/src/main/java/org/foray/ps/encode/EncodingVector4a.java 2025-05-28 14:52:51 UTC (rev 13759)
@@ -134,10 +134,10 @@
}
}
- this.codePoints = codePointsBuilder.toCharArray();
- this.codePointIndexes = codePointIndexesBuilder.toCharArray();
- this.codePoints2 = codePoints2Builder.toIntArray();
- this.codePointIndexes2 = codePointIndexes2Builder.toCharArray();
+ this.codePoints = codePointsBuilder.toImmutable();
+ this.codePointIndexes = codePointIndexesBuilder.toImmutable();
+ this.codePoints2 = codePoints2Builder.toImmutable();
+ this.codePointIndexes2 = codePointIndexes2Builder.toImmutable();
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 11:33:52
|
Revision: 13758
http://sourceforge.net/p/foray/code/13758
Author: victormote
Date: 2025-05-28 11:33:50 +0000 (Wed, 28 May 2025)
Log Message:
-----------
Add some debugging and testing help.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
Added Paths:
-----------
trunk/foray/foray-font/src/test/resources/00-readme.txt
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-28 09:04:45 UTC (rev 13757)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-28 11:33:50 UTC (rev 13758)
@@ -217,18 +217,45 @@
}
}
+ /**
+ * Runs the whole file through the interpreter.
+ * @return The input containing the entire font file.
+ */
+ protected PsInput getAltInput3() {
+ final ByteArrayInputStream bais =
+ new ByteArrayInputStream(this.parser.getRandomInput().getByteSequence().toArray());
+ try {
+ return new PsInputFile(bais);
+ } catch (final IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
/**
+ * Just run segment 1 through the interpreter.
+ * @return The input containing the entire font file.
+ */
+ protected PsInput getAltInput4() {
+ final ByteArrayInputStream bais = new ByteArrayInputStream(this.segments[0].content);
+ try {
+ return new PsInputFile(bais);
+ } catch (final IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ /**
* Parses the detail information from the file.
* @return The parsed font dictionary.
*/
private PsFontDictionary parseFontDictionary() {
- final boolean isAlt1 = true;
- final PsInput psInput;
- if (isAlt1) {
- psInput = getAltInput1();
- } else {
- psInput = getAltInput2();
+ final int alt = 1;
+ PsInput psInput = null;
+ switch (alt) {
+ case 1: psInput = getAltInput1(); break;
+ case 2: psInput = getAltInput2(); break;
+ case (2 + 1): psInput = getAltInput3(); break;
+ case (2 + 2): psInput = getAltInput4(); break;
}
final PsServer psServer = getParserClient().getPsServer();
PsInterpreter interpreter = null;
Added: trunk/foray/foray-font/src/test/resources/00-readme.txt
===================================================================
--- trunk/foray/foray-font/src/test/resources/00-readme.txt (rev 0)
+++ trunk/foray/foray-font/src/test/resources/00-readme.txt 2025-05-28 11:33:50 UTC (rev 13758)
@@ -0,0 +1,17 @@
+To simplify the management of tracking licenses, we have chosen to group fonts together by their source.
+For testing purposes, it would be more helpful to group them by type and other characteristics.
+The following table is intended to provide that same information.
+
+
+Source Type Typeface(s)
+------------------------- --------------------- ----------------------------------------------------------------
+ams Type 1 (AFM & PFB) Computer Modern typeface
+dejavu TrueType DejuVu
+james-kass TrueType Code2001
+scholarsfonts.net TrueType Cardo104
+simon-cozens TrueType & OpenType None -- mostly functional
+utah.edu Type 1 (AFM & PFA) Utopia
+windows-classic-samples TrueType Selawik
+
+
+# End of memo
Property changes on: trunk/foray/foray-font/src/test/resources/00-readme.txt
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java 2025-05-28 09:04:45 UTC (rev 13757)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java 2025-05-28 11:33:50 UTC (rev 13758)
@@ -38,6 +38,8 @@
import org.axsl.pdf.PdfException;
import org.axsl.primitive.sequence.ByteSequencePlus;
+import org.slf4j.LoggerFactory;
+
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
@@ -137,6 +139,7 @@
@Override
public ByteSequencePlus serialize() {
+ LoggerFactory.getLogger(this.getClass()).debug("Font name: " + this.pdfFont.getBaseFont());
final Font font = this.pdfFont.getFont();
final StringBuilder p = new StringBuilder();
p.append(this.getSerializedId() + EOL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-28 09:04:51
|
Revision: 13757
http://sourceforge.net/p/foray/code/13757
Author: victormote
Date: 2025-05-28 09:04:45 +0000 (Wed, 28 May 2025)
Log Message:
-----------
Add alternate computation of bytes to parse, for experimentation.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-27 19:45:35 UTC (rev 13756)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParser.java 2025-05-28 09:04:45 UTC (rev 13757)
@@ -32,6 +32,8 @@
import org.foray.font.format.FontParser;
import org.foray.font.format.FontParserClient;
import org.foray.primitive.sequence.ByteArray;
+import org.foray.primitive.sequence.ByteArrayBuilder;
+import org.foray.ps.PsInputFile;
import org.axsl.font.FontException;
import org.axsl.primitive.sequence.ByteSequence;
@@ -47,6 +49,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;
@@ -165,10 +168,10 @@
protected abstract Segment[] computeSegmentBoundaries() throws IOException;
/**
- * Parses the detail information from the file.
- * @return The parsed font dictionary.
+ * Existing logic.
+ * @return A PsInput instance.
*/
- private PsFontDictionary parseFontDictionary() {
+ protected PsInput getAltInput1() {
final PsInput psInput = new PsInput() {
/** Tracks which of the three segments (0-2) is currently being parsed. */
@@ -190,8 +193,43 @@
this.segmentBeingParsed ++;
return returnValue == null ? null : new ByteArray(returnValue);
}
+ };
- };
+ return psInput;
+ }
+
+ /**
+ * Creates a PsInput intended to replicate the anonymous PsInput implementation in parseFontDictionary.
+ * @return A PsInput instance.
+ */
+ protected PsInput getAltInput2() {
+ final int size = this.segments[0].size + this.segments[1].size + this.segments[2].size;
+ final ByteArrayBuilder builder = new ByteArrayBuilder(size);
+ builder.append(this.segments[0].content);
+ builder.append(this.segments[1].content);
+ builder.append(this.segments[2].content);
+ final byte[] bytes = builder.toArray();
+ final ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ try {
+ return new PsInputFile(bais);
+ } catch (final IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+
+ /**
+ * Parses the detail information from the file.
+ * @return The parsed font dictionary.
+ */
+ private PsFontDictionary parseFontDictionary() {
+ final boolean isAlt1 = true;
+ final PsInput psInput;
+ if (isAlt1) {
+ psInput = getAltInput1();
+ } else {
+ psInput = getAltInput2();
+ }
final PsServer psServer = getParserClient().getPsServer();
PsInterpreter interpreter = null;
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-27 19:45:42
|
Revision: 13756
http://sourceforge.net/p/foray/code/13756
Author: victormote
Date: 2025-05-27 19:45:35 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Remove dependency on the interpreter to obtain data from a file.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-27 19:06:46 UTC (rev 13755)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-27 19:45:35 UTC (rev 13756)
@@ -81,13 +81,11 @@
/**
* Returns the next byte from this file.
- * @param interpreter The parent interpreter.
* @return The next byte from this file.
* @throws IOException For I/O Errors.
* @throws PsOperatorException For PostScript error closing the file.
*/
- protected byte provideInput(final PsInterpreter4a interpreter) throws IOException,
- PsOperatorException {
+ protected byte provideInput() throws IOException, PsOperatorException {
if (this.chunk == null
|| this.chunk.length == 0
|| this.chunkIndex > this.chunk.length - 1) {
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-27 19:06:46 UTC (rev 13755)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-27 19:45:35 UTC (rev 13756)
@@ -391,7 +391,7 @@
}
byte byteToConsume = 0;
try {
- byteToConsume = file.provideInput(this);
+ byteToConsume = file.provideInput();
} catch (final IOException e) {
file.closeFile();
if (file.getPopDictionaryStack()) {
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-27 19:06:46 UTC (rev 13755)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-27 19:45:35 UTC (rev 13756)
@@ -1884,7 +1884,7 @@
int charsRead = 0;
for (int i = 0; i < charArray.length && file.isOpen(); i++) {
try {
- charArray[i] = (char) file.provideInput(getInterpreter());
+ charArray[i] = (char) file.provideInput();
charsRead ++;
} catch (final IOException e) {
file.closeFile();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-27 19:06:49
|
Revision: 13755
http://sourceforge.net/p/foray/code/13755
Author: victormote
Date: 2025-05-27 19:06:46 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Remove dependency on the interpreter to obtain data from a file.
Modified Paths:
--------------
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-27 17:39:01 UTC (rev 13754)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFile.java 2025-05-27 19:06:46 UTC (rev 13755)
@@ -96,7 +96,7 @@
if (this.chunk == null
|| this.chunk.length == 0
|| this.chunkIndex > this.chunk.length - 1) {
- closeFile(interpreter);
+ closeFile();
return 0x00;
}
}
@@ -113,14 +113,10 @@
/**
* Close the input file.
- * @param interpreter The parent interpreter.
* @throws PsOperatorException For error popping the dictionary stack.
*/
- protected void closeFile(final PsInterpreter4a interpreter) throws PsOperatorException {
+ protected void closeFile() throws PsOperatorException {
this.fileIsOpen = false;
- if (this.popDictionaryStack) {
- interpreter.getDictionaryStack().pop(PsOperator.INVALID);
- }
}
/**
@@ -176,6 +172,14 @@
}
/**
+ * Returns the pop dictionary stack value.
+ * @return The pop dictionary stack value.
+ */
+ public boolean getPopDictionaryStack() {
+ return this.popDictionaryStack;
+ }
+
+ /**
* Closes this file.
*/
public void close() {
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-27 17:39:01 UTC (rev 13754)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java 2025-05-27 19:06:46 UTC (rev 13755)
@@ -393,7 +393,10 @@
try {
byteToConsume = file.provideInput(this);
} catch (final IOException e) {
- file.closeFile(this);
+ file.closeFile();
+ if (file.getPopDictionaryStack()) {
+ getDictionaryStack().pop(PsOperator.INVALID);
+ }
return;
}
adjustCounters(byteToConsume);
Modified: trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
===================================================================
--- trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-27 17:39:01 UTC (rev 13754)
+++ trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java 2025-05-27 19:06:46 UTC (rev 13755)
@@ -1887,7 +1887,10 @@
charArray[i] = (char) file.provideInput(getInterpreter());
charsRead ++;
} catch (final IOException e) {
- file.closeFile(getInterpreter());
+ file.closeFile();
+ if (file.getPopDictionaryStack()) {
+ getInterpreter().getDictionaryStack().pop(PsOperator.INVALID);
+ }
}
}
final String substring = new String(charArray, 0, charsRead);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2025-05-27 17:39:05
|
Revision: 13754
http://sourceforge.net/p/foray/code/13754
Author: victormote
Date: 2025-05-27 17:39:01 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Allow access to the underlying byte sequence.
Modified Paths:
--------------
trunk/foray/foray-font-parse/src/main/java/org/foray/fontParse/ttf/TtfRandomAccessInput.java
Modified: trunk/foray/foray-font-parse/src/main/java/org/foray/fontParse/ttf/TtfRandomAccessInput.java
===================================================================
--- trunk/foray/foray-font-parse/src/main/java/org/foray/fontParse/ttf/TtfRandomAccessInput.java 2025-05-27 15:02:27 UTC (rev 13753)
+++ trunk/foray/foray-font-parse/src/main/java/org/foray/fontParse/ttf/TtfRandomAccessInput.java 2025-05-27 17:39:01 UTC (rev 13754)
@@ -247,6 +247,11 @@
return BigDecimal.ZERO;
}
+ /**
+ * Returns the underlying byte sequence.
+ * @return The byte sequence.
+ */
+ ByteSequencePlus getByteSequence();
/* Checkstyle: Restart method name checking. */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|