[FOray-commit] SF.net SVN: foray:[12867] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-12-15 04:29:07
|
Revision: 12867
http://sourceforge.net/p/foray/code/12867
Author: victormote
Date: 2022-12-15 04:29:04 +0000 (Thu, 15 Dec 2022)
Log Message:
-----------
Remove remaining dependency of foray-common on axsl-font.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/BlockTests.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -37,10 +37,10 @@
import org.foray.area.NormalFlowRa4a;
import org.foray.area.PageCollection4a;
import org.foray.area.TextArea;
-import org.foray.common.FontContext4a;
import org.axsl.font.FontException;
import org.axsl.font.FontUse;
+import org.axsl.font.zzz.FontContextMdo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -54,7 +54,7 @@
public class BlockTests extends AbstractAreaTreeTest {
/** The font options. */
- private FontContext4a fontOptionsWithKerning;
+ private FontContextMdo fontOptionsWithKerning;
/**
* Setup the fixtures needed by the test.
@@ -61,7 +61,7 @@
*/
@BeforeEach
public void setup() {
- this.fontOptionsWithKerning = new FontContext4a();
+ this.fontOptionsWithKerning = new FontContextMdo();
this.fontOptionsWithKerning.setKerning(true);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AbstractAncestralInlineArea.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,8 +28,6 @@
package org.foray.area;
-import org.foray.common.FontContext4a;
-
import org.axsl.area.AreaTreeException;
import org.axsl.font.FontContext;
import org.axsl.fotree.fo.BasicLink;
@@ -199,7 +197,7 @@
*/
public FontContext fontContext() {
/* TODO: Get this from the FOTree. */
- return FontContext4a.DEFAULT;
+ return FontContext.DEFAULT;
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -29,7 +29,6 @@
package org.foray.area;
import org.foray.area.link.Link;
-import org.foray.common.FontContext4a;
import org.axsl.area.AreaTreeException;
import org.axsl.font.FontContext;
@@ -290,7 +289,7 @@
@Override
public FontContext fontContext() {
/* TODO: Get this from the FOTree. */
- return FontContext4a.DEFAULT;
+ return FontContext.DEFAULT;
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,7 +28,6 @@
package org.foray.area;
-import org.foray.common.FontContext4a;
import org.foray.common.primitive.XmlCharacterUtils;
import org.axsl.area.AreaTreeException;
@@ -444,7 +443,7 @@
@Override
public FontContext fontContext() {
/* TODO: Get this from the FOTree. */
- return FontContext4a.DEFAULT;
+ return FontContext.DEFAULT;
}
@Override
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/FontContext4a.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -1,61 +0,0 @@
-/*
- * Copyright 2017 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common;
-
-import org.axsl.font.FontContext;
-
-/**
- * FOray implementation of {@link FontContext}.
- */
-public class FontContext4a implements FontContext {
-
- /** Indicates whether kerning should be used. */
- private boolean isKerning;
-
- /**
- * Default constructor.
- */
- public FontContext4a() {
- this.isKerning = true;
- }
-
- @Override
- public boolean isKerning() {
- return this.isKerning;
- }
-
- /**
- * Sets the isKerning value.
- * @param isKerning The new isKerning value.
- */
- public void setKerning(final boolean isKerning) {
- this.isKerning = isKerning;
- }
-
-}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,11 +28,10 @@
package org.foray.content;
-import org.foray.common.FontContext4a;
-
import org.axsl.area.LineArea;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.content.TextTokensContent;
+import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.FoTextWords;
@@ -121,7 +120,7 @@
final Orthography orthography = this.content.getOrthography();
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return getFontUse().width(chars, fontSize, FontContext4a.DEFAULT, orthography);
+ return getFontUse().width(chars, fontSize, FontContext.DEFAULT, orthography);
}
return 0;
}
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/Font4aTests.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,10 +28,10 @@
package org.foray.font;
-import org.foray.common.FontContext4a;
import org.foray.font.config.RegisteredFontContent;
import org.axsl.font.FontException;
+import org.axsl.font.zzz.FontContextMdo;
import org.axsl.ps.CharSet;
import org.axsl.ps.Encoding;
@@ -79,9 +79,9 @@
*/
@Test
public void testWidth() throws FontException {
- final FontContext4a fontOptionsWithKerning = new FontContext4a();
+ final FontContextMdo fontOptionsWithKerning = new FontContextMdo();
fontOptionsWithKerning.setKerning(true);
- final FontContext4a fontOptionsWithoutKerning = new FontContext4a();
+ final FontContextMdo fontOptionsWithoutKerning = new FontContextMdo();
fontOptionsWithoutKerning.setKerning(false);
final FontServer4a server = FontServer4aTests.getServer();
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,7 +28,6 @@
package org.foray.font.format.ttf;
-import org.foray.common.FontContext4a;
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.sequence.ByteSequenceParser;
import org.foray.font.FontServer4a;
@@ -38,6 +37,7 @@
import org.foray.font.format.ttf.OtfLookupGsubx04x01.LigatureSet;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.axsl.font.FontContext;
import org.axsl.font.FontException;
import org.axsl.orthography.Orthography;
import org.axsl.ps.Encoding;
@@ -267,7 +267,7 @@
assertArrayEquals(expectedInitialGlyphIndexes, glyphIndexes.toArray());
final TtfTableGsub gsub = ttfFont.getGsubTable();
- gsub.makeSubstitutions(glyphIndexes, FontContext4a.DEFAULT, orthography);
+ gsub.makeSubstitutions(glyphIndexes, FontContext.DEFAULT, orthography);
final int[] expectedFinalGlyphIndexes = new int[] {68, 2249, 81, 76, 87, 92};
assertArrayEquals(expectedFinalGlyphIndexes, glyphIndexes.toArray());
}
@@ -288,7 +288,7 @@
assertArrayEquals(expectedInitialGlyphIndexes, glyphIndexes.toArray());
final TtfTableGsub gsub = ttfFont.getGsubTable();
- gsub.makeSubstitutions(glyphIndexes, FontContext4a.DEFAULT, orthography);
+ gsub.makeSubstitutions(glyphIndexes, FontContext.DEFAULT, orthography);
final int[] expectedFinalGlyphIndexes = new int[] {68, 2249};
assertArrayEquals(expectedFinalGlyphIndexes, glyphIndexes.toArray());
}
@@ -320,7 +320,7 @@
assertArrayEquals(expectedInitialGlyphIndexes, glyphIndexes.toArray());
final TtfTableGsub gsub = ttfFont.getGsubTable();
- gsub.makeSubstitutions(glyphIndexes, FontContext4a.DEFAULT, orthography);
+ gsub.makeSubstitutions(glyphIndexes, FontContext.DEFAULT, orthography);
final int[] expectedFinalGlyphIndexes = new int[] {
36, 2250, 72, 70, 78, 3, // "Affleck "
68, 2249, 81, 76, 87, 92, 3, // "affinity "
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -34,7 +34,6 @@
package org.foray.pdf.util;
import org.foray.common.CharacterOutputStream;
-import org.foray.common.FontContext4a;
import org.foray.common.ps.PsColor;
import org.foray.common.ps.PsUtil;
import org.foray.pdf.PdfConstants;
@@ -44,6 +43,7 @@
import org.axsl.constants.PrimitiveConstants;
import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.font.FontUtility;
import org.axsl.graphic.output.GraphicOutputContext;
@@ -683,7 +683,7 @@
this.write(matrixString + "cm");
this.write("1 0 0 -1 0 0 Tm ");
- final CharSequence outputString = font.textToPdf(s, FontContext4a.DEFAULT, this.orthography);
+ final CharSequence outputString = font.textToPdf(s, FontContext.DEFAULT, this.orthography);
this.write(outputString);
this.write("ET");
Modified: trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
===================================================================
--- trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2022-12-15 04:15:14 UTC (rev 12866)
+++ trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java 2022-12-15 04:29:04 UTC (rev 12867)
@@ -28,7 +28,6 @@
package org.foray.pdf.object;
-import org.foray.common.FontContext4a;
import org.foray.font.ConsumerFont4a;
import org.foray.font.FontConsumer4a;
import org.foray.font.FontServer4a;
@@ -46,6 +45,7 @@
import org.foray.ps.encode.EncodingStandard;
import org.axsl.font.Font;
+import org.axsl.font.FontContext;
import org.axsl.font.FontException;
import org.axsl.font.FontUse;
import org.axsl.pdf.PdfException;
@@ -104,7 +104,7 @@
contentStream.setCursor(36, heightPoints - 36);
contentStream.openTextObject();
- contentStream.drawText("Hello World!", FontContext4a.DEFAULT, null);
+ contentStream.drawText("Hello World!", FontContext.DEFAULT, null);
contentStream.closeTextObject();
contentStream.close();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|