foray-commit Mailing List for FOray (Page 41)
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
(2) |
Dec
|
|
From: <vic...@us...> - 2022-12-16 16:51:30
|
Revision: 12876
http://sourceforge.net/p/foray/code/12876
Author: victormote
Date: 2022-12-16 16:51:27 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Conform to aXSL changes: Consolidate more XML constants.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/math/MathMlDocument4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -36,7 +36,7 @@
import org.foray.primitive.StringUtils;
import org.foray.xml.SaxParser;
-import org.axsl.fotree.FoTree;
+import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeEvent;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoTreeListener;
@@ -364,7 +364,7 @@
}
if (fobj.getName().equals("root")) {
final FoTreeException fote = new FoTreeException("Root element is missing the namespace declaration: "
- + FoTree.XSLFO_NS_URI);
+ + XmlConstants.XSLFO_NS_URI);
fote.setContextMessage(fobj.getContextMessage());
throw new SAXException(fote);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/NamespaceAxsl.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -39,7 +39,7 @@
import org.foray.fotree.axsl.prop.MetadataKey;
import org.foray.fotree.fo.obj.Declarations4a;
-import org.axsl.fotree.FoTree;
+import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeException;
import org.xml.sax.Attributes;
@@ -60,7 +60,7 @@
@Override
public String getNamespaceURI() {
- return FoTree.AXSL_NS_URI;
+ return XmlConstants.AXSL_NS_URI;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/NamespaceFo.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -388,7 +388,7 @@
import org.foray.fotree.fo.prop.PdWritingMode;
import org.foray.fotree.fo.prop.PdZindex;
-import org.axsl.fotree.FoTree;
+import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeException;
import org.xml.sax.Attributes;
@@ -409,7 +409,7 @@
@Override
public String getNamespaceURI() {
- return FoTree.XSLFO_NS_URI;
+ return XmlConstants.XSLFO_NS_URI;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/NamespaceMath.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -39,8 +39,8 @@
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
import org.foray.fotree.math.obj.InstreamMathElement;
+import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeException;
-import org.axsl.graphic.MathGraphic;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -61,7 +61,7 @@
@Override
public String getNamespaceURI() {
- return MathGraphic.MATHML_NS_URI;
+ return XmlConstants.MATHML_NS_URI;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/NamespaceSvg.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -39,8 +39,8 @@
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
import org.foray.fotree.svg.obj.InstreamSvgElement;
+import org.axsl.constants.XmlConstants;
import org.axsl.fotree.FoTreeException;
-import org.axsl.graphic.SvgGraphic;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -61,7 +61,7 @@
@Override
public String getNamespaceURI() {
- return SvgGraphic.SVG_NS_URI;
+ return XmlConstants.SVG_NS_URI;
}
@Override
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -47,6 +47,7 @@
import org.foray.graphic.output.GraphicPsFactory;
import org.foray.xml.SaxParser;
+import org.axsl.constants.XmlConstants;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.GraphicServer;
import org.axsl.graphic.MathGraphic;
@@ -306,7 +307,7 @@
@Override
public SVGDocument makeSvgDocument() throws GraphicException {
final DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
- final Document dom = impl.createDocument(SvgGraphic.SVG_NS_URI, "svg", null);
+ final Document dom = impl.createDocument(XmlConstants.SVG_NS_URI, "svg", null);
return (SVGDocument) dom;
}
@@ -405,7 +406,7 @@
public SVGDocument domToSvgDom(final Document dom) throws GraphicException {
/* Do some basic validation of the DOM document. */
final Element rootElement = dom.getDocumentElement();
- if (! MathGraphic.MATHML_NS_URI.equals(rootElement.getNamespaceURI())) {
+ if (! XmlConstants.MATHML_NS_URI.equals(rootElement.getNamespaceURI())) {
throw new GraphicException("Document is not in the MathML namespace");
}
final String rootElementName = rootElement.getLocalName();
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/math/MathMlDocument4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/math/MathMlDocument4a.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/math/MathMlDocument4a.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -30,7 +30,7 @@
import org.foray.common.MathMlUtil;
-import org.axsl.graphic.MathGraphic;
+import org.axsl.constants.XmlConstants;
import org.apache.batik.dom.GenericDocument;
import org.w3c.dom.DOMImplementation;
@@ -82,7 +82,7 @@
this.referrer = referrer;
this.domain = domain;
this.uri = uri;
- final Element root = this.createElementNS(MathGraphic.MATHML_NS_URI, MathMlUtil.MATHML_ROOT_ELEMENT_NAME);
+ final Element root = this.createElementNS(XmlConstants.MATHML_NS_URI, MathMlUtil.MATHML_ROOT_ELEMENT_NAME);
this.appendChild(root);
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -31,6 +31,7 @@
import org.foray.render.Renderer4a;
import org.axsl.constants.PrimitiveConstants;
+import org.axsl.constants.XmlConstants;
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.galley.AreaG5;
@@ -285,7 +286,7 @@
this.currentPageG.setAttributeNS(null, "transform", "translate(0,"
+ (this.totalHeight - this.pageHeight) + ")");
- final Element lastPageLink = this.svgDocument.createElementNS(SvgGraphic.SVG_NS_URI, "a");
+ final Element lastPageLink = this.svgDocument.createElementNS(XmlConstants.SVG_NS_URI, "a");
if (this.lastLink != null) {
lastPageLink.setAttributeNS(null, "xlink:href",
"#svgView(viewBox(0, " + (this.totalHeight - this.pageHeight
@@ -304,7 +305,7 @@
rect.setAttributeNS(null, "style", "fill:blue;visibility:hidden");
lastPageLink.appendChild(rect);
- this.lastLink = this.svgDocument.createElementNS(SvgGraphic.SVG_NS_URI, "a");
+ this.lastLink = this.svgDocument.createElementNS(XmlConstants.SVG_NS_URI, "a");
rect = SvgUtilities.createRect(this.svgDocument, this.pageWidth / 2, 0,
this.pageWidth / 2, this.pageHeight);
rect.setAttributeNS(null, "style", "fill:blue;visibility:hidden");
@@ -558,7 +559,7 @@
return;
}
final SVGSVGElement svg = ((SVGDocument) doc).getRootElement();
- final Element view = this.svgDocument.createElementNS(SvgGraphic.SVG_NS_URI, "svg");
+ final Element view = this.svgDocument.createElementNS(XmlConstants.SVG_NS_URI, "svg");
final Node newsvg = this.svgDocument.importNode(svg, true);
//view.setAttributeNS(null, "viewBox", "0 0 ");
view.setAttributeNS(null, "x", "" + x);
@@ -566,7 +567,7 @@
// this fixes a problem where the xmlns is repeated sometimes
final Element ele = (Element) newsvg;
- ele.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE, SvgGraphic.SVG_NS_URI);
+ ele.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE, XmlConstants.SVG_NS_URI);
if (ele.hasAttributeNS(null, XMLConstants.XMLNS_ATTRIBUTE)) {
ele.removeAttributeNS(null, XMLConstants.XMLNS_ATTRIBUTE);
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java 2022-12-16 14:58:49 UTC (rev 12875)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java 2022-12-16 16:51:27 UTC (rev 12876)
@@ -29,7 +29,6 @@
package org.foray.render.svg;
import org.axsl.constants.XmlConstants;
-import org.axsl.graphic.SvgGraphic;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -107,7 +106,7 @@
*/
public static Element createLine(final Document doc, final float x,
final float y, final float x2, final float y2) {
- final Element ellipse = doc.createElementNS(SvgGraphic.SVG_NS_URI, "line");
+ final Element ellipse = doc.createElementNS(XmlConstants.SVG_NS_URI, "line");
ellipse.setAttributeNS(null, "x1", "" + x);
ellipse.setAttributeNS(null, "x2", "" + x2);
ellipse.setAttributeNS(null, "y1", "" + y);
@@ -126,7 +125,7 @@
*/
public static Element createEllipse(final Document doc,
final float cx, final float cy, final float rx, final float ry) {
- final Element ellipse = doc.createElementNS(SvgGraphic.SVG_NS_URI, "ellipse");
+ final Element ellipse = doc.createElementNS(XmlConstants.SVG_NS_URI, "ellipse");
ellipse.setAttributeNS(null, "cx", "" + cx);
ellipse.setAttributeNS(null, "rx", "" + rx);
ellipse.setAttributeNS(null, "cy", "" + cy);
@@ -142,7 +141,7 @@
*/
public static Element createPath(final Document doc,
final String str) {
- final Element path = doc.createElementNS(SvgGraphic.SVG_NS_URI, "path");
+ final Element path = doc.createElementNS(XmlConstants.SVG_NS_URI, "path");
path.setAttributeNS(null, "d", str);
return path;
}
@@ -157,7 +156,7 @@
*/
public static Element createText(final Document doc, final float x,
final float y, final String str) {
- final Element textGraph = doc.createElementNS(SvgGraphic.SVG_NS_URI, "text");
+ final Element textGraph = doc.createElementNS(XmlConstants.SVG_NS_URI, "text");
textGraph.setAttributeNS(null, "x", "" + x);
textGraph.setAttributeNS(null, "y", "" + y);
final Text text = doc.createTextNode(str);
@@ -176,7 +175,7 @@
*/
public static Element createRect(final Document doc, final float x,
final float y, final float width, final float height) {
- final Element border = doc.createElementNS(SvgGraphic.SVG_NS_URI, "rect");
+ final Element border = doc.createElementNS(XmlConstants.SVG_NS_URI, "rect");
border.setAttributeNS(null, "x", "" + x);
border.setAttributeNS(null, "y", "" + y);
border.setAttributeNS(null, "width", "" + width);
@@ -190,7 +189,7 @@
* @return The DOM Element representing the group in SVG.
*/
public static Element createG(final Document doc) {
- final Element border = doc.createElementNS(SvgGraphic.SVG_NS_URI, "g");
+ final Element border = doc.createElementNS(XmlConstants.SVG_NS_URI, "g");
return border;
}
@@ -203,7 +202,7 @@
*/
public static Element createClip(final Document doc, final Element els,
final String id) {
- final Element border = doc.createElementNS(SvgGraphic.SVG_NS_URI, "clipPath");
+ final Element border = doc.createElementNS(XmlConstants.SVG_NS_URI, "clipPath");
border.setAttributeNS(null, "id", id);
border.appendChild(els);
return border;
@@ -219,7 +218,7 @@
*/
public static Element createImage(final Document doc,
final String ref, final float width, final float height) {
- final Element border = doc.createElementNS(SvgGraphic.SVG_NS_URI, "image");
+ final Element border = doc.createElementNS(XmlConstants.SVG_NS_URI, "image");
border.setAttributeNS(XmlConstants.XLINK_NS_URI, "xlink:href", ref);
border.setAttributeNS(null, "width", "" + width);
border.setAttributeNS(null, "height", "" + height);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-16 14:58:52
|
Revision: 12875
http://sourceforge.net/p/foray/code/12875
Author: victormote
Date: 2022-12-16 14:58:49 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Conform to aXSL changes: Remove methods for getting intrinsic dimensions.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java 2022-12-16 14:30:58 UTC (rev 12874)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestGraphic.java 2022-12-16 14:58:49 UTC (rev 12875)
@@ -38,7 +38,6 @@
import org.axsl.fotree.FoTreeException;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
@@ -69,14 +68,14 @@
/* ... which contains an SVGElement ... */
node = ifo.formattingObjectChildAt(0);
assertTrue(node instanceof InstreamSvgElement);
- final InstreamSvgElement svgElement = (InstreamSvgElement) node;
+// final InstreamSvgElement svgElement = (InstreamSvgElement) node;
- /* ... for which we can find the width and height. */
-
- /* The pixel width is 20. At the default screen resolution of 96 dpi,
- * the millipoints are (20 / 96) * 72000 = 15000. */
- assertEquals(15000, svgElement.intrinsicContentWidth());
- assertEquals(15000, svgElement.intrinsicContentHeight());
+// /* ... for which we can find the width and height. */
+//
+// /* The pixel width is 20. At the default screen resolution of 96 dpi,
+// * the millipoints are (20 / 96) * 72000 = 15000. */
+// assertEquals(15000, svgElement.intrinsicContentWidth());
+// assertEquals(15000, svgElement.intrinsicContentHeight());
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 14:30:58 UTC (rev 12874)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 14:58:49 UTC (rev 12875)
@@ -47,11 +47,14 @@
import org.axsl.fotree.fo.prop.ColorPa;
import org.axsl.fotree.fo.prop.CommonHyphenationPa;
import org.axsl.fotree.fo.prop.DominantBaselinePa;
+import org.axsl.fotree.foreign.MathElement;
+import org.axsl.fotree.foreign.SvgElement;
import org.axsl.fotree.role.NormalBlockAreaGenerator;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.Galley;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
+import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.orthography.Orthography;
import org.axsl.value.BaselineIdentifier;
@@ -60,6 +63,9 @@
import org.axsl.value.TextTransform;
import org.axsl.value.WhiteSpaceTreatment;
+import org.w3c.dom.mathml.MathMLDocument;
+import org.w3c.dom.svg.SVGDocument;
+
import java.awt.Color;
import java.util.Iterator;
import java.util.List;
@@ -962,12 +968,45 @@
@Override
public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
- return foreignXml.intrinsicContentWidth();
+ final int pixelDensity = getAreaTree().getPixelDensity();
+ try {
+ final Graphic graphic = getGraphicForForeign(foreignXml);
+ return graphic.absoluteWidth(pixelDensity);
+ } catch (final GraphicException e) {
+ return -1;
+ }
}
@Override
public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
- return foreignXml.intrinsicContentHeight();
+ final int pixelDensity = getAreaTree().getPixelDensity();
+ try {
+ final Graphic graphic = getGraphicForForeign(foreignXml);
+ return graphic.absoluteHeight(pixelDensity);
+ } catch (final GraphicException e) {
+ return -1;
+ }
}
+ /**
+ * Returns the Graphic instance that was created from a given Foreign XML instance.
+ * @param foreignXml The foreign XML.
+ * @return The graphic for {@code foreignXml}.
+ * @throws GraphicException For errors creating the graphic.
+ */
+ private Graphic getGraphicForForeign(final FoForeignXml<?> foreignXml) throws GraphicException {
+ final GraphicServer server = getAreaTree().getGraphicServer();
+ if (foreignXml instanceof MathElement) {
+ final MathElement mathElement = (MathElement) foreignXml;
+ final MathMLDocument document = mathElement.getXmlDocument();
+ return server.makeMathGraphic(document);
+ }
+ if (foreignXml instanceof SvgElement) {
+ final SvgElement svgElement = (SvgElement) foreignXml;
+ final SVGDocument document = svgElement.getXmlDocument();
+ return server.makeSvgGraphic(document);
+ }
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 14:30:58 UTC (rev 12874)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 14:58:49 UTC (rev 12875)
@@ -45,9 +45,6 @@
*/
public class InstreamMathElement extends ForeignXml<MathMLDocument> implements MathElement {
-// /** The MathML Graphic instance for this inline MathML. */
-// private MathGraphic mathGraphic;
-
/** The parsed instream document. */
private MathMLDocument document;
@@ -74,13 +71,6 @@
@Override
protected void end() throws FoTreeException {
-// final MathMLDocument mathDocument = this.getXmlDocument();
-// try {
-// this.mathGraphic = this.getGraphicServer().makeMathGraphic(
-// mathDocument);
-// } catch (final GraphicException e) {
-// this.throwException("Unable to create MathGraphic instance.");
-// }
}
@Override
@@ -93,44 +83,7 @@
return (MathMLDocument) this.getDocument();
}
-// @Override
-// public MathGraphic getMathGraphic() {
-// return this.mathGraphic;
-// }
-
@Override
- public int intrinsicContentWidth() {
- return -1;
-// if (this.getMathGraphic() == null) {
-// return 0;
-// }
-// try {
-// return this.getMathGraphic().absoluteWidth(
-// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
-// } catch (final GraphicException e) {
-// final String message = "Error getting MathML width: " + e.getMessage();
-// getFoTree().logError(this.getMessageWithContext(message));
-// }
-// return -1;
- }
-
- @Override
- public int intrinsicContentHeight() {
- return -1;
-// if (this.getMathGraphic() == null) {
-// return 0;
-// }
-// try {
-// return this.getMathGraphic().absoluteHeight(
-// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
-// } catch (final GraphicException e) {
-// final String message = "Error getting MathML height: " + e.getMessage();
-// getFoTree().logError(this.getMessageWithContext(message));
-// }
-// return -1;
- }
-
- @Override
public <T> T acceptVisitor(final FoVisitor<T> visitor) {
return visitor.visit(this);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 14:30:58 UTC (rev 12874)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 14:58:49 UTC (rev 12875)
@@ -45,9 +45,6 @@
*/
public class InstreamSvgElement extends ForeignXml<SVGDocument> implements SvgElement {
-// /** The SVG Graphic instance for this inline SVG. */
-// private SvgGraphic svgGraphic;
-
/** The parsed instream document. */
private SVGDocument document;
@@ -74,13 +71,6 @@
@Override
protected void end() throws FoTreeException {
-// final SVGDocument svgDocument = getXmlDocument();
-// try {
-// this.svgGraphic = this.getGraphicServer().makeSvgGraphic(
-// svgDocument);
-// } catch (final GraphicException e) {
-// this.throwException("Unable to create SvgGraphic instance.");
-// }
}
@Override
@@ -93,38 +83,7 @@
return this.document;
}
-// @Override
-// public SvgGraphic getSvgGraphic() {
-// return this.svgGraphic;
-// }
-
@Override
- public int intrinsicContentWidth() {
- return -1;
-// try {
-// return this.getSvgGraphic().absoluteWidth(
-// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
-// } catch (final GraphicException e) {
-// final String message = "Error getting SVG width: " + e.getMessage();
-// getFoTree().logError(this.getMessageWithContext(message));
-// }
-// return -1;
- }
-
- @Override
- public int intrinsicContentHeight() {
- return -1;
-// try {
-// return this.getSvgGraphic().absoluteHeight(
-// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
-// } catch (final GraphicException e) {
-// final String message = "Error getting SVG height: " + e.getMessage();
-// getFoTree().logError(this.getMessageWithContext(message));
-// }
-// return -1;
- }
-
- @Override
public <T> T acceptVisitor(final FoVisitor<T> visitor) {
return visitor.visit(this);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-16 14:31:01
|
Revision: 12874
http://sourceforge.net/p/foray/code/12874
Author: victormote
Date: 2022-12-16 14:30:58 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Conform to aXSL changes: Remove methods returning the Graphic implementations.
Modified Paths:
--------------
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/SvgArea.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-areatree/build.gradle 2022-12-16 14:30:58 UTC (rev 12874)
@@ -7,6 +7,9 @@
description = 'foray-areatree'
dependencies {
+ api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
+ api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+
api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
api (group: "org.axsl", name: "axsl-font", version: versions.axsl)
api (group: "org.axsl", name: "axsl-fotree", version: versions.axsl)
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/MathArea.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -30,6 +30,7 @@
import org.axsl.fotree.foreign.MathElement;
import org.axsl.galley.ForeignContentMathG5;
+import org.axsl.graphic.GraphicException;
import org.axsl.graphic.MathGraphic;
/**
@@ -66,7 +67,12 @@
@Override
public MathGraphic getGraphic() {
- return this.foLink.getMathGraphic();
+ try {
+ return this.parent.getAreaTree().getGraphicServer().makeMathGraphic(this.foLink.getXmlDocument());
+ } catch (final GraphicException e) {
+ this.parent.getAreaTree().logError(e.getMessage());
+ return null;
+ }
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/SvgArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/SvgArea.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/SvgArea.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -31,6 +31,7 @@
import org.axsl.fotree.foreign.SvgElement;
import org.axsl.galley.ForeignContentSvgG5;
import org.axsl.galley.ForeignObjectAreaG5;
+import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
/**
@@ -67,7 +68,12 @@
@Override
public SvgGraphic getGraphic() {
- return this.foLink.getSvgGraphic();
+ try {
+ return this.parent.getAreaTree().getGraphicServer().makeSvgGraphic(this.foLink.getXmlDocument());
+ } catch (final GraphicException e) {
+ this.parent.getAreaTree().logError(e.getMessage());
+ return null;
+ }
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -138,9 +138,7 @@
* Returns the DOM Document accumulated within this foreign XML.
* @return The DOM Document.
*/
- public Document getDocument() {
- return this.domDocument;
- }
+ public abstract D getDocument();
@Override
public String getName() {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -28,7 +28,6 @@
package org.foray.fotree.math.obj;
-import org.foray.common.ForayConstants;
import org.foray.fotree.ForeignXml;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyListUnparsed;
@@ -38,7 +37,6 @@
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.foreign.MathElement;
import org.axsl.graphic.GraphicException;
-import org.axsl.graphic.MathGraphic;
import org.w3c.dom.mathml.MathMLDocument;
@@ -47,9 +45,12 @@
*/
public class InstreamMathElement extends ForeignXml<MathMLDocument> implements MathElement {
- /** The MathML Graphic instance for this inline MathML. */
- private MathGraphic mathGraphic;
+// /** The MathML Graphic instance for this inline MathML. */
+// private MathGraphic mathGraphic;
+ /** The parsed instream document. */
+ private MathMLDocument document;
+
/**
* Constructor.
* @param parent The parent FoObj.
@@ -56,8 +57,8 @@
* @param propertyList The property list for this FoObj.
* @throws FoTreeException For errors during construction.
*/
- public InstreamMathElement(final InstreamForeignObject4a parent,
- final PropertyListUnparsed propertyList) throws FoTreeException {
+ public InstreamMathElement(final InstreamForeignObject4a parent, final PropertyListUnparsed propertyList)
+ throws FoTreeException {
super(parent, propertyList);
}
@@ -64,7 +65,8 @@
@Override
protected MathMLDocument createDOMDocument() throws FoTreeException {
try {
- return this.getGraphicServer().makeMathDocument();
+ this.document = getGraphicServer().makeMathDocument();
+ return this.document;
} catch (final GraphicException e) {
throw new FoTreeException(e);
}
@@ -72,13 +74,13 @@
@Override
protected void end() throws FoTreeException {
- final MathMLDocument mathDocument = this.getXmlDocument();
- try {
- this.mathGraphic = this.getGraphicServer().makeMathGraphic(
- mathDocument);
- } catch (final GraphicException e) {
- this.throwException("Unable to create MathGraphic instance.");
- }
+// final MathMLDocument mathDocument = this.getXmlDocument();
+// try {
+// this.mathGraphic = this.getGraphicServer().makeMathGraphic(
+// mathDocument);
+// } catch (final GraphicException e) {
+// this.throwException("Unable to create MathGraphic instance.");
+// }
}
@Override
@@ -91,39 +93,41 @@
return (MathMLDocument) this.getDocument();
}
- @Override
- public MathGraphic getMathGraphic() {
- return this.mathGraphic;
- }
+// @Override
+// public MathGraphic getMathGraphic() {
+// return this.mathGraphic;
+// }
@Override
public int intrinsicContentWidth() {
- if (this.getMathGraphic() == null) {
- return 0;
- }
- try {
- return this.getMathGraphic().absoluteWidth(
- ForayConstants.DEFAULT_SCREEN_RESOLUTION);
- } catch (final GraphicException e) {
- final String message = "Error getting MathML width: " + e.getMessage();
- getFoTree().logError(this.getMessageWithContext(message));
- }
return -1;
+// if (this.getMathGraphic() == null) {
+// return 0;
+// }
+// try {
+// return this.getMathGraphic().absoluteWidth(
+// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
+// } catch (final GraphicException e) {
+// final String message = "Error getting MathML width: " + e.getMessage();
+// getFoTree().logError(this.getMessageWithContext(message));
+// }
+// return -1;
}
@Override
public int intrinsicContentHeight() {
- if (this.getMathGraphic() == null) {
- return 0;
- }
- try {
- return this.getMathGraphic().absoluteHeight(
- ForayConstants.DEFAULT_SCREEN_RESOLUTION);
- } catch (final GraphicException e) {
- final String message = "Error getting MathML height: " + e.getMessage();
- getFoTree().logError(this.getMessageWithContext(message));
- }
return -1;
+// if (this.getMathGraphic() == null) {
+// return 0;
+// }
+// try {
+// return this.getMathGraphic().absoluteHeight(
+// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
+// } catch (final GraphicException e) {
+// final String message = "Error getting MathML height: " + e.getMessage();
+// getFoTree().logError(this.getMessageWithContext(message));
+// }
+// return -1;
}
@Override
@@ -133,7 +137,7 @@
@Override
public boolean isValid() {
- return this.mathGraphic != null;
+ return this.document != null;
}
@Override
@@ -156,4 +160,9 @@
return false;
}
+ @Override
+ public MathMLDocument getDocument() {
+ return this.document;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -28,7 +28,6 @@
package org.foray.fotree.svg.obj;
-import org.foray.common.ForayConstants;
import org.foray.fotree.ForeignXml;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyListUnparsed;
@@ -38,7 +37,6 @@
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.foreign.SvgElement;
import org.axsl.graphic.GraphicException;
-import org.axsl.graphic.SvgGraphic;
import org.w3c.dom.svg.SVGDocument;
@@ -47,9 +45,12 @@
*/
public class InstreamSvgElement extends ForeignXml<SVGDocument> implements SvgElement {
- /** The SVG Graphic instance for this inline SVG. */
- private SvgGraphic svgGraphic;
+// /** The SVG Graphic instance for this inline SVG. */
+// private SvgGraphic svgGraphic;
+ /** The parsed instream document. */
+ private SVGDocument document;
+
/**
* Constructor.
* @param parent The parent FoObj.
@@ -56,8 +57,8 @@
* @param propertyList The property list for this FoObj.
* @throws FoTreeException For errors during construction.
*/
- public InstreamSvgElement(final InstreamForeignObject4a parent,
- final PropertyListUnparsed propertyList) throws FoTreeException {
+ public InstreamSvgElement(final InstreamForeignObject4a parent, final PropertyListUnparsed propertyList)
+ throws FoTreeException {
super(parent, propertyList);
}
@@ -64,7 +65,8 @@
@Override
protected SVGDocument createDOMDocument() throws FoTreeException {
try {
- return this.getGraphicServer().makeSvgDocument();
+ this.document = getGraphicServer().makeSvgDocument();
+ return this.document;
} catch (final GraphicException e) {
throw new FoTreeException(e);
}
@@ -72,13 +74,13 @@
@Override
protected void end() throws FoTreeException {
- final SVGDocument svgDocument = getXmlDocument();
- try {
- this.svgGraphic = this.getGraphicServer().makeSvgGraphic(
- svgDocument);
- } catch (final GraphicException e) {
- this.throwException("Unable to create SvgGraphic instance.");
- }
+// final SVGDocument svgDocument = getXmlDocument();
+// try {
+// this.svgGraphic = this.getGraphicServer().makeSvgGraphic(
+// svgDocument);
+// } catch (final GraphicException e) {
+// this.throwException("Unable to create SvgGraphic instance.");
+// }
}
@Override
@@ -88,36 +90,38 @@
@Override
public SVGDocument getXmlDocument() {
- return (SVGDocument) this.getDocument();
+ return this.document;
}
- @Override
- public SvgGraphic getSvgGraphic() {
- return this.svgGraphic;
- }
+// @Override
+// public SvgGraphic getSvgGraphic() {
+// return this.svgGraphic;
+// }
@Override
public int intrinsicContentWidth() {
- try {
- return this.getSvgGraphic().absoluteWidth(
- ForayConstants.DEFAULT_SCREEN_RESOLUTION);
- } catch (final GraphicException e) {
- final String message = "Error getting SVG width: " + e.getMessage();
- getFoTree().logError(this.getMessageWithContext(message));
- }
return -1;
+// try {
+// return this.getSvgGraphic().absoluteWidth(
+// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
+// } catch (final GraphicException e) {
+// final String message = "Error getting SVG width: " + e.getMessage();
+// getFoTree().logError(this.getMessageWithContext(message));
+// }
+// return -1;
}
@Override
public int intrinsicContentHeight() {
- try {
- return this.getSvgGraphic().absoluteHeight(
- ForayConstants.DEFAULT_SCREEN_RESOLUTION);
- } catch (final GraphicException e) {
- final String message = "Error getting SVG height: " + e.getMessage();
- getFoTree().logError(this.getMessageWithContext(message));
- }
return -1;
+// try {
+// return this.getSvgGraphic().absoluteHeight(
+// ForayConstants.DEFAULT_SCREEN_RESOLUTION);
+// } catch (final GraphicException e) {
+// final String message = "Error getting SVG height: " + e.getMessage();
+// getFoTree().logError(this.getMessageWithContext(message));
+// }
+// return -1;
}
@Override
@@ -127,7 +131,7 @@
@Override
public boolean isValid() {
- return this.svgGraphic != null;
+ return this.document != null;
}
@Override
@@ -150,4 +154,9 @@
return false;
}
+ @Override
+ public SVGDocument getDocument() {
+ return this.document;
+ }
+
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java 2022-12-16 04:20:46 UTC (rev 12873)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GraphicServer4a.java 2022-12-16 14:30:58 UTC (rev 12874)
@@ -100,26 +100,26 @@
private String svgParserClassName;
/** Collection of standard GraphicFactory instances that can be used. */
- private List<GraphicFactory> standardFactories
- = new ArrayList<GraphicFactory>();
+ private List<GraphicFactory> standardFactories = new ArrayList<GraphicFactory>();
/** Collection of custom GraphicFactory instances that can be used. */
- private List<GraphicFactory> customFactories
- = new ArrayList<GraphicFactory>();
+ private List<GraphicFactory> customFactories = new ArrayList<GraphicFactory>();
- /**
- * If graphic caching is enabled, this collection caches graphic objects for
- * reuse. A String containing the image location as the key, and the
- * Graphic instance is the value.
- */
+ /** The collection of cached graphic objects built from a URL.
+ * The URL to the graphic image location as the key, and the Graphic instance is the value. */
private Map<URL, Graphic4a> urlMap = new HashMap<URL, Graphic4a>();
- /**
- * Map of registered {@link GraphicOutputFactory} instances.
- */
- private Map<String, GraphicOutputFactory> graphicOutputFactories
- = new HashMap<String, GraphicOutputFactory>();
+ /** The collection of cached graphic objects built directly from an XML {@link SVGDocument}.
+ * The {@link SVGDocument} is the key, and the {@link SvgGraphic} instance is the value. */
+ private Map<SVGDocument, SvgGraphic> svgDocumentMap = new HashMap<SVGDocument, SvgGraphic>();
+ /** The collection of cached graphic objects built directly from an XML {@link MathMLDocument}.
+ * The {@link MathMLDocument} is the key, and the {@link MathGraphic} instance is the value. */
+ private Map<MathMLDocument, MathGraphic> mathDocumentMap = new HashMap<MathMLDocument, MathGraphic>();
+
+ /** Map of registered {@link GraphicOutputFactory} instances. */
+ private Map<String, GraphicOutputFactory> graphicOutputFactories = new HashMap<String, GraphicOutputFactory>();
+
/**
* Constructor.
*/
@@ -279,9 +279,13 @@
}
@Override
- public SvgGraphic makeSvgGraphic(final SVGDocument svgDocument)
- throws GraphicException {
- return new org.foray.graphic.SvgGraphic(this, svgDocument);
+ public SvgGraphic makeSvgGraphic(final SVGDocument svgDocument) throws GraphicException {
+ SvgGraphic existing = this.svgDocumentMap.get(svgDocument);
+ if (existing == null) {
+ existing = new org.foray.graphic.SvgGraphic(this, svgDocument);
+ this.svgDocumentMap.put(svgDocument, existing);
+ }
+ return existing;
}
/**
@@ -383,9 +387,13 @@
}
@Override
- public MathGraphic makeMathGraphic(final MathMLDocument mathDocument)
- throws GraphicException {
- return new MathGraphic4a(this, mathDocument);
+ public MathGraphic makeMathGraphic(final MathMLDocument mathDocument) throws GraphicException {
+ MathGraphic existing = this.mathDocumentMap.get(mathDocument);
+ if (existing == null) {
+ existing = new MathGraphic4a(this, mathDocument);
+ this.mathDocumentMap.put(mathDocument, existing);
+ }
+ return existing;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-16 04:20:54
|
Revision: 12873
http://sourceforge.net/p/foray/code/12873
Author: victormote
Date: 2022-12-16 04:20:46 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Add FoForeignXml method to return the XML Document that was parsed.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -961,12 +961,12 @@
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
return foreignXml.intrinsicContentWidth();
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
return foreignXml.intrinsicContentHeight();
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ForeignObjectArea.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -123,7 +123,7 @@
newFoArea.viewportBPD());
// Create the reference area for the content.
- final FoForeignXml foreign = generatedBy.getForeignXml();
+ final FoForeignXml<?> foreign = generatedBy.getForeignXml();
if (foreign instanceof SvgElement) {
final SvgElement svgElement = (SvgElement) foreign;
final SvgArea svgArea = SvgArea.makeSvgArea(svgElement, newFoArea);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -240,7 +240,7 @@
* Set a flag indicating that we are currently processing foreign XML.
* @param foreign The foreign XML item that we are currently processing.
*/
- public void activateForeignXML(final ForeignXml foreign) {
+ public void activateForeignXML(final ForeignXml<?> foreign) {
this.treeBuilder.activateForeignXML(foreign);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -92,7 +92,7 @@
private List<FoTreeListener> foTreeListeners = new ArrayList<FoTreeListener>();
/** Indicates whether we are currently inside foreign XML. */
- private ForeignXml activeForeignXML = null;
+ private ForeignXml<?> activeForeignXML = null;
/** The parent server. */
private FoTreeServer4a server;
@@ -459,7 +459,7 @@
* Set a flag indicating that we are currently processing foreign XML.
* @param foreign The foreign XML item that we are currently processing.
*/
- public void activateForeignXML(final ForeignXml foreign) {
+ public void activateForeignXML(final ForeignXml<?> foreign) {
this.activeForeignXML = foreign;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -30,6 +30,7 @@
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
+import org.axsl.fotree.FoForeignXml;
import org.axsl.fotree.FoTreeException;
import org.w3c.dom.Document;
@@ -59,9 +60,11 @@
* All other elements of the foreign XML are added to the DOM instance, which
* is encapsulated in the ForeignXml instance.</p>
*
+ * @param <D> The type of XML document contained in this object.
+ *
* @see InstreamForeignObject4a
*/
-public abstract class ForeignXml extends FoObj implements org.axsl.fotree.FoForeignXml {
+public abstract class ForeignXml<D extends Document> extends FoObj implements FoForeignXml<D> {
/** The parent of this node. */
private InstreamForeignObject4a parent;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -34,6 +34,7 @@
import org.foray.fotree.PropertyList;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoForeignXml;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.InstreamForeignObject;
@@ -50,7 +51,7 @@
private FoObj parent;
/** The children of this object. */
- private List<ForeignXml> children = new ArrayList<ForeignXml>(1);
+ private List<ForeignXml<?>> children = new ArrayList<ForeignXml<?>>(1);
/**
* Constructor.
@@ -102,7 +103,7 @@
}
@Override
- public org.axsl.fotree.FoForeignXml getForeignXml() {
+ public FoForeignXml<?> getForeignXml() {
/* Existence is verified in validateDescendants(). */
return getChildren().get(0);
}
@@ -118,7 +119,7 @@
}
@Override
- public List<ForeignXml> getChildren() {
+ public List<ForeignXml<?>> getChildren() {
return this.children;
}
@@ -128,7 +129,7 @@
child.throwException(getFullName() + " child must be a supported "
+ "type of foreign xml.");
}
- final ForeignXml foreignXmlChild = (ForeignXml) child;
+ final ForeignXml<?> foreignXmlChild = (ForeignXml<?>) child;
this.getChildren().add(foreignXmlChild);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/math/obj/InstreamMathElement.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -45,7 +45,7 @@
/**
* The content of an instream Math (MathML) document.
*/
-public class InstreamMathElement extends ForeignXml implements MathElement {
+public class InstreamMathElement extends ForeignXml<MathMLDocument> implements MathElement {
/** The MathML Graphic instance for this inline MathML. */
private MathGraphic mathGraphic;
@@ -72,7 +72,7 @@
@Override
protected void end() throws FoTreeException {
- final MathMLDocument mathDocument = this.getMathMLDocument();
+ final MathMLDocument mathDocument = this.getXmlDocument();
try {
this.mathGraphic = this.getGraphicServer().makeMathGraphic(
mathDocument);
@@ -86,11 +86,8 @@
return this.getFoTree().getMathNamespace();
}
- /**
- * Returns the MathML Document.
- * @return The MathML Document.
- */
- private MathMLDocument getMathMLDocument() {
+ @Override
+ public MathMLDocument getXmlDocument() {
return (MathMLDocument) this.getDocument();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/svg/obj/InstreamSvgElement.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -36,6 +36,7 @@
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
+import org.axsl.fotree.foreign.SvgElement;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
@@ -44,7 +45,7 @@
/**
* The content of an inline SVG document.
*/
-public class InstreamSvgElement extends ForeignXml implements org.axsl.fotree.foreign.SvgElement {
+public class InstreamSvgElement extends ForeignXml<SVGDocument> implements SvgElement {
/** The SVG Graphic instance for this inline SVG. */
private SvgGraphic svgGraphic;
@@ -71,7 +72,7 @@
@Override
protected void end() throws FoTreeException {
- final SVGDocument svgDocument = this.getSVGDocument();
+ final SVGDocument svgDocument = getXmlDocument();
try {
this.svgGraphic = this.getGraphicServer().makeSvgGraphic(
svgDocument);
@@ -85,11 +86,8 @@
return this.getFoTree().getSVGNamespace();
}
- /**
- * Returns the SVGDocument.
- * @return The SVGDocument.
- */
- private SVGDocument getSVGDocument() {
+ @Override
+ public SVGDocument getXmlDocument() {
return (SVGDocument) this.getDocument();
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -154,12 +154,12 @@
return -1;
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
/* We don't care about this for now. */
return -1;
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
/* We don't care about this for now. */
return -1;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-16 03:49:14 UTC (rev 12872)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-16 04:20:46 UTC (rev 12873)
@@ -200,12 +200,12 @@
}
@Override
- public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ public int getIntrinsicWidth(final FoForeignXml<?> foreignXml) {
return this.wrappedContext.getIntrinsicWidth(foreignXml);
}
@Override
- public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ public int getIntrinsicHeight(final FoForeignXml<?> foreignXml) {
return this.wrappedContext.getIntrinsicHeight(foreignXml);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-16 03:49:24
|
Revision: 12872
http://sourceforge.net/p/foray/code/12872
Author: victormote
Date: 2022-12-16 03:49:14 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Intermediate steps toward disentangling axsl-graphic from axsl-fotree.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -36,6 +36,7 @@
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTreeException;
import org.axsl.area.factory.BlockLevelAreaFactory;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
@@ -49,9 +50,12 @@
import org.axsl.fotree.role.NormalBlockAreaGenerator;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.Galley;
+import org.axsl.graphic.Graphic;
+import org.axsl.graphic.GraphicException;
import org.axsl.i18n.Script;
import org.axsl.orthography.Orthography;
import org.axsl.value.BaselineIdentifier;
+import org.axsl.value.FoPropertyConstants;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
import org.axsl.value.WhiteSpaceTreatment;
@@ -924,26 +928,46 @@
@Override
public int getIntrinsicWidth(final ExternalGraphic externalGraphic) {
- // TODO Auto-generated method stub
- return 0;
+ final Graphic graphic = externalGraphic.getGraphic(this);
+ if (graphic == null) {
+ return FoPropertyConstants.DIMENSION_AUTO;
+ }
+ try {
+ final int pixelDensity = getAreaTree().getPixelDensity();
+ if (graphic.absoluteWidth(pixelDensity) > 0) {
+ return graphic.absoluteWidth(pixelDensity);
+ }
+ return TypographicConstants.pixelsToMillipoints(graphic.pixelWidth(), pixelDensity);
+ } catch (final GraphicException e) {
+ return FoPropertyConstants.DIMENSION_AUTO;
+ }
}
@Override
public int getIntrinsicHeight(final ExternalGraphic externalGraphic) {
- // TODO Auto-generated method stub
- return 0;
+ final Graphic graphic = externalGraphic.getGraphic(this);
+ if (graphic == null) {
+ return FoPropertyConstants.DIMENSION_AUTO;
+ }
+ try {
+ final int pixelDensity = getAreaTree().getPixelDensity();
+ if (graphic.absoluteHeight(pixelDensity) > 0) {
+ return graphic.absoluteHeight(pixelDensity);
+ }
+ return TypographicConstants.pixelsToMillipoints(graphic.pixelHeight(), pixelDensity);
+ } catch (final GraphicException e) {
+ return FoPropertyConstants.DIMENSION_AUTO;
+ }
}
@Override
public int getIntrinsicWidth(final FoForeignXml foreignXml) {
- // TODO Auto-generated method stub
- return 0;
+ return foreignXml.intrinsicContentWidth();
}
@Override
public int getIntrinsicHeight(final FoForeignXml foreignXml) {
- // TODO Auto-generated method stub
- return 0;
+ return foreignXml.intrinsicContentHeight();
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -33,6 +33,7 @@
import org.foray.area.link.NormalLink;
import org.foray.area.metadata.BookmarkTreeNode4a;
import org.foray.area.metadata.DocumentMetadata4a;
+import org.foray.common.ForayConstants;
import org.axsl.area.AreaTree;
import org.axsl.area.AreaTreeException;
@@ -90,6 +91,9 @@
/** The list of markers in this document. */
private List<Marker> documentMarkers = new ArrayList<Marker>();
+ /** Pixel density to be used as a fallback value for intrinsic size computations. */
+ private int pixelDensity = ForayConstants.DEFAULT_SCREEN_RESOLUTION;
+
/* Checkstyle-IllegalType-Off: This class depends on certain
* capabilities of ArrayList that are not part of the List interface. */
/** The list of FoLinkage items for the nodes in the FOTree.
@@ -500,4 +504,13 @@
return this.graphicServer;
}
+ /**
+ * Returns the pixel density to be used when computing actual sizes based on intrinsic sizes expressed in pixels.
+ * @return The pixel density, expressed in pixels per inch.
+ */
+
+ public int getPixelDensity() {
+ return this.pixelDensity;
+ }
+
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -62,8 +62,7 @@
@Override
public int inlineSizeOptimum(final int lineLength) {
- /* TODO: Fix this method after we add the context to this class. */
- return this.content.viewportIpd(null);
+ return this.content.viewportIpd(getContext());
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -238,20 +238,6 @@
this.stringBuilder.append(data, start, length);
}
- /**
- * Returns the intrinsic content width of the foreign XML item.
- * @return The intrinsic content width of the foreign XML item,
- * in millipoints.
- */
- public abstract int intrinsicContentWidth();
-
- /**
- * Returns the intrinsic content height of the foreign XML item.
- * @return The intrinsic content height of the foreign XML item,
- * in millipoints.
- */
- public abstract int intrinsicContentHeight();
-
@Override
public InstreamForeignObject4a getParent() {
return this.parent;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.ForayConstants;
import org.foray.common.url.UrlUtil;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
@@ -40,7 +39,6 @@
import org.axsl.fotree.fo.ExternalGraphic;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.value.FoPropertyConstants;
import java.net.MalformedURLException;
import java.net.URI;
@@ -61,10 +59,6 @@
* repeatedly, e.g. in a page header or footer. */
private Graphic graphic;
- /** Pixel density to be used as a fallback value for intrinsic size
- * computations. */
- private int pixelsPerInch = ForayConstants.DEFAULT_SCREEN_RESOLUTION;
-
/** Set to true if we have already attempted to set #graphic with a
* resolved value. If makeGraphicAttempted is true and #graphic is null,
* then the Graphic could not be resolved. */
@@ -137,38 +131,6 @@
}
@Override
- public int intrinsicContentWidth(final FoContext context) {
- if (getGraphic(context) == null) {
- return FoPropertyConstants.DIMENSION_AUTO;
- }
- try {
- if (getGraphic(context).absoluteWidth(this.pixelsPerInch) > 0) {
- return getGraphic(context).absoluteWidth(this.pixelsPerInch);
- }
- return pixelsToMillipoints(getGraphic(context).pixelWidth(),
- this.pixelsPerInch);
- } catch (final GraphicException e) {
- return FoPropertyConstants.DIMENSION_AUTO;
- }
- }
-
- @Override
- public int intrinsicContentHeight(final FoContext context) {
- if (getGraphic(context) == null) {
- return FoPropertyConstants.DIMENSION_AUTO;
- }
- try {
- if (getGraphic(context).absoluteHeight(this.pixelsPerInch) > 0) {
- return getGraphic(context).absoluteHeight(this.pixelsPerInch);
- }
- return pixelsToMillipoints(getGraphic(context).pixelHeight(),
- this.pixelsPerInch);
- } catch (final GraphicException e) {
- return FoPropertyConstants.DIMENSION_AUTO;
- }
- }
-
- @Override
public <T> T acceptVisitor(final FoVisitor<T> visitor) {
return visitor.visit(this);
}
@@ -228,4 +190,14 @@
return true;
}
+ @Override
+ public int getIntrinsicWidth(final FoContext context) {
+ return context.getIntrinsicWidth(this);
+ }
+
+ @Override
+ public int getIntrinsicHeight(final FoContext context) {
+ return context.getIntrinsicHeight(this);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -31,7 +31,6 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
-import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoScalable;
import org.axsl.value.FoPropertyConstants;
@@ -55,24 +54,6 @@
this.propertyList = propertyList;
}
- /**
- * Returns the width of the content.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return The width, in millipoints, of the content of this object, as
- * reported by the content itself.
- */
- public abstract int intrinsicContentWidth(FoContext context);
-
- /**
- * Returns the height of the content.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return The height, in millipoints, of the content of this object, as
- * reported by the content itself.
- */
- public abstract int intrinsicContentHeight(FoContext context);
-
@Override
public int viewportIpd(final FoContext context) {
/* See XSL-FO Standard 1.0, Section 6.6.5 and 6.6.6, Subsection
@@ -89,7 +70,7 @@
* However, the documentation on the fo:external-graphic and
* fo:instream-foreign-object say that the "content size" should be
* used, and then define it. */
- final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final int intrinsicWidth = getIntrinsicWidth(context);
/* We already know that the viewport IPD is dependent on the
* content-width.
@@ -109,7 +90,7 @@
} else {
/* We can use the other dimension to compute this one. */
final int viewportBpd = this.viewportBpd(context);
- final int intrinsicHeight = this.intrinsicContentWidth(context);
+ final int intrinsicHeight = getIntrinsicWidth(context);
final float widthToHeight = (float) intrinsicWidth
/ (float) intrinsicHeight;
return Math.round(widthToHeight * viewportBpd);
@@ -125,8 +106,7 @@
/**
* Indicates whether the viewport IPD for this graphic can be computed
* independent of the viewport BPD.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
+ * @param context An object that knows how to resolve FO Tree context issues.
* @return True if and only if the viewport BPD needs to be computed before the IPD
* can be.
*/
@@ -157,7 +137,7 @@
* However, the documentation on the fo:external-graphic and
* fo:instream-foreign-object say that the "content size" should be
* used, and then define it. */
- final int intrinsicHeight = this.intrinsicContentHeight(context);
+ final int intrinsicHeight = getIntrinsicHeight(context);
/* We already know that the viewport BPD is dependent on the
* content-height.
@@ -177,7 +157,7 @@
} else {
/* We can use the other dimension to compute this one. */
final int viewportIpd = this.viewportIpd(context);
- final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final int intrinsicWidth = getIntrinsicWidth(context);
final float heightToWidth = (float) intrinsicHeight
/ (float) intrinsicWidth;
return Math.round(heightToWidth * viewportIpd);
@@ -187,7 +167,7 @@
/* The content-height is not dependent on the viewport BPD, so we can
* compute it first, then use it to compute the viewport BPD. */
final float scalingFactor = this.getContentHeight(context, this);
- return Math.round(this.intrinsicContentHeight(context) * scalingFactor);
+ return Math.round(getIntrinsicHeight(context) * scalingFactor);
}
/**
@@ -209,22 +189,9 @@
return false;
}
- /**
- * Converts a quantity of pixels to a length in millipoints, using the
- * value passed in pixelsPerInch.
- * @param pixels The quantity of pixels to be converted to millipoints.
- * @param pixelsPerInch The resolution, in pixels-per-inch, at which the
- * conversion should take place.
- * @return The millipoint equivalent of pixels.
- */
- public static int pixelsToMillipoints(final int pixels, final int pixelsPerInch) {
- return pixels * TypographicConstants.POINTS_PER_INCH
- * TypographicConstants.MILLIPOINTS_PER_POINT / pixelsPerInch;
- }
-
@Override
public int referenceIpd(final FoContext context) {
- final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final int intrinsicWidth = getIntrinsicWidth(context);
final float scaling = this.getContentWidth(context, this);
return Math.round(intrinsicWidth * scaling);
}
@@ -231,7 +198,7 @@
@Override
public int referenceBpd(final FoContext context) {
- final int intrinsicHeight = this.intrinsicContentHeight(context);
+ final int intrinsicHeight = getIntrinsicHeight(context);
final float scaling = this.getContentHeight(context, this);
return Math.round(intrinsicHeight * scaling);
}
@@ -241,4 +208,18 @@
return this.propertyList;
}
+ /**
+ * Returns the intrinsic width of the scalable content.
+ * @param context An object that knows how to resolve FO Tree context issues.
+ * @return The intrinsic width of this.
+ */
+ public abstract int getIntrinsicWidth(FoContext context);
+
+ /**
+ * Returns the intrinsic height of the scalable content.
+ * @param context An object that knows how to resolve FO Tree context issues.
+ * @return The intrinsic height of this.
+ */
+ public abstract int getIntrinsicHeight(FoContext context);
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -108,16 +108,6 @@
}
@Override
- public int intrinsicContentWidth(final FoContext context) {
- return ((ForeignXml) getForeignXml()).intrinsicContentWidth();
- }
-
- @Override
- public int intrinsicContentHeight(final FoContext context) {
- return ((ForeignXml) getForeignXml()).intrinsicContentHeight();
- }
-
- @Override
public <T> T acceptVisitor(final FoVisitor<T> visitor) {
return visitor.visit(this);
}
@@ -182,4 +172,14 @@
return true;
}
+ @Override
+ public int getIntrinsicWidth(final FoContext context) {
+ return context.getIntrinsicWidth(this.getForeignXml());
+ }
+
+ @Override
+ public int getIntrinsicHeight(final FoContext context) {
+ return context.getIntrinsicHeight(this.getForeignXml());
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -34,6 +34,8 @@
import org.foray.fotree.fo.obj.FoScalable4a;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.fo.ExternalGraphic;
+import org.axsl.fotree.fo.InstreamForeignObject;
/**
* The "content-height" property in XSL-FO.
@@ -67,9 +69,15 @@
}
@Override
- protected int intrinsicContentDimension(final FoScalable4a fobjScaled,
- final FoContext context) {
- return fobjScaled.intrinsicContentHeight(context);
+ protected int intrinsicContentDimension(final FoScalable4a fobjScaled, final FoContext context) {
+ if (fobjScaled instanceof ExternalGraphic) {
+ return context.getIntrinsicHeight((ExternalGraphic) fobjScaled);
+ }
+ if (fobjScaled instanceof InstreamForeignObject) {
+ final InstreamForeignObject ifo = (InstreamForeignObject) fobjScaled;
+ context.getIntrinsicHeight(ifo.getForeignXml());
+ }
+ throw new IllegalStateException("Unexpected FO: " + fobjScaled.getClass().getName());
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java 2022-12-16 02:26:03 UTC (rev 12871)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java 2022-12-16 03:49:14 UTC (rev 12872)
@@ -34,6 +34,8 @@
import org.foray.fotree.fo.obj.FoScalable4a;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.fo.ExternalGraphic;
+import org.axsl.fotree.fo.InstreamForeignObject;
/**
* The "content-width" property in XSL-FO.
@@ -67,9 +69,15 @@
}
@Override
- protected int intrinsicContentDimension(final FoScalable4a fobjScaled,
- final FoContext context) {
- return fobjScaled.intrinsicContentWidth(context);
+ protected int intrinsicContentDimension(final FoScalable4a fobjScaled, final FoContext context) {
+ if (fobjScaled instanceof ExternalGraphic) {
+ return context.getIntrinsicWidth((ExternalGraphic) fobjScaled);
+ }
+ if (fobjScaled instanceof InstreamForeignObject) {
+ final InstreamForeignObject ifo = (InstreamForeignObject) fobjScaled;
+ context.getIntrinsicWidth(ifo.getForeignXml());
+ }
+ throw new IllegalStateException("Unexpected FO: " + fobjScaled.getClass().getName());
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-16 02:26:06
|
Revision: 12871
http://sourceforge.net/p/foray/code/12871
Author: victormote
Date: 2022-12-16 02:26:03 +0000 (Fri, 16 Dec 2022)
Log Message:
-----------
Rough-in implementations of new methods for the FoContext to return the width and height of graphical FOs.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-15 12:18:52 UTC (rev 12870)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-16 02:26:03 UTC (rev 12871)
@@ -39,6 +39,8 @@
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
+import org.axsl.fotree.FoForeignXml;
+import org.axsl.fotree.fo.ExternalGraphic;
import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.fotree.fo.Table;
import org.axsl.fotree.fo.prop.ColorPa;
@@ -920,4 +922,28 @@
return -1;
}
+ @Override
+ public int getIntrinsicWidth(final ExternalGraphic externalGraphic) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getIntrinsicHeight(final ExternalGraphic externalGraphic) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-15 12:18:52 UTC (rev 12870)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-16 02:26:03 UTC (rev 12871)
@@ -31,7 +31,9 @@
import org.foray.fotree.fo.obj.Root4a;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoForeignXml;
import org.axsl.fotree.FoInlineContext;
+import org.axsl.fotree.fo.ExternalGraphic;
import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
@@ -141,6 +143,26 @@
/* We don't care about this for now. */
return -1;
}
+ @Override
+ public int getIntrinsicWidth(final ExternalGraphic externalGraphic) {
+ /* We don't care about this for now. */
+ return -1;
+ }
+ @Override
+ public int getIntrinsicHeight(final ExternalGraphic externalGraphic) {
+ /* We don't care about this for now. */
+ return -1;
+ }
+ @Override
+ public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ /* We don't care about this for now. */
+ return -1;
+ }
+ @Override
+ public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ /* We don't care about this for now. */
+ return -1;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-15 12:18:52 UTC (rev 12870)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-16 02:26:03 UTC (rev 12871)
@@ -29,6 +29,8 @@
package org.foray.pioneer;
import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoForeignXml;
+import org.axsl.fotree.fo.ExternalGraphic;
import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
@@ -187,4 +189,24 @@
return this.wrappedContext.fontXheight(fontSize);
}
+ @Override
+ public int getIntrinsicWidth(final ExternalGraphic externalGraphic) {
+ return this.wrappedContext.getIntrinsicWidth(externalGraphic);
+ }
+
+ @Override
+ public int getIntrinsicHeight(final ExternalGraphic externalGraphic) {
+ return this.wrappedContext.getIntrinsicHeight(externalGraphic);
+ }
+
+ @Override
+ public int getIntrinsicWidth(final FoForeignXml foreignXml) {
+ return this.wrappedContext.getIntrinsicWidth(foreignXml);
+ }
+
+ @Override
+ public int getIntrinsicHeight(final FoForeignXml foreignXml) {
+ return this.wrappedContext.getIntrinsicHeight(foreignXml);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-15 12:19:00
|
Revision: 12870
http://sourceforge.net/p/foray/code/12870
Author: victormote
Date: 2022-12-15 12:18:52 +0000 (Thu, 15 Dec 2022)
Log Message:
-----------
Fix dependencies lost from cleanup of aXSL dependencies.
Modified Paths:
--------------
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-core/build.gradle
trunk/foray/foray-output/build.gradle
trunk/foray/foray-pioneer/build.gradle
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
+++ trunk/foray/foray-areatree/build.gradle 2022-12-15 12:18:52 UTC (rev 12870)
@@ -22,6 +22,7 @@
api (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
api (group: "org.axsl", name: "axsl-value", version: versions.axsl)
implementation (group: "org.axsl", name: "axsl-constants", version: versions.axsl)
+ implementation (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
api (project(':foray-common'))
implementation (project(':foray-primitive'))
Modified: trunk/foray/foray-core/build.gradle
===================================================================
--- trunk/foray/foray-core/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
+++ trunk/foray/foray-core/build.gradle 2022-12-15 12:18:52 UTC (rev 12870)
@@ -18,6 +18,7 @@
api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (project(':foray-common'))
api (project(':foray-xml'))
Modified: trunk/foray/foray-output/build.gradle
===================================================================
--- trunk/foray/foray-output/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
+++ trunk/foray/foray-output/build.gradle 2022-12-15 12:18:52 UTC (rev 12870)
@@ -6,6 +6,7 @@
description = 'foray-output'
dependencies {
+ implementation (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
Modified: trunk/foray/foray-pioneer/build.gradle
===================================================================
--- trunk/foray/foray-pioneer/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
+++ trunk/foray/foray-pioneer/build.gradle 2022-12-15 12:18:52 UTC (rev 12870)
@@ -6,8 +6,8 @@
description = 'foray-pioneer'
dependencies {
- api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-context', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-15 05:54:59
|
Revision: 12869
http://sourceforge.net/p/foray/code/12869
Author: victormote
Date: 2022-12-15 05:54:56 +0000 (Thu, 15 Dec 2022)
Log Message:
-----------
Clean up some build-time classpath issues.
Modified Paths:
--------------
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-mif/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-xml/build.gradle
trunk/foray/foray-zz-attic/build.gradle
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-areatree/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -24,6 +24,7 @@
implementation (group: "org.axsl", name: "axsl-constants", version: versions.axsl)
api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
}
javadoc {
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-common/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -9,17 +9,16 @@
dependencies {
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- api (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
+ implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api project(':foray-primitive')
+ implementation project(':foray-primitive')
}
javadoc {
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-font/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -19,6 +19,7 @@
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
api (project(':foray-xml'))
testRuntimeOnly (project(':foray-ps'))
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-fotree/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -28,8 +28,9 @@
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api project(':foray-common')
- api project(':foray-xml')
+ api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
+ api (project(':foray-xml'))
}
javadoc {
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-graphic/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -30,6 +30,7 @@
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
implementation (project(':foray-xml'))
}
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-linebreak/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -11,6 +11,7 @@
api (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
testImplementation (project(':foray-orthography'))
testImplementation (group: "org.axsl", name: "axsl-font", version: versions.axsl)
Modified: trunk/foray/foray-mif/build.gradle
===================================================================
--- trunk/foray/foray-mif/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-mif/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -6,6 +6,7 @@
description = 'foray-mif'
dependencies {
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-pdf/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -19,6 +19,7 @@
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
testImplementation (project(':foray-font'))
testImplementation (project(":foray-ps"))
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-ps/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -14,6 +14,7 @@
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
implementation (project(':foray-common'))
+ implementation (project(':foray-primitive'))
testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
}
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-render/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -20,6 +20,7 @@
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
implementation (project(':foray-common'))
+ implementation (project(':foray-primitive'))
api (project(':foray-output'))
}
Modified: trunk/foray/foray-xml/build.gradle
===================================================================
--- trunk/foray/foray-xml/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-xml/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -12,6 +12,7 @@
implementation (group: 'org.apache.ws.xmlschema', name: 'xmlschema-core', version: '2.3.0')
implementation (project(':foray-common'))
+ implementation (project(':foray-primitive'))
}
javadoc {
Modified: trunk/foray/foray-zz-attic/build.gradle
===================================================================
--- trunk/foray/foray-zz-attic/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
+++ trunk/foray/foray-zz-attic/build.gradle 2022-12-15 05:54:56 UTC (rev 12869)
@@ -12,7 +12,8 @@
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api ((project(':foray-common')))
+ api (project(':foray-common'))
+ implementation (project(':foray-primitive'))
}
javadoc {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-15 04:48:23
|
Revision: 12868
http://sourceforge.net/p/foray/code/12868
Author: victormote
Date: 2022-12-15 04:48:20 +0000 (Thu, 15 Dec 2022)
Log Message:
-----------
Remove foray-common dependency on axsl-font. Clean up related font-related code on foray-fotree that had leaked through because of foray-fotree dependency on foray-common.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java
trunk/foray/foray-common/build.gradle
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/ForaySpecific.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -97,8 +97,7 @@
final FontServer fontServer = ForaySpecific.makeFontServer(sessionConfig);
final FoOrthographyServer hyphenServer = ForaySpecific.makeOrthographyServer(sessionConfig);
final GraphicServer graphicServer = ForaySpecific.makeGraphicServer();
- final FoTreeFactory foTreeServer = ForaySpecific.makeFOTreeFactory(sessionConfig, fontServer, graphicServer,
- hyphenServer);
+ final FoTreeFactory foTreeServer = ForaySpecific.makeFOTreeFactory(sessionConfig, graphicServer, hyphenServer);
final AreaTreeFactory areaTreeFactory = ForaySpecific.makeAreaTreeFactory();
final LineBreakerFactory lbFactory = ForaySpecific.makeLineBreakerFactory();
final LayoutFactory layoutFactory = ForaySpecific.makeLayoutFactory(lbFactory);
@@ -180,7 +179,6 @@
/**
* Make a standard FOTreeFactory instance for use in FOray.
* @param configuration The session configuration.
- * @param fontServer The FontServer instance to use.
* @param graphicServer The GraphicServer instance to use.
* @param hyphenationServer The hyphenation server.
* @return The newly-created FOTreeFactory instance.
@@ -188,12 +186,11 @@
*/
public static FoTreeFactory makeFOTreeFactory(
final SessionConfig configuration,
- final FontServer fontServer,
final GraphicServer graphicServer,
final FoOrthographyServer hyphenationServer)
throws ForayException {
final URL[] graphicSearchPath = buildGraphicSearchPath(configuration);
- return new FoTreeServer4a(fontServer, hyphenationServer, graphicServer, graphicSearchPath,
+ return new FoTreeServer4a(hyphenationServer, graphicServer, graphicSearchPath,
configuration.optionCacheGraphics());
}
Modified: trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java
===================================================================
--- trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -36,7 +36,6 @@
import org.foray.fotree.FoTreeParser4a;
import org.foray.fotree.FoTreeServer4a;
-import org.axsl.font.FontServer;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
@@ -86,11 +85,9 @@
final SessionConfig sessionConfig = Mockito.mock(SessionConfig.class);
Mockito.when(sessionConfig.optionOrthographyConfiguration()).thenReturn(orthographyFile);
- FontServer fontServer = null;
final GraphicServer graphicServer = Mockito.mock(GraphicServer.class);
FoOrthographyServer orthographyServer = null;
try {
- fontServer = ForaySpecific.makeFontServer(sessionConfig);
orthographyServer = ForaySpecific.makeOrthographyServer(sessionConfig);
} catch (final ForayException e) {
fail(e.getMessage());
@@ -106,8 +103,7 @@
}
final boolean cachingGraphics = false;
- this.treeServer = new FoTreeServer4a(fontServer, orthographyServer, graphicServer, graphicSearchPath,
- cachingGraphics);
+ this.treeServer = new FoTreeServer4a(orthographyServer, graphicServer, graphicSearchPath, cachingGraphics);
}
/**
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-common/build.gradle 2022-12-15 04:48:20 UTC (rev 12868)
@@ -16,7 +16,6 @@
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeServer4a.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -36,7 +36,6 @@
import org.foray.fotree.svg.NamespaceSvg;
import org.foray.fotree.xml.NamespaceXml;
-import org.axsl.font.FontServer;
import org.axsl.fotree.FoTreeFactory;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
@@ -54,9 +53,6 @@
*/
public class FoTreeServer4a implements FoTreeFactory {
- /** The font server. */
- private FontServer fontServer;
-
/** The graphic server. */
private GraphicServer graphicServer;
@@ -94,7 +90,6 @@
/**
* Constructor.
- * @param fontServer The font server.
* @param orthographyServer The hyphenation server.
* @param graphicServer The graphic server.
* @param graphicSearchPath The array of URLs in which graphics should be
@@ -103,12 +98,10 @@
* reuse.
*/
public FoTreeServer4a(
- final FontServer fontServer,
final FoOrthographyServer orthographyServer,
final GraphicServer graphicServer,
final URL[] graphicSearchPath,
final boolean cachingGraphics) {
- this.fontServer = fontServer;
this.graphicServer = graphicServer;
this.orthographyServer = orthographyServer;
this.graphicSearchPath = graphicSearchPath;
@@ -268,14 +261,6 @@
}
/**
- * Returns the font server.
- * @return The font server.
- */
- public FontServer getFontServer() {
- return this.fontServer;
- }
-
- /**
* Returns the graphic server.
* @return The graphic server.
*/
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -231,7 +231,6 @@
import org.foray.fotree.xml.prop.Lang;
import org.foray.primitive.StringUtils;
-import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
import org.axsl.graphic.Graphic;
@@ -4501,35 +4500,6 @@
}
/**
- * Converts an FO-oriented font-selection-strategy to a font-oriented font-selection-strategy.
- * @param parsedFontSelectionStrategy The FO-oriented font-selection-strategy.
- * @return The equivalent font-oriented font-selection-strategy.
- */
- public static Font.SelectionStrategy convertFontSelectionStrategy(final FoValue parsedFontSelectionStrategy) {
- switch(parsedFontSelectionStrategy) {
- case CHARACTER_BY_CHARACTER: return Font.SelectionStrategy.CHARACTER_BY_CHARACTER;
- case AUTO: return Font.SelectionStrategy.AUTO;
- default: break;
- }
- return Font.SelectionStrategy.AUTO;
- }
-
- /**
- * Converts an FO-oriented font-style to a font-oriented font-style.
- * @param parsedFontStyle The FO-oriented font-style.
- * @return The equivalent font-oriented font-style.
- */
- public static Font.Style convertFontStyle(final FoValue parsedFontStyle) {
- switch (parsedFontStyle) {
- case NORMAL: return Font.Style.NORMAL;
- case ITALIC: return Font.Style.ITALIC;
- case OBLIQUE: return Font.Style.OBLIQUE;
- case BACKSLANT: return Font.Style.BACKSLANT;
- default: return Font.Style.NORMAL;
- }
- }
-
- /**
* Returns the number of properties in this list.
* @return The number of properties in this list.
*/
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -162,7 +162,7 @@
/**
* Returns the initial (default) value for this property when there is no
* value to inherit.
- * @return The initial value, {@link org.axsl.font.Font.Stretch#NORMAL NORMAL}.
+ * @return The initial value, {@link FontStretch#NORMAL}.
*/
public static FontStretch getInitialValue() {
return FontStretch.NORMAL;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -35,7 +35,6 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
import org.axsl.value.FontWeight;
@@ -86,8 +85,7 @@
* @return The parsed, storable property value.
* @throws PropertyException For an invalid property value.
*/
- private PropertyValue createPropertyValue(final FoObj fobj,
- final String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final FoObj fobj, final String value) throws PropertyException {
final PropertyValue pv = standardParse(fobj, value);
if (pv.canEvalKeyword()) {
return pv;
@@ -94,7 +92,7 @@
}
if (pv.canEvalInteger()) {
final int integer = pv.evalInteger();
- if (Font.Weight.isValidNumericWeight(integer)) {
+ if (FontWeight.isValidNumericWeight(integer)) {
return pv;
}
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-15 04:29:04 UTC (rev 12867)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-15 04:48:20 UTC (rev 12868)
@@ -30,9 +30,6 @@
import org.foray.fotree.fo.obj.Root4a;
-import org.axsl.font.FontConsumer;
-import org.axsl.font.FontSelectionConstraints;
-import org.axsl.font.FontServer;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
import org.axsl.fotree.fo.GraftingPoint;
@@ -159,11 +156,7 @@
* @return The newly-created FoObj.
*/
protected static final FoObj makeTestFObj() {
- final FontConsumer fontConsumer = Mockito.mock(FontConsumer.class);
- final FontServer fontServer = Mockito.mock(FontServer.class);
- Mockito.when(fontServer.makeFontConsumer(Mockito.any(FontSelectionConstraints.class))).thenReturn(fontConsumer);
final FoTreeServer4a server = Mockito.mock(FoTreeServer4a.class);
- Mockito.when(server.getFontServer()).thenReturn(fontServer);
final FoTreeParser4a foTreeBuilder = new FoTreeParser4a(server, null);
final FoTree4a foTree = new FoTree4a(null, foTreeBuilder);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <vic...@us...> - 2022-12-15 04:15:16
|
Revision: 12866
http://sourceforge.net/p/foray/code/12866
Author: victormote
Date: 2022-12-15 04:15:14 +0000 (Thu, 15 Dec 2022)
Log Message:
-----------
Remove one dependency of foray-common on axsl-font.
Modified Paths:
--------------
trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
trunk/foray/foray-common/build.gradle
trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java
trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java
Modified: trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
===================================================================
--- trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -31,7 +31,6 @@
import org.foray.area.AreaTree4a;
import org.foray.area.AreaTreeFactory4a;
import org.foray.area.PageCollection4a;
-import org.foray.common.FontSelectionConstraints4a;
import org.foray.core.ForayException;
import org.foray.core.SessionConfig;
import org.foray.fotree.FoTree4a;
@@ -42,6 +41,7 @@
import org.axsl.area.AreaTreeException;
import org.axsl.font.FontServer;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.fotree.FoTreeException;
import org.axsl.graphic.GraphicServer;
import org.axsl.linebreak.LineBreakerFactory;
@@ -116,7 +116,7 @@
}
final Root4a root = foTree.getRootFo();
final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, this.fontServer,
- FontSelectionConstraints4a.FREE_STANDING_ONLY, this.graphicServer);
+ FontSelectionConstraintsMdo.FREE_STANDING_ONLY, this.graphicServer);
final PioneerLayoutStrategy layout = this.layoutFactory.makeLayout();
final Iterator<PageSequence4a> iterator = root.getPageSequenceIterator();
while (iterator.hasNext()) {
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-common/build.gradle 2022-12-15 04:15:14 UTC (rev 12866)
@@ -15,6 +15,7 @@
api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/FontSelectionConstraints4a.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -1,74 +0,0 @@
-/*
- * Copyright 2022 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.FontSelectionConstraints;
-
-/**
- * Foray implementation of {@link FontSelectionConstraints}.
- * Instances of this class are immutable.
- */
-public final class FontSelectionConstraints4a implements FontSelectionConstraints {
-
- /** Instance indicating that there are no constraints. */
- public static final FontSelectionConstraints4a NO_CONSTRAINTS = new FontSelectionConstraints4a(true, true);
-
- /** Instance indicating that only free-standing fonts should be selected. */
- public static final FontSelectionConstraints4a FREE_STANDING_ONLY = new FontSelectionConstraints4a(true, false);
-
- /** Instance indicating that only system fonts should be selected. */
- public static final FontSelectionConstraints4a SYSTEM_ONLY = new FontSelectionConstraints4a(false, true);
-
- /** Indicates whether free-standing fonts can be selected. */
- private boolean canSelectFreeStandingFonts;
-
- /** Indicates whether system fonts can be selected. */
- private boolean canSelectSystemFonts;
-
- /**
- * Constructor.
- * @param canSelectFreeStandingFonts Indicates whether free-standing fonts can be selected.
- * @param canSelectSystemFonts Indicates whether system fonts can be selected.
- */
- public FontSelectionConstraints4a(final boolean canSelectFreeStandingFonts, final boolean canSelectSystemFonts) {
- this.canSelectFreeStandingFonts = canSelectFreeStandingFonts;
- this.canSelectSystemFonts = canSelectSystemFonts;
- }
-
- @Override
- public boolean canSelectFreeStandingFonts() {
- return this.canSelectFreeStandingFonts;
- }
-
- @Override
- public boolean canSelectSystemFonts() {
- return this.canSelectSystemFonts;
- }
-
-}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontConsumer4a.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.FontSelectionConstraints4a;
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.config.RegisteredFontFamily;
@@ -40,6 +39,7 @@
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontUse;
import org.axsl.font.Panose;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.ps.Encoding;
import org.slf4j.Logger;
@@ -130,7 +130,7 @@
*/
public FontConsumer4a(final FontServer4a server, final FontSelectionConstraints selectionConstraints) {
this.server = server;
- this.selectionConstraints = selectionConstraints == null ? FontSelectionConstraints4a.NO_CONSTRAINTS
+ this.selectionConstraints = selectionConstraints == null ? FontSelectionConstraintsMdo.NO_CONSTRAINTS
: selectionConstraints;
}
Modified: trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java
===================================================================
--- trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-output/src/main/java/org/foray/output/MifConverter.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -28,9 +28,8 @@
package org.foray.output;
-import org.foray.common.FontSelectionConstraints4a;
-
import org.axsl.font.FontSelectionConstraints;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.Block;
import org.axsl.fotree.fo.Table;
@@ -260,7 +259,7 @@
@Override
public FontSelectionConstraints getFontSelectionConstraints() {
- return FontSelectionConstraints4a.FREE_STANDING_ONLY;
+ return FontSelectionConstraintsMdo.FREE_STANDING_ONLY;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/PrintRenderer.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -28,10 +28,9 @@
package org.foray.render;
-import org.foray.common.FontSelectionConstraints4a;
-
import org.axsl.font.Font;
import org.axsl.font.FontSelectionConstraints;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.galley.BorderPaddingAreaG5;
import org.axsl.galley.GlyphAreaSequenceG5;
import org.axsl.galley.LeaderAreaG5;
@@ -242,7 +241,7 @@
@Override
public FontSelectionConstraints getFontSelectionConstraints() {
- return FontSelectionConstraints4a.FREE_STANDING_ONLY;
+ return FontSelectionConstraintsMdo.FREE_STANDING_ONLY;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -39,7 +39,6 @@
package org.foray.render.awt;
-import org.foray.common.FontSelectionConstraints4a;
import org.foray.common.Mime;
import org.foray.common.url.UrlFactory;
import org.foray.render.Renderer4a;
@@ -47,6 +46,7 @@
import org.axsl.constants.NumericConstants;
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontUse;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.galley.BorderPaddingAreaG5;
import org.axsl.galley.ExternalGraphicAreaG5;
import org.axsl.galley.ForeignContentMathG5;
@@ -828,7 +828,7 @@
@Override
public FontSelectionConstraints getFontSelectionConstraints() {
- return FontSelectionConstraints4a.NO_CONSTRAINTS;
+ return FontSelectionConstraintsMdo.NO_CONSTRAINTS;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -28,11 +28,11 @@
package org.foray.render.svg;
-import org.foray.common.FontSelectionConstraints4a;
import org.foray.render.Renderer4a;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.FontSelectionConstraints;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.galley.AreaG5;
import org.axsl.galley.BorderPaddingAreaG5;
import org.axsl.galley.ExternalGraphicAreaG5;
@@ -620,7 +620,7 @@
@Override
public FontSelectionConstraints getFontSelectionConstraints() {
- return FontSelectionConstraints4a.SYSTEM_ONLY;
+ return FontSelectionConstraintsMdo.SYSTEM_ONLY;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-12-14 20:00:51 UTC (rev 12865)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java 2022-12-15 04:15:14 UTC (rev 12866)
@@ -33,7 +33,6 @@
package org.foray.render.xml;
-import org.foray.common.FontSelectionConstraints4a;
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.render.Renderer4a;
@@ -40,6 +39,7 @@
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.Font;
import org.axsl.font.FontSelectionConstraints;
+import org.axsl.font.zzz.FontSelectionConstraintsMdo;
import org.axsl.galley.AreaG5;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.BackgroundAreaG5;
@@ -468,7 +468,7 @@
@Override
public FontSelectionConstraints getFontSelectionConstraints() {
- return FontSelectionConstraints4a.FREE_STANDING_ONLY;
+ return FontSelectionConstraintsMdo.FREE_STANDING_ONLY;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 20:00:54
|
Revision: 12865
http://sourceforge.net/p/foray/code/12865
Author: victormote
Date: 2022-12-14 20:00:51 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove axsl-fotree dependency on axsl-font.
Modified Paths:
--------------
trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkTitleArea4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
===================================================================
--- trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2022-12-14 20:00:51 UTC (rev 12865)
@@ -293,6 +293,7 @@
<property name="severity" value="ignore"/>
</module>
<module name="CyclomaticComplexity">
+ <property name="switchBlockAsSingleDecisionPoint" value="true"/>
<property name="severity" value="ignore"/>
</module>
<module name="NPathComplexity">
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -32,6 +32,7 @@
import org.foray.primitive.StringUtils;
import org.axsl.area.Area;
+import org.axsl.area.AreaTree;
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockLevelRa;
import org.axsl.constants.TypographicConstants;
@@ -52,6 +53,11 @@
import org.axsl.value.BackgroundRepeat;
import org.axsl.value.BorderStyle;
import org.axsl.value.CardinalRotation;
+import org.axsl.value.FontSelectionStrategy;
+import org.axsl.value.FontStretch;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontVariant;
+import org.axsl.value.FontWeight;
import org.axsl.value.LinkType;
import org.axsl.value.RelativeAxis;
import org.axsl.value.WritingMode;
@@ -1224,17 +1230,30 @@
* test. */
firstChar = ' ';
}
+
+ /* Resolve the FO Tree values. */
+ final FontSelectionStrategy foStrategy = foNeedingFont.traitFontSelectionStrategy(this);
+ final List<String> foFontFamily = foNeedingFont.traitFontFamily(this);
+ final FontStyle foStyle = foNeedingFont.traitFontStyle(this);
+ final FontWeight foWeight = foNeedingFont.traitFontWeight(this);
+ final FontVariant foVariant = foNeedingFont.traitFontVariant(this);
+ final FontStretch foStretch = foNeedingFont.traitFontStretch(this);
+ final int foFontSize = foNeedingFont.traitFontSize(this);
+
+ /* Convert the FO Tree values to Font values. */
+ final Font.SelectionStrategy fontSelectionStrategy = AreaTree.fontSelectionStrategyFromFo(foStrategy);
+ final Font.Style fontStyle = AreaTree.fontStyleFromFo(foStyle);
+ final Font.Weight fontWeight = AreaTree.fontWeightFromFo(foWeight);
+ final Font.Variant fontVariant = AreaTree.fontVariantFromFo(foVariant);
+ final Font.Stretch fontStretch = AreaTree.fontStretchFromFo(foStretch);
+
+
+
+
+
final FontConsumer fontConsumer = getAreaTree().getFontConsumer();
- final Font.SelectionStrategy strategy = foNeedingFont.traitFontSelectionStrategy(this);
- final List<String> fontFamily = foNeedingFont.traitFontFamily(this);
- final Font.Style style = foNeedingFont.traitFontStyle(this);
- final Font.Weight weight = foNeedingFont.traitFontWeight(this);
- final Font.Variant variant = foNeedingFont.traitFontVariant(this);
- final Font.Stretch stretch = foNeedingFont.traitFontStretch(this);
- final int size = foNeedingFont.traitFontSize(this);
-
- final FontUse resolvedFont = fontConsumer.selectFontXsl(strategy, fontFamily, style, weight, variant, stretch,
- size, firstChar);
+ final FontUse resolvedFont = fontConsumer.selectFontXsl(fontSelectionStrategy, foFontFamily, fontStyle,
+ fontWeight, fontVariant, fontStretch, foFontSize, firstChar);
if (resolvedFont == null) {
getAreaTree().logError("Error creating Font.\n" + ((Fo) foNeedingFont).getContextMessage());
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkNode4a.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -32,7 +32,6 @@
import org.foray.area.link.Link;
import org.axsl.area.AreaTreeException;
-import org.axsl.font.Font;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.Bookmark;
import org.axsl.fotree.fo.BookmarkTitle;
@@ -39,6 +38,8 @@
import org.axsl.galley.metadata.BookmarkG5;
import org.axsl.galley.render.GalleyVisitor;
import org.axsl.galley.render.GalleyVisitorException;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontWeight;
import org.axsl.value.StartingState;
import java.awt.Color;
@@ -150,12 +151,12 @@
}
@Override
- public Font.Weight traitFontWeight() {
+ public FontWeight traitFontWeight() {
return this.getBookmarkTitle().traitGeneratedBy().traitFontWeight(null);
}
@Override
- public Font.Style traitFontStyle() {
+ public FontStyle traitFontStyle() {
return this.getBookmarkTitle().traitGeneratedBy().traitFontStyle(null);
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkTitleArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkTitleArea4a.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/BookmarkTitleArea4a.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -28,8 +28,9 @@
package org.foray.area.metadata;
-import org.axsl.font.Font;
import org.axsl.fotree.fo.BookmarkTitle;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontWeight;
import java.awt.Color;
@@ -104,7 +105,7 @@
* used.
* @return The font weight constant for this area.
*/
- public Font.Weight traitFontWeight() {
+ public FontWeight traitFontWeight() {
return traitGeneratedBy().traitFontWeight(null);
}
@@ -112,7 +113,7 @@
* Returns the font style (normal, italic, etc.) for this area.
* @return The font style.
*/
- public Font.Style traitFontStyle() {
+ public FontStyle traitFontStyle() {
return traitGeneratedBy().traitFontStyle(null);
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -30,7 +30,6 @@
import org.axsl.content.CharContent;
import org.axsl.content.TextContent;
-import org.axsl.font.Font;
import org.axsl.font.FontContext;
import org.axsl.font.FontServer;
import org.axsl.font.FontUse;
@@ -39,6 +38,7 @@
import org.axsl.fotree.fo.FoText;
import org.axsl.fotree.fo.prop.WrapOptionPa;
import org.axsl.orthography.Orthography;
+import org.axsl.value.FontVariant;
import org.axsl.value.WrapOption;
/**
@@ -125,7 +125,7 @@
@Override
public boolean inlineIsFauxSmallCaps() {
- if (effectiveParent().traitFontVariant(getContext()) != Font.Variant.SMALL_CAPS) {
+ if (effectiveParent().traitFontVariant(getContext()) != FontVariant.SMALL_CAPS) {
/* If we are not doing small-caps at all, we certainly should not be simulating it. */
return false;
}
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/build.gradle 2022-12-14 20:00:51 UTC (rev 12865)
@@ -7,6 +7,14 @@
description = 'foray-fotree'
dependencies {
+
+ /* In order to keep foray-fotree as clean and usable as possible, this project should ***NEVER*** have a dependency
+ * on any of the following libraries:
+ * axsl-speech OR foray-speech
+ * axsl-font OR foray-font
+ */
+
+
api (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom)
api (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom)
@@ -14,10 +22,8 @@
api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -56,7 +56,6 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.primitive.StringUtils;
-import org.axsl.font.Font;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoAllProperties;
import org.axsl.fotree.FoContext;
@@ -88,6 +87,11 @@
import org.axsl.value.DisplayAlign;
import org.axsl.value.EmptyCells;
import org.axsl.value.Float;
+import org.axsl.value.FontSelectionStrategy;
+import org.axsl.value.FontStretch;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontVariant;
+import org.axsl.value.FontWeight;
import org.axsl.value.ForcePageCount;
import org.axsl.value.HyphenationKeep;
import org.axsl.value.IndexMerge;
@@ -1587,12 +1591,12 @@
}
@Override
- public Font.Style traitFontStyle(final FoContext context) {
+ public FontStyle traitFontStyle(final FoContext context) {
return getPropertyList().getFontStyle(this, context);
}
@Override
- public Font.Weight traitFontWeight(final FoContext context) {
+ public FontWeight traitFontWeight(final FoContext context) {
return getPropertyList().getFontWeight(this, context);
}
@@ -1602,12 +1606,12 @@
}
@Override
- public Font.Variant traitFontVariant(final FoContext context) {
+ public FontVariant traitFontVariant(final FoContext context) {
return getPropertyList().getFontVariant(this, context);
}
@Override
- public Font.Stretch traitFontStretch(final FoContext context) {
+ public FontStretch traitFontStretch(final FoContext context) {
return getPropertyList().getFontStretch(this, context);
}
@@ -2056,10 +2060,10 @@
* @param foFontSelectionStrategy The raw FO font-selection-strategy to be converted.
* @return The matching Font.SelectionStrategy instance.
*/
- private static Font.SelectionStrategy convertFontSelectionStrategy(final FoValue foFontSelectionStrategy) {
+ private static FontSelectionStrategy convertFontSelectionStrategy(final FoValue foFontSelectionStrategy) {
switch (foFontSelectionStrategy) {
- case AUTO: return Font.SelectionStrategy.AUTO;
- case CHARACTER_BY_CHARACTER: return Font.SelectionStrategy.CHARACTER_BY_CHARACTER;
+ case AUTO: return FontSelectionStrategy.AUTO;
+ case CHARACTER_BY_CHARACTER: return FontSelectionStrategy.CHARACTER_BY_CHARACTER;
default: throw new IllegalArgumentException("Illegal font-selection-strategy: " +
foFontSelectionStrategy.toXslFo());
}
@@ -2066,7 +2070,7 @@
}
@Override
- public Font.SelectionStrategy traitFontSelectionStrategy(final FoContext context) {
+ public FontSelectionStrategy traitFontSelectionStrategy(final FoContext context) {
final FoValue foFss = getPropertyList().traitFontSelectionStrategy(this, context);
return convertFontSelectionStrategy(foFss);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -242,6 +242,10 @@
import org.axsl.value.BlankOrNotBlank;
import org.axsl.value.Compass;
import org.axsl.value.Conditionality;
+import org.axsl.value.FontStretch;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontVariant;
+import org.axsl.value.FontWeight;
import org.axsl.value.LetterValue;
import org.axsl.value.OddOrEven;
import org.axsl.value.PagePosition;
@@ -2267,7 +2271,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The font-style property.
*/
- public org.axsl.font.Font.Style getFontStyle(final FoObj fobj, final FoContext context) {
+ public FontStyle getFontStyle(final FoObj fobj, final FoContext context) {
PdFontStyle property = (PdFontStyle) getProperty(FoPropertyId.FONT_STYLE);
if (property != null) {
return property.getValue(context, fobj);
@@ -2287,7 +2291,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The font-weight property.
*/
- public org.axsl.font.Font.Weight getFontWeight(final FoObj fobj, final FoContext context) {
+ public FontWeight getFontWeight(final FoObj fobj, final FoContext context) {
PdFontWeight property = (PdFontWeight) getProperty(FoPropertyId.FONT_WEIGHT);
if (property != null) {
return property.getValue(context, fobj);
@@ -2327,7 +2331,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The font-variant property.
*/
- public org.axsl.font.Font.Variant getFontVariant(final FoObj fobj, final FoContext context) {
+ public FontVariant getFontVariant(final FoObj fobj, final FoContext context) {
PdFontVariant property = (PdFontVariant) getProperty(FoPropertyId.FONT_VARIANT);
if (property != null) {
return property.getValue(context, fobj);
@@ -2347,7 +2351,7 @@
* @param context An object that knows how to resolve FO Tree context issues.
* @return The font-stretch property.
*/
- public org.axsl.font.Font.Stretch getFontStretch(final FoObj fobj, final FoContext context) {
+ public FontStretch getFontStretch(final FoObj fobj, final FoContext context) {
final PdFontStretch property = (PdFontStretch) getProperty(FoPropertyId.FONT_STRETCH);
if (property != null) {
return property.getValue(fobj);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
+import org.axsl.value.FontStretch;
/**
* The "font-stretch" property in XSL-FO.
@@ -106,36 +106,36 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public Font.Stretch getValue(final FoObj fobj) {
+ public FontStretch getValue(final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
switch (keyword) {
case ULTRA_CONDENSED: {
- return Font.Stretch.ULTRA_CONDENSED;
+ return FontStretch.ULTRA_CONDENSED;
}
case EXTRA_CONDENSED: {
- return Font.Stretch.EXTRA_CONDENSED;
+ return FontStretch.EXTRA_CONDENSED;
}
case CONDENSED: {
- return Font.Stretch.CONDENSED;
+ return FontStretch.CONDENSED;
}
case SEMI_CONDENSED: {
- return Font.Stretch.SEMI_CONDENSED;
+ return FontStretch.SEMI_CONDENSED;
}
case NORMAL: {
- return Font.Stretch.NORMAL;
+ return FontStretch.NORMAL;
}
case SEMI_EXPANDED: {
- return Font.Stretch.SEMI_EXPANDED;
+ return FontStretch.SEMI_EXPANDED;
}
case EXPANDED: {
- return Font.Stretch.EXPANDED;
+ return FontStretch.EXPANDED;
}
case EXTRA_EXPANDED: {
- return Font.Stretch.EXTRA_EXPANDED;
+ return FontStretch.EXTRA_EXPANDED;
}
case ULTRA_EXPANDED: {
- return Font.Stretch.ULTRA_EXPANDED;
+ return FontStretch.ULTRA_EXPANDED;
}
default: {
break;
@@ -151,13 +151,12 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static Font.Stretch getValueNoInstance(final FoContext context,
- final FoObj fobj) {
+ public static FontStretch getValueNoInstance(final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontStretch(context);
}
- return Font.Stretch.NORMAL;
+ return FontStretch.NORMAL;
}
/**
@@ -165,8 +164,8 @@
* value to inherit.
* @return The initial value, {@link org.axsl.font.Font.Stretch#NORMAL NORMAL}.
*/
- public static Font.Stretch getInitialValue() {
- return Font.Stretch.NORMAL;
+ public static FontStretch getInitialValue() {
+ return FontStretch.NORMAL;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStyle.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -36,6 +36,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
+import org.axsl.value.FontStyle;
/**
* The "font-style" property in XSL-FO.
@@ -99,7 +100,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public org.axsl.font.Font.Style getValue(final FoContext context,
+ public FontStyle getValue(final FoContext context,
final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
@@ -108,16 +109,16 @@
return getValueNoInstance(context, fobj);
}
case NORMAL: {
- return org.axsl.font.Font.Style.NORMAL;
+ return FontStyle.NORMAL;
}
case ITALIC: {
- return org.axsl.font.Font.Style.ITALIC;
+ return FontStyle.ITALIC;
}
case OBLIQUE: {
- return org.axsl.font.Font.Style.OBLIQUE;
+ return FontStyle.OBLIQUE;
}
case BACKSLANT: {
- return org.axsl.font.Font.Style.BACKSLANT;
+ return FontStyle.BACKSLANT;
}
default: {
break;
@@ -133,13 +134,13 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static org.axsl.font.Font.Style getValueNoInstance(
+ public static FontStyle getValueNoInstance(
final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontStyle(context);
}
- return org.axsl.font.Font.Style.NORMAL;
+ return FontStyle.NORMAL;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontVariant.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -35,8 +35,8 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
-import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
+import org.axsl.value.FontVariant;
/**
* The "font-variant" property in XSL-FO.
@@ -98,7 +98,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public Font.Variant getValue(final FoContext context, final FoObj fobj) {
+ public FontVariant getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
switch (keyword) {
@@ -106,10 +106,10 @@
return getValueNoInstance(context, fobj);
}
case NORMAL: {
- return Font.Variant.NORMAL;
+ return FontVariant.NORMAL;
}
case SMALL_CAPS: {
- return Font.Variant.SMALL_CAPS;
+ return FontVariant.SMALL_CAPS;
}
default: {
break;
@@ -125,13 +125,12 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static Font.Variant getValueNoInstance(final FoContext context,
- final FoObj fobj) {
+ public static FontVariant getValueNoInstance(final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontVariant(context);
}
- return Font.Variant.NORMAL;
+ return FontVariant.NORMAL;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -37,6 +37,7 @@
import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
+import org.axsl.value.FontWeight;
/**
* The "font-weight" property in XSL-FO.
@@ -106,7 +107,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public Font.Weight getValue(final FoContext context, final FoObj fobj) {
+ public FontWeight getValue(final FoContext context, final FoObj fobj) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
switch (keyword) {
@@ -114,10 +115,10 @@
return getValueNoInstance(context, fobj);
}
case NORMAL: {
- return Font.Weight.NORMAL;
+ return FontWeight.NORMAL;
}
case BOLD: {
- return Font.Weight.BOLD;
+ return FontWeight.BOLD;
}
case BOLDER: {
/* This algorithm is debatable:
@@ -136,10 +137,9 @@
* 3) find the relative font in that font-family. */
final FoObj parent = fobj.effectiveParent(context);
if (parent == null) {
- return Font.Weight.DARK;
+ return FontWeight.N500;
}
- final Font.Weight inheritedWeight = parent.traitFontWeight(
- context);
+ final FontWeight inheritedWeight = parent.traitFontWeight(context);
return inheritedWeight.nextHeaviest();
}
case LIGHTER: {
@@ -147,10 +147,9 @@
* above. */
final FoObj parent = fobj.effectiveParent(context);
if (parent == null) {
- return Font.Weight.LIGHT;
+ return FontWeight.N300;
}
- final Font.Weight inheritedWeight = parent.traitFontWeight(
- context);
+ final FontWeight inheritedWeight = parent.traitFontWeight(context);
return inheritedWeight.nextLightest();
}
default: {
@@ -160,7 +159,7 @@
}
if (value().canEvalInteger()) {
final int integer = value().evalInteger();
- return Font.Weight.fromNumeric(integer);
+ return FontWeight.fromNumeric(integer);
}
throw this.unexpectedRetrieval();
}
@@ -171,13 +170,13 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static Font.Weight getValueNoInstance(final FoContext context,
+ public static FontWeight getValueNoInstance(final FoContext context,
final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitFontWeight(context);
}
- return Font.Weight.NORMAL;
+ return FontWeight.NORMAL;
}
@Override
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-14 17:16:06 UTC (rev 12864)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-14 20:00:51 UTC (rev 12865)
@@ -38,7 +38,6 @@
import org.foray.render.PrintRenderer;
import org.axsl.constants.TypographicConstants;
-import org.axsl.font.Font;
import org.axsl.font.FontContext;
import org.axsl.font.FontUse;
import org.axsl.galley.AreaG5;
@@ -79,6 +78,8 @@
import org.axsl.pdf.PdfPathPaint;
import org.axsl.pdf.PdfVersion;
import org.axsl.pdf.PdfXobject;
+import org.axsl.value.FontStyle;
+import org.axsl.value.FontWeight;
import org.axsl.value.LinkType;
import org.axsl.value.RuleStyle;
import org.axsl.value.group.Number2StringFactors;
@@ -674,11 +675,11 @@
}
final Color color = bookmark.traitColor();
boolean italic = false;
- if (bookmark.traitFontStyle() == Font.Style.ITALIC) {
+ if (bookmark.traitFontStyle() == FontStyle.ITALIC) {
italic = true;
}
boolean bold = false;
- if (bookmark.traitFontWeight().getNumericWeight() >= Font.Weight.BOLD.getNumericWeight()) {
+ if (bookmark.traitFontWeight().getNumericWeight() >= FontWeight.BOLD.getNumericWeight()) {
bold = true;
}
final PdfDestinationNamed namedDestination =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 17:16:09
|
Revision: 12864
http://sourceforge.net/p/foray/code/12864
Author: victormote
Date: 2022-12-14 17:16:06 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove another dependency on axsl-font by providing font x-height in FoContext.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -909,4 +909,15 @@
return -1;
}
+ @Override
+ public int fontXheight(final int fontSize) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ return fontUse.getFont().getXheight(fontSize);
+ }
+ return -1;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -534,7 +534,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -1409,7 +1409,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -448,7 +448,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -277,7 +277,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -298,7 +298,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -298,7 +298,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
}
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-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -284,7 +284,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this);
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -397,7 +397,7 @@
@Override
public int traitFontSize() {
final FoText generatedBy = this.traitGeneratedBy();
- final int nominalFontSize = generatedBy.traitFontSizeActual(this, traitNominalFont().getFont());
+ final int nominalFontSize = generatedBy.traitFontSizeActual(this);
if (this.hasFauxSmallCaps()) {
final FontUse fontUse = traitNominalFont();
return fontUse.smallCapsSize(nominalFontSize);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -2660,13 +2660,13 @@
}
@Override
- public int traitFontSizeActual(final FoContext context, final Font font) {
+ public int traitFontSizeActual(final FoContext context) {
final double fontSizeAdjust = this.traitFontSizeAdjust(context);
final int nominalFontSize = this.traitFontSize(context);
if (fontSizeAdjust == Double.NEGATIVE_INFINITY) {
return nominalFontSize;
}
- final int xHeight = font.getXheight(nominalFontSize);
+ final int xHeight = context.fontXheight(nominalFontSize);
final double fontAspectRatio = (float) xHeight / (float) nominalFontSize;
return (int) Math.round(fontSizeAdjust / fontAspectRatio * nominalFontSize);
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -139,6 +139,11 @@
/* We don't care about this for now. */
return -1;
}
+ @Override
+ public int fontXheight(final int fontSize) {
+ /* We don't care about this for now. */
+ return -1;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 16:44:11 UTC (rev 12863)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 17:16:06 UTC (rev 12864)
@@ -182,4 +182,9 @@
return this.wrappedContext.superscriptShift(fontSize);
}
+ @Override
+ public int fontXheight(final int fontSize) {
+ return this.wrappedContext.fontXheight(fontSize);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 16:44:14
|
Revision: 12863
http://sourceforge.net/p/foray/code/12863
Author: victormote
Date: 2022-12-14 16:44:11 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove FontConsumer from FoTree.
Modified Paths:
--------------
trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
Modified: trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
===================================================================
--- trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -31,6 +31,7 @@
import org.foray.area.AreaTree4a;
import org.foray.area.AreaTreeFactory4a;
import org.foray.area.PageCollection4a;
+import org.foray.common.FontSelectionConstraints4a;
import org.foray.core.ForayException;
import org.foray.core.SessionConfig;
import org.foray.fotree.FoTree4a;
@@ -114,7 +115,8 @@
fail(e.getMessage());
}
final Root4a root = foTree.getRootFo();
- final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, this.fontServer, this.graphicServer);
+ final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, this.fontServer,
+ FontSelectionConstraints4a.FREE_STANDING_ONLY, this.graphicServer);
final PioneerLayoutStrategy layout = this.layoutFactory.makeLayout();
final Iterator<PageSequence4a> iterator = root.getPageSequenceIterator();
while (iterator.hasNext()) {
Modified: trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java
===================================================================
--- trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-app/src/testFixtures/java/org/foray/app/FoDocumentReader.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -36,7 +36,6 @@
import org.foray.fotree.FoTreeParser4a;
import org.foray.fotree.FoTreeServer4a;
-import org.axsl.font.FontConsumer;
import org.axsl.font.FontServer;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.text.FoOrthographyServer;
@@ -149,10 +148,6 @@
final FoTreeParser4a parser = this.treeServer.makeFoTreeParser();
parser.parseFoTree(inputSource);
final FoTree4a foTree = parser.getFoTree();
-
- final FontServer fontServer = this.treeServer.getFontServer();
- final FontConsumer fontConsumer = fontServer.makeFontConsumer(null);
- foTree.setFontConsumer(fontConsumer);
return foTree;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -39,6 +39,7 @@
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoTree;
@@ -115,16 +116,16 @@
/**
* Private Constructor.
* @param foTree The FO tree instance that generates this area tree.
- * @param fontConsumer The Font Consumer.
* @param fontServer The font server.
+ * @param constraints The font-selection constraints.
* @param graphicServer The graphics server.
*/
- private AreaTree4a(final FoTree foTree, final FontConsumer fontConsumer, final FontServer fontServer,
+ private AreaTree4a(final FoTree foTree, final FontServer fontServer, final FontSelectionConstraints constraints,
final GraphicServer graphicServer) {
/* AreaTree has no parent with which to register. And it cannot
* create linkage because the AreaTreeControl isn't registered.*/
this.foTree = foTree;
- this.fontConsumer = fontConsumer;
+ this.fontConsumer = fontServer.makeFontConsumer(constraints);
this.documentMetadata = new DocumentMetadata4a(this);
this.fontServer = fontServer;
this.graphicServer = graphicServer;
@@ -134,12 +135,13 @@
* Package-visible factory method.
* @param foTree The FO tree instance that generates this area tree.
* @param fontServer The font server.
+ * @param constraints The font-selection constraints.
* @param graphicServer The graphics server.
* @return The new instance.
*/
static AreaTree4a makeAreaTree(final FoTree foTree, final FontServer fontServer,
- final GraphicServer graphicServer) {
- final AreaTree4a newAreaTree = new AreaTree4a(foTree, foTree.getFontConsumer(), fontServer, graphicServer);
+ final FontSelectionConstraints constraints, final GraphicServer graphicServer) {
+ final AreaTree4a newAreaTree = new AreaTree4a(foTree, fontServer, constraints, graphicServer);
/*
* These registration steps must take place after the AreaTreeControl
* has been stored.
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -29,6 +29,7 @@
package org.foray.area;
import org.axsl.area.AreaTreeFactory;
+import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
import org.axsl.fotree.FoTree;
import org.axsl.graphic.GraphicServer;
@@ -40,8 +41,8 @@
@Override
public AreaTree4a makeAreaTree(final FoTree foTree, final FontServer fontServer,
- final GraphicServer graphicServer) {
- final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree, fontServer, graphicServer);
+ final FontSelectionConstraints constraints, final GraphicServer graphicServer) {
+ final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree, fontServer, constraints, graphicServer);
return areaTree;
}
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -110,6 +110,9 @@
/** The font consumer for this target. */
private FontConsumer fontConsumer;
+ /** The font selection constraints for this target. */
+ private FontSelectionConstraints selectionConstraints;
+
/**
* Constructor.
* @param document The parent document.
@@ -136,8 +139,9 @@
}
/* Obtain a FontConsumer instance. */
+ this.selectionConstraints = selectionConstraints;
final FontServer server = getFontServer();
- this.fontConsumer = server.makeFontConsumer(selectionConstraints);
+ this.fontConsumer = server.makeFontConsumer(this.selectionConstraints);
// Start the renderer.
@@ -293,7 +297,8 @@
final FoTree foTree = this.document.getFoTreeParser().getFoTree();
final FontServer fontServer = this.document.getFontServer();
final GraphicServer graphicServer = this.document.getGraphicServer();
- this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree, fontServer, graphicServer);
+ this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree, fontServer, this.selectionConstraints,
+ graphicServer);
this.areaTree.registerListener(this);
}
return this.areaTree;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -57,7 +57,6 @@
import org.foray.primitive.StringUtils;
import org.axsl.font.Font;
-import org.axsl.font.FontConsumer;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoAllProperties;
import org.axsl.fotree.FoContext;
@@ -664,14 +663,6 @@
}
/**
- * Convenience method for obtaining the FontConsumer for this document.
- * @return The FontConsumer for this document.
- */
- public FontConsumer getFontConsumer() {
- return getFoTree().getFontConsumer();
- }
-
- /**
* Returns the graphic server being used by this tree.
* @return The graphic server being used by this tree.
*/
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -36,7 +36,6 @@
import org.foray.fotree.svg.NamespaceSvg;
import org.foray.fotree.xml.NamespaceXml;
-import org.axsl.font.FontConsumer;
import org.axsl.fotree.FoTree;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
@@ -69,9 +68,6 @@
/** The graphic server. */
private GraphicServer graphicServer;
- /** The font consumer. */
- private FontConsumer fontConsumer;
-
/** The orthography server. */
private FoOrthographyServer orthographyServer;
@@ -128,16 +124,6 @@
}
@Override
- public void setFontConsumer(final FontConsumer consumer) {
- this.fontConsumer = consumer;
- }
-
- @Override
- public FontConsumer getFontConsumer() {
- return this.fontConsumer;
- }
-
- @Override
public void setOrthographyServer(final FoOrthographyServer orthographyServer) {
this.orthographyServer = orthographyServer;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-14 15:18:39 UTC (rev 12862)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2022-12-14 16:44:11 UTC (rev 12863)
@@ -135,9 +135,6 @@
foTree.setOrthographyServer(this.server.getOrthographyServer());
foTree.setGraphicSearchPath(this.server.getGraphicSearchPath());
foTree.setCachingGraphics(this.server.isCachingGraphics());
- /* TODO: Either remove the need for a FontConsumer in the FO Tree, or allow this to get reset by the
- * ForayTarget instance. */
- foTree.setFontConsumer(this.server.getFontServer().makeFontConsumer(null));
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 15:18:42
|
Revision: 12862
http://sourceforge.net/p/foray/code/12862
Author: victormote
Date: 2022-12-14 15:18:39 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove getPrimaryFont() method.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BidiOverride4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Inline4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Title4a.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -35,7 +35,6 @@
import org.foray.fotree.fo.obj.Block4a;
import org.foray.fotree.fo.obj.Flow4a;
-import org.axsl.font.Font;
import org.axsl.fotree.FoTreeException;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -74,8 +73,8 @@
assertEquals(1, fontFamilies.size());
assertEquals("Base14-Courier", fontFamilies.get(0));
- final Font font = block.getPrimaryFont(null).getFont();
- assertEquals("Courier", font.getFontName());
+// final Font font = block.getPrimaryFont(null).getFont();
+// assertEquals("Courier", font.getFontName());
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -33,7 +33,6 @@
import org.foray.common.i18n.Language4a;
import org.foray.common.i18n.Script4a;
import org.foray.common.i18n.WritingSystem4a;
-import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
@@ -59,7 +58,6 @@
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
-import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoAllProperties;
import org.axsl.fotree.FoContext;
@@ -2879,45 +2877,7 @@
return getPropertyList().traitWordSpacingPrecedence();
}
- /* TODO: This is a placeholder until the font refactoring is complete, at which time it should be removed. */
- @Override
- public FontUse getPrimaryFont(final FoContext context) {
- return null;
- }
-
/**
- * Resolves the font to be used for this object.
- * @param context An object that knows how to resolve FO Tree context issues.
- * @return The resolved primary font.
- */
- protected FontUse resolvePrimaryFont(final FoContext context) {
- final CharSequence firstTextSegment = this.firstTextSegment(context);
- int firstChar = UnicodeCharUtils.firstPrintable(firstTextSegment);
- if (firstChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
- /* There are no printable characters in the first text segment,
- * so what we do here doesn't matter much. We set the first
- * char to space so that virtually any font should pass the
- * test. */
- firstChar = ' ';
- }
- final FontConsumer fontConsumer = this.getFontConsumer();
- final Font.SelectionStrategy strategy = this.traitFontSelectionStrategy(context);
- final List<String> fontFamily = this.traitFontFamily(context);
- final Font.Style style = this.traitFontStyle(context);
- final Font.Weight weight = this.traitFontWeight(context);
- final Font.Variant variant = this.traitFontVariant(context);
- final Font.Stretch stretch = this.traitFontStretch(context);
- final int size = this.traitFontSize(context);
-
- final FontUse resolvedFont = fontConsumer.selectFontXsl(strategy, fontFamily, style, weight, variant, stretch,
- size, firstChar);
- if (resolvedFont == null) {
- getFoTree().logError("Error creating Font.\n" + this.getContextMessage());
- }
- return resolvedFont;
- }
-
- /**
* Returns the writing-mode for this FO.
* @param context An object that knows how to resolve FO Tree context issues.
* @return The writing-mode for this FO.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BidiOverride4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BidiOverride4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BidiOverride4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -33,7 +33,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.BidiOverride;
@@ -49,9 +48,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -114,14 +110,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean isValid() {
return true;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -51,9 +51,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -126,14 +123,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean isValid() {
return true;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Character4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -35,7 +35,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Character;
@@ -53,9 +52,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -267,14 +263,6 @@
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -34,7 +34,6 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.fo.FoValue;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.fo.FoText;
import org.axsl.unicode.block.Basic_Latin_Block;
@@ -50,17 +49,6 @@
public abstract class FoText4a extends FoObj implements FoText {
/**
- * The resolved primary Font.
- * It is very, VERY tempting to think that we don't need to cache this here, since this is inherited from the
- * parent, and there is no way that it can be overriden by #PCDATA.
- * In other words, it is tempting to think that we can just get this value from the parent.
- * However, not all parents cache this value, only those to whom the font selection traits "apply".
- * So we must cache it here because the parent might not cache it, but font selection properties might be set on the
- * parent that affect how these fo:character objects should compute their resolved font.
- */
- private org.axsl.font.FontUse resolvedFont = null;
-
- /**
* Constructor.
* @param parent The parent of this.
*/
@@ -74,14 +62,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public void end() {
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InitialPropertySet4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.InitialPropertySet;
@@ -54,9 +53,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -134,14 +130,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Inline4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Inline4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Inline4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -49,9 +49,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -111,14 +108,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean isValid() {
return true;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Leader4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -52,9 +52,6 @@
/** The property list for this object. */
private PropertyList propertyList;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/** The children of this object. */
private List<FoObj> children = new ArrayList<FoObj>();
@@ -137,14 +134,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -44,9 +44,6 @@
/** The parent of this node. */
private FoObj parent;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -89,14 +86,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean canHaveMarkerChildren() {
return false;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -45,9 +45,6 @@
/** The parent of this node. */
private FoObj parent;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -90,14 +87,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean canHaveMarkerChildren() {
return false;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -45,9 +45,6 @@
/** The parent of this node. */
private FoObj parent;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -90,14 +87,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean canHaveMarkerChildren() {
return false;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Root4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -35,7 +35,6 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.axsl.obj.Metadata4a;
-import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
@@ -80,9 +79,6 @@
*/
private Map<String, FoObj> unmatchedReferences = new HashMap<String, FoObj>();
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param foTree The parent FO Tree.
@@ -472,14 +468,6 @@
}
@Override
- public FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -33,7 +33,6 @@
import org.foray.fotree.PropertyList;
import org.foray.primitive.StringUtils;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ScalingValueCitation;
@@ -47,9 +46,6 @@
/** The parent of this node. */
private FoObj parent;
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -117,14 +113,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public boolean canHaveMarkerChildren() {
return false;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Title4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Title4a.java 2022-12-14 14:51:29 UTC (rev 12861)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Title4a.java 2022-12-14 15:18:39 UTC (rev 12862)
@@ -34,7 +34,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Title;
@@ -57,9 +56,6 @@
/** The children of this object. */
private List<FoObj> children = new ArrayList<FoObj>();
- /** The resolved primary Font. */
- private org.axsl.font.FontUse resolvedFont = null;
-
/**
* Constructor.
* @param parent The parent FoObj.
@@ -180,14 +176,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- if (this.resolvedFont == null) {
- this.resolvedFont = resolvePrimaryFont(context);
- }
- return this.resolvedFont;
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 14:51:32
|
Revision: 12861
http://sourceforge.net/p/foray/code/12861
Author: victormote
Date: 2022-12-14 14:51:29 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove some dependencies on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 14:16:48 UTC (rev 12860)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 14:51:29 UTC (rev 12861)
@@ -887,4 +887,26 @@
return -1;
}
+ @Override
+ public int subscriptShift(final int fontSize) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ return fontUse.getFont().subscriptShift(fontSize);
+ }
+ return -1;
+ }
+
+ @Override
+ public int superscriptShift(final int fontSize) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ return fontUse.getFont().superscriptShift(fontSize);
+ }
+ return -1;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java 2022-12-14 14:16:48 UTC (rev 12860)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBaselineShift.java 2022-12-14 14:51:29 UTC (rev 12861)
@@ -150,11 +150,8 @@
* @return The computed subscript baseline-shift.
*/
static int computeSubscript(final FoObj fobj, final FoContext context) {
- /* The subscript computations are computed based on the parent font and font-size. */
- final FoObj parent = fobj.effectiveParent(context);
- final org.axsl.font.Font font = parent.getPrimaryFont(context).getFont();
- final int fontSize = parent.traitFontSize(context);
- return font.subscriptShift(fontSize);
+ final int fontSize = fobj.traitFontSize(context);
+ return context.subscriptShift(fontSize);
}
/**
@@ -164,11 +161,8 @@
* @return The computed superscript baseline-shift.
*/
static int computeSuperscript(final FoObj fobj, final FoContext context) {
- /* The superscript computations are computed based on the parent font and font-size. */
- final FoObj parent = fobj.effectiveParent(context);
- final org.axsl.font.Font font = parent.getPrimaryFont(context).getFont();
- final int fontSize = parent.traitFontSize(context);
- return font.superscriptShift(fontSize);
+ final int fontSize = fobj.traitFontSize(context);
+ return context.superscriptShift(fontSize);
}
/**
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 14:16:48 UTC (rev 12860)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 14:51:29 UTC (rev 12861)
@@ -129,6 +129,16 @@
/* We don't care about this for now. */
return -1;
}
+ @Override
+ public int subscriptShift(final int fontSize) {
+ /* We don't care about this for now. */
+ return -1;
+ }
+ @Override
+ public int superscriptShift(final int fontSize) {
+ /* We don't care about this for now. */
+ return -1;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 14:16:48 UTC (rev 12860)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 14:51:29 UTC (rev 12861)
@@ -172,4 +172,14 @@
return this.wrappedContext.fontMetricsTextDepth(fontSize);
}
+ @Override
+ public int subscriptShift(final int fontSize) {
+ return this.wrappedContext.subscriptShift(fontSize);
+ }
+
+ @Override
+ public int superscriptShift(final int fontSize) {
+ return this.wrappedContext.superscriptShift(fontSize);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 14:16:51
|
Revision: 12860
http://sourceforge.net/p/foray/code/12860
Author: victormote
Date: 2022-12-14 14:16:48 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove some dependencies on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 13:39:45 UTC (rev 12859)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 14:16:48 UTC (rev 12860)
@@ -865,4 +865,26 @@
return BaselineIdentifier.ALPHABETIC;
}
+ @Override
+ public int fontMetricsTextAltitude(final int fontSize) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ return fontUse.getFont().getAscender(fontSize);
+ }
+ return -1;
+ }
+
+ @Override
+ public int fontMetricsTextDepth(final int fontSize) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ return fontUse.getFont().getDescender(fontSize);
+ }
+ return -1;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-14 13:39:45 UTC (rev 12859)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-14 14:16:48 UTC (rev 12860)
@@ -132,7 +132,8 @@
* @return The initial value for this property.
*/
public static int getValueNoInstance(final FoObj fobj, final FoContext context) {
- return fobj.getPrimaryFont(context).getFont().getAscender(fobj.traitFontSize(context));
+ final int fontSize = fobj.traitFontSize(context);
+ return context.fontMetricsTextAltitude(fontSize);
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-14 13:39:45 UTC (rev 12859)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-14 14:16:48 UTC (rev 12860)
@@ -132,7 +132,8 @@
* @return The initial value for this property.
*/
public static int getValueNoInstance(final FoObj fobj, final FoContext context) {
- return fobj.getPrimaryFont(context).getFont().getDescender(fobj.traitFontSize(context));
+ final int fontSize = fobj.traitFontSize(context);
+ return context.fontMetricsTextDepth(fontSize);
}
@Override
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 13:39:45 UTC (rev 12859)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 14:16:48 UTC (rev 12860)
@@ -119,6 +119,16 @@
public BaselineIdentifier baselineForScript(final Script script) {
return BaselineIdentifier.ALPHABETIC;
}
+ @Override
+ public int fontMetricsTextAltitude(final int fontSize) {
+ /* We don't care about this for now. */
+ return -1;
+ }
+ @Override
+ public int fontMetricsTextDepth(final int fontSize) {
+ /* We don't care about this for now. */
+ return -1;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 13:39:45 UTC (rev 12859)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 14:16:48 UTC (rev 12860)
@@ -162,4 +162,14 @@
return this.wrappedContext.baselineForScript(script);
}
+ @Override
+ public int fontMetricsTextAltitude(final int fontSize) {
+ return this.wrappedContext.fontMetricsTextAltitude(fontSize);
+ }
+
+ @Override
+ public int fontMetricsTextDepth(final int fontSize) {
+ return this.wrappedContext.fontMetricsTextDepth(fontSize);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 13:39:47
|
Revision: 12859
http://sourceforge.net/p/foray/code/12859
Author: victormote
Date: 2022-12-14 13:39:45 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove some dependencies on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -30,6 +30,7 @@
import org.foray.area.link.Link;
import org.foray.area.link.LinkFactory;
+import org.foray.common.FontUtil;
import org.foray.common.data.AbstractOrderedTreeNode;
import org.axsl.area.AreaNode;
@@ -46,6 +47,7 @@
import org.axsl.fotree.role.NormalBlockAreaGenerator;
import org.axsl.galley.AreaNodeG5;
import org.axsl.galley.Galley;
+import org.axsl.i18n.Script;
import org.axsl.orthography.Orthography;
import org.axsl.value.BaselineIdentifier;
import org.axsl.value.LinefeedTreatment;
@@ -821,4 +823,46 @@
}
}
+ @Override
+ public BaselineIdentifier baselineForScript(final Script script) {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ }
+ if (fontUse == null) {
+ getAreaTree().logError("Unable to resolve font. Using natural baseline from script \"{}\"instead.",
+ script.getAlphaCode());
+ final Script.NaturalBaseline scriptBaseline = script.getNaturalBaseline();
+ switch (scriptBaseline) {
+ case UNKNOWN: {
+ getAreaTree().logError("Script \"{}\" has unknown baseline. Using fallback of \"alphabetic.\"",
+ script.getAlphaCode());
+ return BaselineIdentifier.ALPHABETIC;
+ }
+ case ALPHABETIC: return BaselineIdentifier.ALPHABETIC;
+ case IDEOGRAPHIC: return BaselineIdentifier.IDEOGRAPHIC;
+ case HANGING: return BaselineIdentifier.HANGING;
+ }
+ }
+
+ final Font font = fontUse.getFont();
+ final String opentypeScript = FontUtil.getOpenTypeScript(script);
+ final Font.Baseline fontBaseline = font.baseline(opentypeScript);
+ switch (fontBaseline) {
+ case ALPHABETIC: return BaselineIdentifier.ALPHABETIC;
+ case MATH: return BaselineIdentifier.MATHEMATICAL;
+ case HANGING: return BaselineIdentifier.HANGING;
+ case IDEO_BOTTOM_LEFT: return BaselineIdentifier.TEXT_AFTER_EDGE;
+ case IDEO_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
+ case ICF_BOTTOM_LEFT: return BaselineIdentifier.IDEOGRAPHIC;
+ /* TODO: There does not seem to be a good match between the font baselines provided and the
+ * XSL-FO baseline for ICF_TOP_RIGHT. */
+ case ICF_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
+ }
+
+ getAreaTree().logError("Unable to find baseline in font. Using fallback of \"alphabetic.\"");
+ return BaselineIdentifier.ALPHABETIC;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -28,7 +28,6 @@
package org.foray.fotree;
-import org.foray.common.FontUtil;
import org.foray.common.data.AbstractOrderedTreeNode;
import org.foray.common.i18n.Country4a;
import org.foray.common.i18n.Language4a;
@@ -1868,7 +1867,7 @@
return BaselineIdentifier.CENTRAL;
}
} else {
- return this.getBaselineFromScript(context);
+ return context.baselineForScript(script);
}
} else {
return parent.traitDominantBaseline(context);
@@ -1875,34 +1874,6 @@
}
}
- /**
- * Returns this object's dominant-baseline, as computed from its font and script.
- * @param context An object that knows how to resolve FO Tree context issues.
- * @return This object's dominant-baseline, as computed from its font and script.
- */
- public BaselineIdentifier getBaselineFromScript(final FoContext context) {
- final FontUse fontUse = this.getPrimaryFont(context);
- if (fontUse == null) {
- throw new IllegalStateException("Unable to obtain a font for baseline computation.");
- }
- final Font font = fontUse.getFont();
- final Script script = this.traitScript(context);
- final String opentypeScript = FontUtil.getOpenTypeScript(script);
- final Font.Baseline fontBaseline = font.baseline(opentypeScript);
- switch (fontBaseline) {
- case ALPHABETIC: return BaselineIdentifier.ALPHABETIC;
- case MATH: return BaselineIdentifier.MATHEMATICAL;
- case HANGING: return BaselineIdentifier.HANGING;
- case IDEO_BOTTOM_LEFT: return BaselineIdentifier.TEXT_AFTER_EDGE;
- case IDEO_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
- case ICF_BOTTOM_LEFT: return BaselineIdentifier.IDEOGRAPHIC;
- /* TODO: There does not seem to be a good match between the font baselines provided and the
- * XSL-FO baseline for ICF_TOP_RIGHT. */
- case ICF_TOP_RIGHT: return BaselineIdentifier.TEXT_BEFORE_EDGE;
- }
- return BaselineIdentifier.ALPHABETIC;
- }
-
@Override
public int traitLastLineEndIndent(final FoContext context) {
return getPropertyList().traitLastLineEndIndent(this, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentBaseline.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -37,6 +37,7 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.FoText;
+import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
/**
@@ -136,7 +137,8 @@
* @return The computed value from the script.
*/
private static BaselineIdentifier computeFromScript(final FoContext context, final FoObj fobj) {
- return fobj.getBaselineFromScript(context);
+ final Script script = fobj.traitScript(context);
+ return context.baselineForScript(script);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDominantBaseline.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -36,6 +36,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
+import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
/**
@@ -165,7 +166,8 @@
return fobj.computeAutoBaseline(context);
}
case USE_SCRIPT: {
- return fobj.getBaselineFromScript(context);
+ final Script script = fobj.traitScript(context);
+ return context.baselineForScript(script);
}
case NO_CHANGE: {
return parent.traitDominantBaseline(context);
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -36,6 +36,7 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
import org.axsl.fotree.fo.GraftingPoint;
+import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
@@ -114,6 +115,10 @@
public float normalLineHeightFactor() {
return 1.2f;
}
+ @Override
+ public BaselineIdentifier baselineForScript(final Script script) {
+ return BaselineIdentifier.ALPHABETIC;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 12:30:47 UTC (rev 12858)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 13:39:45 UTC (rev 12859)
@@ -30,6 +30,7 @@
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.GraftingPoint;
+import org.axsl.i18n.Script;
import org.axsl.value.BaselineIdentifier;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
@@ -156,4 +157,9 @@
return this.wrappedContext.normalLineHeightFactor();
}
+ @Override
+ public BaselineIdentifier baselineForScript(final Script script) {
+ return this.wrappedContext.baselineForScript(script);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 12:30:49
|
Revision: 12858
http://sourceforge.net/p/foray/code/12858
Author: victormote
Date: 2022-12-14 12:30:47 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove an unused dependency on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 12:09:18 UTC (rev 12857)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 12:30:47 UTC (rev 12858)
@@ -2947,15 +2947,6 @@
}
/**
- * Returns the font-size for the lowercase characters when faux small caps are used by this FO.
- * @param context An object that knows how to resolve FO Tree context issues.
- * @return The size, in millipoints, of the font for lowercase faux small caps characters.
- */
- public int getFauxSmallCapFontSize(final FoContext context) {
- return getPrimaryFont(context).smallCapsSize(traitFontSize(context));
- }
-
- /**
* Returns the writing-mode for this FO.
* @param context An object that knows how to resolve FO Tree context issues.
* @return The writing-mode for this FO.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 12:09:21
|
Revision: 12857
http://sourceforge.net/p/foray/code/12857
Author: victormote
Date: 2022-12-14 12:09:18 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove some dependencies on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/fo/TestFont.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -104,9 +104,9 @@
node = flow.formattingObjectChildAt(2);
assertTrue(node instanceof Block4a);
block = (Block4a) node;
- final Font font = node.getPrimaryFont(null).getFont();
- assertEquals("Courier", font.getFamilyName());
- assertEquals(426, font.getXheight(1000));
+// final Font font = node.getPrimaryFont(null).getFont();
+// assertEquals("Courier", font.getFamilyName());
+// assertEquals(426, font.getXheight(1000));
final int nominalFontSize = block.traitFontSize(null);
/* The nominal font-size is 10 pts. */
assertEquals(10000, nominalFontSize);
@@ -115,8 +115,8 @@
assertEquals(.6, fontSizeAdjust, .001);
/* Actual font size computation, using a basis factor of 1000.
* 600 / 426 * 10000 = 14085. */
- fontSize = block.traitFontSizeActual(null, font);
- assertEquals(14085, fontSize);
+// fontSize = block.traitFontSizeActual(null, font);
+// assertEquals(14085, fontSize);
}
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -35,6 +35,8 @@
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTreeException;
import org.axsl.area.factory.BlockLevelAreaFactory;
+import org.axsl.font.Font;
+import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.GraftingPoint;
import org.axsl.fotree.fo.Table;
@@ -61,6 +63,10 @@
public abstract class AreaNode4a extends AbstractOrderedTreeNode<AreaNode4a>
implements AreaNode, AbstractOrderedTreeNode.Convertible<AreaNode4a> {
+ /** The default factor to use when "line-height" is specified as "normal" and we do not have a font from which to
+ * infer that value. */
+ private static final float DEFAULT_NORMAL_LINE_HEIGHT_FACTOR = 1.2f;
+
/**
* Constructor.
*/
@@ -800,4 +806,19 @@
}
}
+ @Override
+ public float normalLineHeightFactor() {
+ FontUse fontUse = null;
+ if (this instanceof Area4a) {
+ final Area4a area = (Area4a) this;
+ fontUse = area.traitNominalFont();
+ }
+ if (fontUse == null) {
+ return DEFAULT_NORMAL_LINE_HEIGHT_FACTOR;
+ } else {
+ final Font.LineHeightAlgorithm algorithm = Font.LineHeightAlgorithm.DEFAULT;
+ return fontUse.getFont().normalLineHeightFactor(algorithm);
+ }
+ }
+
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/obj/Metadata4a.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -210,11 +210,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontWeight.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -36,7 +36,6 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.font.Font;
-import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
/**
@@ -186,20 +185,20 @@
return PdFontWeight.VALID_KEYWORDS;
}
- /**
- * Returns the inherited font.
- * @param context An object that knows how to resolve FO context issues.
- * @param fobj The FO for which this value is needed.
- * @return The inherited font.
- */
- FontUse getInheritedFont(final FoContext context, final FoObj fobj) {
- final FoObj parent = fobj.effectiveParent(context);
- if (parent == null) {
- return null;
- }
- final FontUse font = parent.getPrimaryFont(context);
- return font;
- }
+// /**
+// * Returns the inherited font.
+// * @param context An object that knows how to resolve FO context issues.
+// * @param fobj The FO for which this value is needed.
+// * @return The inherited font.
+// */
+// FontUse getInheritedFont(final FoContext context, final FoObj fobj) {
+// final FoObj parent = fobj.effectiveParent(context);
+// if (parent == null) {
+// return null;
+// }
+// final FontUse font = parent.getPrimaryFont(context);
+// return font;
+// }
@Override
public PropertyValue value() {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -40,8 +40,6 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.constants.NumericConstants;
-import org.axsl.font.Font;
-import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.value.Conditionality;
@@ -251,25 +249,18 @@
* @param fobj The FO for which this value is needed.
* @return The initial value of this property.
*/
- public static int getValueNoInstance(final FoContext context,
- final FoObj fobj) {
- return (int) Math.round(fobj.traitFontSize(context)
- * PdLineHeight.NORMAL_FACTOR);
+ public static int getValueNoInstance(final FoContext context, final FoObj fobj) {
+ return (int) Math.round(fobj.traitFontSize(context) * PdLineHeight.NORMAL_FACTOR);
}
/**
- * Returns the default (initial) value for the multiplier component of
- * this property.
+ * Returns the default (initial) value for the multiplier component of * this property.
* @param context An object that knows how to resolve FO context issues.
* @param fobj The FO for which this value is needed.
* @return The initial value for the multiplier component of this property.
*/
- public static float getValueMultiplierNoInstance(final FoContext context,
- final FoObj fobj) {
- final FontUse fontUse = fobj.getPrimaryFont(context);
- final Font.LineHeightAlgorithm algorithm
- = Font.LineHeightAlgorithm.DEFAULT;
- return fontUse.getFont().normalLineHeightFactor(algorithm);
+ public static float getValueMultiplierNoInstance(final FoContext context, final FoObj fobj) {
+ return context.normalLineHeightFactor();
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -131,10 +131,8 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static int getValueNoInstance(final FoObj fobj,
- final FoContext context) {
- return fobj.getPrimaryFont(context).getFont().getAscender(fobj
- .traitFontSize(context));
+ public static int getValueNoInstance(final FoObj fobj, final FoContext context) {
+ return fobj.getPrimaryFont(context).getFont().getAscender(fobj.traitFontSize(context));
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -131,10 +131,8 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static int getValueNoInstance(final FoObj fobj,
- final FoContext context) {
- return fobj.getPrimaryFont(context).getFont().getDescender(fobj
- .traitFontSize(context));
+ public static int getValueNoInstance(final FoObj fobj, final FoContext context) {
+ return fobj.getPrimaryFont(context).getFont().getDescender(fobj.traitFontSize(context));
}
@Override
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -110,6 +110,10 @@
public BaselineIdentifier traitDominantBaseline() {
return BaselineIdentifier.ALPHABETIC;
}
+ @Override
+ public float normalLineHeightFactor() {
+ return 1.2f;
+ }
};
/** Constant providing a standard, but completely bogus context to be
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 04:58:43 UTC (rev 12856)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2022-12-14 12:09:18 UTC (rev 12857)
@@ -151,4 +151,9 @@
return this.wrappedContext.traitDominantBaseline();
}
+ @Override
+ public float normalLineHeightFactor() {
+ return this.wrappedContext.normalLineHeightFactor();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 04:58:46
|
Revision: 12856
http://sourceforge.net/p/foray/code/12856
Author: victormote
Date: 2022-12-14 04:58:43 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Remove more dependencies on getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/LeaderPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberCitationPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -30,6 +30,7 @@
import org.axsl.area.LineArea;
import org.axsl.content.CharContent;
+import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.FoTextCharacters;
import org.axsl.kp.KpLeafIterator;
@@ -46,10 +47,11 @@
/**
* Constructor.
* @param content The wrapped content.
+ * @param fontUse The font.
* @param context The FO context for this content.
*/
- public CharContent4a(final FoTextCharacters content, final FoContext context) {
- super(context);
+ public CharContent4a(final FoTextCharacters content, final FontUse fontUse, final FoContext context) {
+ super(context, fontUse);
this.content = content;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -30,6 +30,7 @@
import org.axsl.area.LineArea;
import org.axsl.content.Content;
+import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.kp.KpLeafIterator;
@@ -41,12 +42,17 @@
/** The FO context for this content. */
private FoContext context;
+ /** The font. */
+ private FontUse fontUse;
+
/**
* Constructor.
* @param context The FO context for this content.
+ * @param fontUse The font.
*/
- public Content4a(final FoContext context) {
+ public Content4a(final FoContext context, final FontUse fontUse) {
this.context = context;
+ this.fontUse = fontUse;
}
/**
@@ -58,6 +64,14 @@
}
/**
+ * Returns the font for this content.
+ * @return The font for this content.
+ */
+ public FontUse getFontUse() {
+ return this.fontUse;
+ }
+
+ /**
* Add this content, or part of it, to a given line.
* @param lineArea The line to which this content item should be added.
* @param iterator The iterator over the paragraph content.
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -34,6 +34,7 @@
import org.axsl.area.NormalBlockArea;
import org.axsl.content.Content;
import org.axsl.content.ContentTree;
+import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BasicLink;
import org.axsl.fotree.fo.Block;
@@ -82,7 +83,7 @@
private void processChildren(final Fo fo, final Area context) {
for (int index = 0; index < fo.qtyFormattingObjectChildren(); index ++) {
final Fo child = fo.formattingObjectChildAt(index);
- processChild(child, context);
+ processChild(child, context.traitNominalFont(), context);
}
}
@@ -89,21 +90,22 @@
/**
* Processes an {@link Fo} either by wrapping it and adding it to the content, or by traversing its children.
* @param fo The {@link Fo} to be processed.
+ * @param fontUse The font.
* @param context The area-tree context for {@code fo} and descendants.
*/
- private void processChild(final Fo fo, final Area context) {
+ private void processChild(final Fo fo, final FontUse fontUse, final Area context) {
if (fo instanceof FoTextWords) {
final FoTextWords foTextWords = (FoTextWords) fo;
- final TextTokensContent4a tokensContent = new TextTokensContent4a(foTextWords, null);
+ final TextTokensContent4a tokensContent = new TextTokensContent4a(foTextWords, fontUse, null);
this.children.add(tokensContent);
return;
} else if (fo instanceof ExternalGraphic) {
final ExternalGraphic externalGraphic = (ExternalGraphic) fo;
- this.children.add(new ScalableContent(externalGraphic, context));
+ this.children.add(new ScalableContent(externalGraphic, fontUse, context));
return;
} else if (fo instanceof InstreamForeignObject) {
final InstreamForeignObject instreamForeign = (InstreamForeignObject) fo;
- this.children.add(new ScalableContent(instreamForeign, context));
+ this.children.add(new ScalableContent(instreamForeign, fontUse, context));
return;
} else if (fo instanceof Inline) {
return;
@@ -123,7 +125,7 @@
return;
} else if (fo instanceof PageNumber) {
final PageNumber pageNumber = (PageNumber) fo;
- this.children.add(new PageReferenceContent(pageNumber, context));
+ this.children.add(new PageReferenceContent(pageNumber, fontUse, context));
return;
}
throw new IllegalStateException("Don't know how to create content for: " + fo.getClass().getName());
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/IndivisibleContent4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -29,6 +29,7 @@
package org.foray.content;
import org.axsl.content.IndivisibleContent;
+import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
@@ -41,9 +42,10 @@
/**
* Constructor.
* @param context The FO context for this content.
+ * @param fontUse The font.
*/
- public IndivisibleContent4a(final FoContext context) {
- super(context);
+ public IndivisibleContent4a(final FoContext context, final FontUse fontUse) {
+ super(context, fontUse);
}
@Override
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -30,6 +30,7 @@
import org.axsl.area.LineArea;
import org.axsl.content.IndivisibleContent;
+import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.Leader;
import org.axsl.kp.KpLeafIterator;
@@ -46,9 +47,10 @@
* Constructor.
* @param content The wrapped content.
* @param context The FO context for this content.
+ * @param fontUse The font.
*/
- public LeaderContent(final Leader content, final FoContext context) {
- super(context);
+ public LeaderContent(final Leader content, final FontUse fontUse, final FoContext context) {
+ super(context, fontUse);
this.content = content;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -51,10 +51,11 @@
/**
* Constructor.
* @param content The wrapped content.
+ * @param fontUse The font.
* @param context The FO context for this content.
*/
- public PageReferenceContent(final CommonFontPa content, final FoContext context) {
- super(context);
+ public PageReferenceContent(final CommonFontPa content, final FontUse fontUse, final FoContext context) {
+ super(context, fontUse);
this.content = content;
}
@@ -67,9 +68,8 @@
public int inlineSizeOptimum(final int lineLength) {
/* TODO: Fix this method after we add the context to this class. */
final CommonFontPa asText = (CommonFontPa) this.content;
- final FontUse fontUse = asText.getPrimaryFont(null);
final int fontSize = asText.traitFontSize(null);
- final int zeroWidth = fontUse.width('0', fontSize);
+ final int zeroWidth = getFontUse().width('0', fontSize);
// This is an estimate for purposes of layout.
return zeroWidth * QTY_PLACEHOLDER_DIGITS;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -30,6 +30,7 @@
import org.axsl.area.LineArea;
import org.axsl.content.IndivisibleContent;
+import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoScalable;
import org.axsl.fotree.fo.ExternalGraphic;
@@ -47,9 +48,10 @@
* Constructor.
* @param content The wrapped content.
* @param context The FO context for this content.
+ * @param fontUse The font.
*/
- public ScalableContent(final FoScalable content, final FoContext context) {
- super(context);
+ public ScalableContent(final FoScalable content, final FontUse fontUse, final FoContext context) {
+ super(context, fontUse);
this.content = content;
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -49,9 +49,10 @@
/**
* Constructor.
* @param context The FO context.
+ * @param fontUse The font.
*/
- public TextContent4a(final FoContext context) {
- super(context);
+ public TextContent4a(final FoContext context, final FontUse fontUse) {
+ super(context, fontUse);
}
/**
@@ -66,7 +67,7 @@
@Override
public FontUse inlinePrimaryFont() {
- return effectiveParent().getPrimaryFont(getContext());
+ return getFontUse();
}
@Override
@@ -134,8 +135,7 @@
* Right now we rely on the user to configure the font correctly to avoid this. */
/* Has the font been configured to simulate small-caps? */
- final FontUse fontUse = effectiveParent().getPrimaryFont(getContext());
- if (fontUse.simulateSmallCaps() == FontServer.SMALL_CAP_SIMULATION_INVALID) {
+ if (getFontUse().simulateSmallCaps() == FontServer.SMALL_CAP_SIMULATION_INVALID) {
return false;
}
return true;
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-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -56,9 +56,10 @@
* Constructor.
* @param content The wrapped content.
* @param context The FO context.
+ * @param fontUse The font.
*/
- public TextTokensContent4a(final FoTextWords content, final FoContext context) {
- super(context);
+ public TextTokensContent4a(final FoTextWords content, final FontUse fontUse, final FoContext context) {
+ super(context, fontUse);
this.content = content;
}
@@ -116,12 +117,11 @@
@Override
public int getIdealWidth(final KpLeaf leaf) {
- final FontUse fontUse = this.content.getPrimaryFont(getContext());
final int fontSize = this.content.traitFontSize(getContext());
final Orthography orthography = this.content.getOrthography();
if (leaf instanceof CharSequence) {
final CharSequence chars = (CharSequence) leaf;
- return fontUse.width(chars, fontSize, FontContext4a.DEFAULT, orthography);
+ return getFontUse().width(chars, fontSize, FontContext4a.DEFAULT, orthography);
}
return 0;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -77,7 +77,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new ScalableContent(this.realFONode, lineArea));
+ return addNonTextContent(lineArea, new ScalableContent(this.realFONode, lineArea.traitNominalFont(), lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoNodePnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -202,7 +202,7 @@
}
int status = 0;
try {
- final CharContent4a charContent = new CharContent4a(lineText, lineArea);
+ final CharContent4a charContent = new CharContent4a(lineText, lineArea.traitNominalFont(), lineArea);
status = lb.processLineContent(charContent, foContext, start, end, lineArea);
} catch (final TextException e) {
final Fo generatedBy = lineArea.traitGeneratedBy();
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -90,7 +90,7 @@
if (this.result == null) {
final LineBreaker lb = getLayout().getLineBreaker();
- this.content = new TextTokensContent4a(this.node, normalBlockArea);
+ this.content = new TextTokensContent4a(this.node, normalBlockArea.traitNominalFont(), normalBlockArea);
this.result = lb.breakIntoLines(content, paraContext, normalBlockArea);
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -61,7 +61,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new ScalableContent(this.node, lineArea));
+ return addNonTextContent(lineArea, new ScalableContent(this.node, lineArea.traitNominalFont(), lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/LeaderPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/LeaderPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/LeaderPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -60,7 +60,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new LeaderContent(this.node, lineArea));
+ return addNonTextContent(lineArea, new LeaderContent(this.node, lineArea.traitNominalFont(), lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberCitationPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberCitationPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberCitationPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -61,7 +61,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new PageReferenceContent(this.node, lineArea));
+ return addNonTextContent(lineArea, new PageReferenceContent(this.node, lineArea.traitNominalFont(), lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberPnr.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PageNumberPnr.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -60,7 +60,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new PageReferenceContent(this.node, lineArea));
+ return addNonTextContent(lineArea, new PageReferenceContent(this.node, lineArea.traitNominalFont(), lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-12-14 04:26:20 UTC (rev 12855)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/PioneerLayoutStrategy.java 2022-12-14 04:58:43 UTC (rev 12856)
@@ -747,7 +747,7 @@
CharContent textToUse = text;
if (textToUse instanceof FoTextCharacters) {
final FoTextCharacters foLineText = (FoTextCharacters) textToUse;
- textToUse = new CharContent4a(foLineText, lineArea);
+ textToUse = new CharContent4a(foLineText, lineArea.traitNominalFont(), lineArea);
}
LineContentFactory factory = lineArea;
if (getAreaStack().size() > 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 04:26:23
|
Revision: 12855
http://sourceforge.net/p/foray/code/12855
Author: victormote
Date: 2022-12-14 04:26:20 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Consolidate most uses of getPrimaryFont().
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BasicLink4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Marker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableAndCaption4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCaption4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCell4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableRow4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Wrapper4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -1201,7 +1201,7 @@
final Fo generatedBy = this.traitGeneratedBy();
if (generatedBy instanceof CommonFontPa) {
final CommonFontPa foWithFont = (CommonFontPa) generatedBy;
- return resolvePrimaryFont(foWithFont);
+ return resolveNominalFont(foWithFont);
} else {
return this.nearestArea().traitNominalFont();
}
@@ -1212,7 +1212,7 @@
* @param foNeedingFont The FO that generated this area.
* @return The resolved primary font.
*/
- private FontUse resolvePrimaryFont(final CommonFontPa foNeedingFont) {
+ private FontUse resolveNominalFont(final CommonFontPa foNeedingFont) {
// TODO: Get the first chunk of text for the following test.
// final CharSequence firstTextSegment = this.firstTextSegment(this);
final CharSequence firstTextSegment = StringUtils.EMPTY_STRING;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -2908,6 +2908,12 @@
return getPropertyList().traitWordSpacingPrecedence();
}
+ /* TODO: This is a placeholder until the font refactoring is complete, at which time it should be removed. */
+ @Override
+ public FontUse getPrimaryFont(final FoContext context) {
+ return null;
+ }
+
/**
* Resolves the font to be used for this object.
* @param context An object that knows how to resolve FO Tree context issues.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/ForeignXml.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -30,7 +30,6 @@
import org.foray.fotree.fo.obj.InstreamForeignObject4a;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.w3c.dom.Document;
@@ -283,9 +282,4 @@
return false;
}
- @Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFlow.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import java.util.ArrayList;
@@ -125,11 +124,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -33,7 +33,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
@@ -123,11 +122,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -33,7 +33,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
@@ -121,11 +120,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -31,7 +31,6 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import java.util.ArrayList;
@@ -107,11 +106,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import java.util.ArrayList;
@@ -257,11 +256,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public TableRow4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BasicLink4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BasicLink4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BasicLink4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -126,11 +126,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public PropertyList getPropertyList() {
return this.propertyList;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BlockContainer4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -142,11 +142,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Bookmark4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -186,11 +186,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -178,11 +178,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public AbstractCharacterSequence formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTree4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.BookmarkTree;
@@ -141,11 +140,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarBegin4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ChangeBarBegin;
@@ -133,11 +132,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ChangeBarEnd4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ChangeBarEnd;
@@ -133,11 +132,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ColorProfile4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ColorProfile;
@@ -128,11 +127,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ConditionalPageMasterReference;
@@ -283,11 +282,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Declarations4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -33,7 +33,6 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.axsl.obj.Metadata4a;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Declarations;
@@ -199,11 +198,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -194,11 +194,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Float4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
@@ -130,11 +129,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowAssignment4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FlowAssignment;
@@ -161,11 +160,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowMap4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FlowMap;
@@ -152,11 +151,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FlowAssignment4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowNameSpecifier4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FlowNameSpecifier;
@@ -128,11 +127,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowSourceList4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FlowSourceList;
@@ -155,11 +154,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FlowNameSpecifier4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FlowTargetList4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FlowTargetList;
@@ -156,11 +155,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public RegionNameSpecifier4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Footnote4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.Footnote;
@@ -152,11 +151,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FootnoteBody4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.FootnoteBody;
@@ -131,11 +130,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexKeyReference4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.IndexKeyReference;
@@ -133,11 +132,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexPageCitationList4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.IndexPageCitationList;
@@ -133,11 +132,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeBegin4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.IndexRangeBegin;
@@ -133,11 +132,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/IndexRangeEnd4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.IndexRangeEnd;
@@ -132,11 +131,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InlineContainer4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -137,11 +137,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -148,11 +148,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/LayoutMasterSet4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -37,7 +37,6 @@
import org.foray.fotree.fo.prop.PdFlowNameReference;
import org.foray.fotree.fo.prop.PdRegionNameReference;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.LayoutMasterSet;
@@ -416,11 +415,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListBlock4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.ListBlock;
@@ -140,11 +139,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItem4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -160,11 +160,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemBody4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -142,11 +142,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ListItemLabel4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -142,11 +142,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Marker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Marker4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Marker4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -156,11 +156,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public boolean isValid() {
return true;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiCase4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.MultiCase;
@@ -132,11 +131,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiProperties4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.MultiProperties;
@@ -131,11 +130,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiPropertySet4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.MultiPropertySet;
@@ -127,11 +126,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiSwitch4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.MultiSwitch;
@@ -131,11 +130,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/MultiToggle4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.MultiToggle;
@@ -132,11 +131,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequence4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -335,11 +335,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceMaster4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.PageSequenceMaster;
@@ -204,11 +203,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public SubSequenceSpecifier formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageSequenceWrapper4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.PageSequenceWrapper;
@@ -141,11 +140,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Region4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -213,11 +213,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RegionNameSpecifier4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.RegionNameSpecifier;
@@ -130,11 +129,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmAlternatives4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.RepeatablePageMasterAlternatives;
@@ -127,11 +126,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public ConditionalPageMasterReference4a formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RepeatablePmReference4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.RepeatablePageMasterReference;
@@ -121,11 +120,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveMarker4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -33,7 +33,6 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.fo.FoValue;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.RetrieveMarker;
@@ -186,11 +185,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/RetrieveTableMarker4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.RetrieveTableMarker;
@@ -130,11 +129,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/SinglePageMasterReference4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
@@ -119,11 +118,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Table4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -382,11 +382,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableAndCaption4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableAndCaption4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableAndCaption4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
-import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.FoVisitor;
import org.axsl.fotree.fo.TableAndCaption;
@@ -131,11 +130,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCaption4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCaption4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCaption4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -137,11 +137,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCell4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCell4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableCell4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -252,11 +252,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableColumn4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -189,11 +189,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return null;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableRow4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableRow4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/TableRow4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -146,11 +146,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public FoObj formattingObjectChildAt(final int index) {
return this.children.get(index);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Wrapper4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Wrapper4a.java 2022-12-14 00:34:54 UTC (rev 12854)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Wrapper4a.java 2022-12-14 04:26:20 UTC (rev 12855)
@@ -123,11 +123,6 @@
}
@Override
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
- @Override
public boolean isValid() {
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-14 00:34:57
|
Revision: 12854
http://sourceforge.net/p/foray/code/12854
Author: victormote
Date: 2022-12-14 00:34:54 +0000 (Wed, 14 Dec 2022)
Log Message:
-----------
Add font-resolution code to AreaTree in preparation for removing it from FoTree.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/VerticalTests.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -67,7 +67,7 @@
AreaNode4a node = firstNormalFlowArea.areaNodeChildAt(0);
assertTrue(node instanceof NormalBlockArea4a);
final NormalBlockArea4a blockArea = (NormalBlockArea4a) node;
- final FontUse font = blockArea.getPrimaryFont();
+ final FontUse font = blockArea.traitNominalFont();
assertEquals("Courier", font.getFont().getPostscriptName());
assertEquals(12000, blockArea.traitFontSize());
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -28,14 +28,19 @@
package org.foray.area;
+import org.foray.common.primitive.UnicodeCharUtils;
+import org.foray.primitive.StringUtils;
+
import org.axsl.area.Area;
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockLevelRa;
import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
+import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BasicLink;
+import org.axsl.fotree.fo.prop.CommonFontPa;
import org.axsl.fotree.fo.prop.IdPa;
import org.axsl.fotree.fo.prop.WritingModePa;
import org.axsl.galley.value.AreaClass;
@@ -1193,8 +1198,47 @@
@Override
public FontUse traitNominalFont() {
- // TODO Auto-generated method stub
- return null;
+ final Fo generatedBy = this.traitGeneratedBy();
+ if (generatedBy instanceof CommonFontPa) {
+ final CommonFontPa foWithFont = (CommonFontPa) generatedBy;
+ return resolvePrimaryFont(foWithFont);
+ } else {
+ return this.nearestArea().traitNominalFont();
+ }
}
+ /**
+ * Resolves the font to be used for this object.
+ * @param foNeedingFont The FO that generated this area.
+ * @return The resolved primary font.
+ */
+ private FontUse resolvePrimaryFont(final CommonFontPa foNeedingFont) {
+ // TODO: Get the first chunk of text for the following test.
+// final CharSequence firstTextSegment = this.firstTextSegment(this);
+ final CharSequence firstTextSegment = StringUtils.EMPTY_STRING;
+ int firstChar = UnicodeCharUtils.firstPrintable(firstTextSegment);
+ if (firstChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
+ /* There are no printable characters in the first text segment,
+ * so what we do here doesn't matter much. We set the first
+ * char to space so that virtually any font should pass the
+ * test. */
+ firstChar = ' ';
+ }
+ final FontConsumer fontConsumer = getAreaTree().getFontConsumer();
+ final Font.SelectionStrategy strategy = foNeedingFont.traitFontSelectionStrategy(this);
+ final List<String> fontFamily = foNeedingFont.traitFontFamily(this);
+ final Font.Style style = foNeedingFont.traitFontStyle(this);
+ final Font.Weight weight = foNeedingFont.traitFontWeight(this);
+ final Font.Variant variant = foNeedingFont.traitFontVariant(this);
+ final Font.Stretch stretch = foNeedingFont.traitFontStretch(this);
+ final int size = foNeedingFont.traitFontSize(this);
+
+ final FontUse resolvedFont = fontConsumer.selectFontXsl(strategy, fontFamily, style, weight, variant, stretch,
+ size, firstChar);
+ if (resolvedFont == null) {
+ getAreaTree().logError("Error creating Font.\n" + ((Fo) foNeedingFont).getContextMessage());
+ }
+ return resolvedFont;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -537,9 +537,4 @@
return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- @Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -34,7 +34,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.LineArea;
import org.axsl.font.Font;
-import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.BasicLink;
import org.axsl.fotree.fo.BidiOverride;
@@ -742,7 +741,7 @@
* whole issue needs to be revisited. */
// final Baseline baseline = this.traitDominantBaseline();
final Font.Baseline baseline = Font.Baseline.ALPHABETIC;
- final Font font = this.getPrimaryFont().getFont();
+ final Font font = traitNominalFont().getFont();
return font.baselineOffset(axis, baseline, this.traitFontSize());
}
@@ -1410,16 +1409,7 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- /**
- * Returns the primary font.
- * @return The primary font.
- */
- public FontUse getPrimaryFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/NormalBlockArea4a.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -33,7 +33,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.NormalBlockArea;
import org.axsl.area.factory.BlockLevelAreaFactory;
-import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.Block;
import org.axsl.fotree.fo.BlockContainer;
@@ -449,18 +448,9 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSizeActual(this,
- this.getPrimaryFont().getFont());
+ return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- /**
- * Returns the primary font.
- * @return The primary font.
- */
- public FontUse getPrimaryFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
@Override
public int getLineLength(final int lineNumber) {
return this.crIpd();
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -280,9 +280,4 @@
return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- @Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -301,9 +301,4 @@
return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- @Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -301,9 +301,4 @@
return traitGeneratedBy().traitFontSizeActual(this, traitNominalFont().getFont());
}
- @Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
}
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-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -288,11 +288,6 @@
}
@Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
- @Override
public FontContext fontContext() {
/* TODO: Get this from the FOTree. */
return FontContext4a.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-13 21:47:57 UTC (rev 12853)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-14 00:34:54 UTC (rev 12854)
@@ -457,11 +457,6 @@
this.parent = this.validateNewParent(node);
}
- @Override
- public FontUse traitNominalFont() {
- return traitGeneratedBy().getPrimaryFont(this);
- }
-
/**
* Returns the hyphenation-character trait for this area.
* @return The hyphenation-character trait for this area.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-13 21:48:00
|
Revision: 12853
http://sourceforge.net/p/foray/code/12853
Author: victormote
Date: 2022-12-13 21:47:57 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
More cleanup of constants and utility code.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java
trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/ByteUtils.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/Area4a.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -31,8 +31,8 @@
import org.axsl.area.Area;
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockLevelRa;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontUse;
import org.axsl.fotree.Fo;
import org.axsl.fotree.fo.BasicLink;
@@ -784,10 +784,10 @@
*/
public Rectangle2D.Float crPoints() {
return new Rectangle2D.Float(
- crOriginX() / FontConstants.MILLIPOINTS_PER_POINT,
- crOriginY() / FontConstants.MILLIPOINTS_PER_POINT,
- crIpd() / FontConstants.MILLIPOINTS_PER_POINT,
- crBpd() / FontConstants.MILLIPOINTS_PER_POINT);
+ crOriginX() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ crOriginY() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ crIpd() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ crBpd() / TypographicConstants.MILLIPOINTS_PER_POINT);
}
/**
@@ -796,10 +796,10 @@
*/
public Rectangle2D.Float brPoints() {
return new Rectangle2D.Float(
- brOriginX() / FontConstants.MILLIPOINTS_PER_POINT,
- brOriginY() / FontConstants.MILLIPOINTS_PER_POINT,
- brIpd() / FontConstants.MILLIPOINTS_PER_POINT,
- brBpd() / FontConstants.MILLIPOINTS_PER_POINT);
+ brOriginX() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ brOriginY() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ brIpd() / TypographicConstants.MILLIPOINTS_PER_POINT,
+ brBpd() / TypographicConstants.MILLIPOINTS_PER_POINT);
}
/**
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -1,199 +0,0 @@
-/*
- * Copyright 2006 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common;
-
-import org.axsl.constants.PrimitiveConstants;
-import org.axsl.font.FontConstants;
-
-/**
- * Class containing well-known or commonly-used constants and conversions.
- */
-public final class WellKnownConstants {
-
- /**
- * Private constructor. This is a utility class, and should never be instantiated.
- */
- private WellKnownConstants() { }
-
- /**
- * Converts four unsigned bytes to a long.
- * (It must be converted to a long because the Java int is signed).
- * @param byte1 The high-order byte.
- * @param byte2 The second highest-order byte.
- * @param byte3 The third highest-order byte.
- * @param byte4 The low-order byte.
- * @return The long represented by the four bytes.
- */
- public static long unsignedBytesToLong(final byte byte1, final byte byte2,
- final byte byte3, final byte byte4) {
- final int int1 = unsignedByteToInt(byte1);
- final int int2 = unsignedByteToInt(byte2);
- final int int3 = unsignedByteToInt(byte3);
- final int int4 = unsignedByteToInt(byte4);
- return (int1 << PrimitiveConstants.SHIFT_3_BYTES)
- | (int2 << PrimitiveConstants.SHIFT_2_BYTES)
- | (int3 << PrimitiveConstants.SHIFT_1_BYTE)
- | int4;
- }
-
- /**
- * Converts one unsigned byte to its integer equivalent.
- * @param unsignedByte The byte to be converted.
- * @return The integer equivalent of {@code unsignedByte}.
- */
- public static int unsignedByteToInt(final byte unsignedByte) {
- final int converted = unsignedByte & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
- return converted;
- }
-
- /**
- * Converts four unsigned big-endian bytes from an array of bytes to a long.
- * (It must be converted to a long because the Java int is signed).
- * @param byteArray The array of bytes containing the bytes to be converted.
- * @param start The index to the first byte in the array to be converted.
- * This is the high-order byte of the 4 bytes. The second byte will be
- * indexed at start + 1, the third byte at start + 2, and the fourth byte
- * at start + 3.
- * @return The long represented by the four bytes.
- */
- public static long unsignedBytesToLongBE(final byte[] byteArray,
- final int start) {
- if (byteArray == null
- || start < 0
- || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
- /* Fails silently. */
- return 0;
- }
- int index = start;
- return unsignedBytesToLong(
- byteArray[index++],
- byteArray[index++],
- byteArray[index++],
- byteArray[index]);
- }
-
- /**
- * Converts four unsigned little-endian bytes from an array of bytes to a
- * long.
- * (It must be converted to a long because the Java int is signed).
- * @param byteArray The array of bytes containing the bytes to be converted.
- * @param start The index to the first byte in the array to be converted.
- * This is the low-order byte of the 4 bytes. The second byte will be
- * indexed at start + 1, the third byte at start + 2, and the fourth byte
- * (the high-order byte) at start + 3.
- * @return The long represented by the four bytes.
- */
- public static long unsignedBytesToLongLE(final byte[] byteArray,
- final int start) {
- if (byteArray == null
- || start < 0
- || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
- /* Fails silently. */
- return 0;
- }
- int index = start + PrimitiveConstants.BYTES_PER_INT - 1;
- return unsignedBytesToLong(
- byteArray[index--],
- byteArray[index--],
- byteArray[index--],
- byteArray[index]);
- }
-
- /**
- * Converts two unsigned bytes to an int.
- * (It must be converted to an int because the Java short is signed).
- * @param byte1 The high-order byte.
- * @param byte2 The low-order byte.
- * @return The int represented by the two bytes.
- */
- public static int unsignedBytesToInt(final byte byte1, final byte byte2) {
- return (int) unsignedBytesToLong((byte) 0, (byte) 0, byte1, byte2);
- }
-
- /**
- * Converts two unsigned big-endian bytes from an array of bytes to an int.
- * (It must be converted to an int because the Java short is signed).
- * @param byteArray The array of bytes containing the bytes to be converted.
- * @param start The index to the first byte in the array to be converted.
- * This is the high-order byte of the 2 bytes. The second byte (the
- * low-order byte) will be indexed at start + 1.
- * @return The int represented by the two bytes.
- */
- public static int unsignedBytesToIntBE(final byte[] byteArray,
- final int start) {
- if (byteArray == null
- || start < 0
- || start + PrimitiveConstants.BYTES_PER_SHORT > byteArray.length) {
- /* Fails silently. */
- return 0;
- }
- int index = start;
- return (int) unsignedBytesToLong(
- (byte) 0,
- (byte) 0,
- byteArray[index++],
- byteArray[index]);
- }
-
- /**
- * Converts two unsigned little-endian bytes from an array of bytes to an
- * int.
- * (It must be converted to an int because the Java short is signed).
- * @param byteArray The array of bytes containing the bytes to be converted.
- * @param start The index to the first byte in the array to be converted.
- * This is the low-order byte of the 4 bytes. The second byte (the
- * high-order byte) at start + 1.
- * @return The int represented by the two bytes.
- */
- public static int unsignedBytesToIntLE(final byte[] byteArray,
- final int start) {
- if (byteArray == null
- || start < 0
- || start + PrimitiveConstants.BYTES_PER_SHORT > byteArray.length) {
- /* Fails silently. */
- return 0;
- }
- int index = start + PrimitiveConstants.BYTES_PER_SHORT - 1;
- return (int) unsignedBytesToLong(
- (byte) 0,
- (byte) 0,
- byteArray[index--],
- byteArray[index]);
- }
-
- /**
- * Converts millipoints to points.
- * @param millipoints The millipoint value to be converted.
- * @return The points equivalent of {@code millipoints}.
- */
- public static float millipointsToPoints(final int millipoints) {
- return millipoints / (float) FontConstants.MILLIPOINTS_PER_POINT;
- }
-
-}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -30,8 +30,8 @@
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.Kerning;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.ps.CharSet;
/**
@@ -220,11 +220,11 @@
return 0;
}
final int rawKerning = getKerning().kern(glyphIndex1, glyphIndex2);
- if (FontConstants.MILLIPOINTS_PER_POINT == this.getUnitsPerTextSpaceUnit()) {
+ if (TypographicConstants.MILLIPOINTS_PER_POINT == this.getUnitsPerTextSpaceUnit()) {
/* Avoid the potential loss of precision. */
return rawKerning;
}
- return Math.round(rawKerning * FontConstants.MILLIPOINTS_PER_POINT
+ return Math.round(rawKerning * TypographicConstants.MILLIPOINTS_PER_POINT
/ this.getUnitsPerTextSpaceUnit());
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -33,8 +33,8 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
@@ -175,7 +175,7 @@
public int getAscender(final int fontSize) {
/* Since both size and ascender are in millipoints, divide by 1000
* to keep result in millipoints */
- final int value = fontSize * this.ascender / FontConstants.MILLIPOINTS_PER_POINT;
+ final int value = fontSize * this.ascender / TypographicConstants.MILLIPOINTS_PER_POINT;
return value;
}
@@ -183,7 +183,7 @@
public int getDescender(final int fontSize) {
/* Since both size and descender are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * this.descender / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.descender / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -190,7 +190,7 @@
public int getCapHeight(final int fontSize) {
/* Since both size and capHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return fontSize * this.capHeight / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.capHeight / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -197,7 +197,7 @@
public int getXheight(final int fontSize) {
/* Since both size and xHeight are in millipoints, divide by 1000
* to keep result in millipoints */
- return Math.round(fontSize * this.xHeight / FontConstants.MILLIPOINTS_PER_POINT);
+ return Math.round(fontSize * this.xHeight / TypographicConstants.MILLIPOINTS_PER_POINT);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsTrueTypeFont.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -36,8 +36,8 @@
import org.foray.font.format.ttf.TrueTypeFont;
import org.foray.font.format.ttf.TtfSubSetFile;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
@@ -183,12 +183,12 @@
}
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[glyphIndex] / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[glyphIndex] / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0] / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[0] / TypographicConstants.MILLIPOINTS_PER_POINT;
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FsType1Font.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -38,8 +38,8 @@
import org.foray.font.format.type1.Type1Metrics;
import org.foray.font.format.type1.Type1MetricsParser;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.PsEncoding;
@@ -271,12 +271,12 @@
public int width(final int metricIndex, final int fontSize) {
/* Since the fontSize and width array are both in millipoints, must
* divide by 1000 to return a result in millipoints */
- return fontSize * this.getWidths()[metricIndex] / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[metricIndex] / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int widthUndefinedGlyph(final int fontSize) {
- return fontSize * this.getWidths()[0] / FontConstants.MILLIPOINTS_PER_POINT;
+ return fontSize * this.getWidths()[0] / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -370,12 +370,12 @@
@Override
public int underlineSize(final int fontSize) {
- return this.metricsFile.getUnderlineSize() * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
+ return this.metricsFile.getUnderlineSize() * fontSize / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
public int underlinePosition(final int fontSize) {
- return this.metricsFile.getUnderlinePosition() * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
+ return this.metricsFile.getUnderlinePosition() * fontSize / TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -395,7 +395,7 @@
@Override
public int getUnitsPerTextSpaceUnit() {
/* Type 1 fonts always use 1000 units per text-space unit. */
- return FontConstants.MILLIPOINTS_PER_POINT;
+ return TypographicConstants.MILLIPOINTS_PER_POINT;
}
@Override
@@ -418,12 +418,12 @@
@Override
public BoundingBox getGlyphBoundingBox(final int glyphIndex, final int fontSize) {
final BoundingBox raw = this.metricsFile.getGlyphBoundingBoxes()[glyphIndex];
- if (fontSize == FontConstants.MILLIPOINTS_PER_POINT) {
+ if (fontSize == TypographicConstants.MILLIPOINTS_PER_POINT) {
return raw;
}
final float[] scaled = new float[BoundingBox.QTY_ENTRIES];
for (int index = 0; index < BoundingBox.QTY_ENTRIES; index ++) {
- scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / FontConstants.MILLIPOINTS_PER_POINT;
+ scaled[index] = raw.getCoordinateAsFloat(index) * fontSize / TypographicConstants.MILLIPOINTS_PER_POINT;
}
return BoundingBoxUtils.makeBoundingBox(scaled);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -29,7 +29,6 @@
package org.foray.font;
import org.foray.common.Environment;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.BoundingBoxUtils;
import org.foray.font.config.RegisteredFontContent;
import org.foray.font.format.FontParser;
@@ -36,7 +35,7 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontException;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.CharSet;
@@ -125,13 +124,13 @@
// http://developer.java.sun.com/developer/bugParade/bugs/4399887.html
final int realAscent = fm.getAscent()
- (fm.getDescent() + fm.getLeading());
- return FontConstants.MILLIPOINTS_PER_POINT * realAscent;
+ return TypographicConstants.MILLIPOINTS_PER_POINT * realAscent;
}
@Override
public int getDescender(final int fontSize) {
final FontMetrics fm = getSizedFont(fontSize);
- return -1 * FontConstants.MILLIPOINTS_PER_POINT * fm.getDescent();
+ return -1 * TypographicConstants.MILLIPOINTS_PER_POINT * fm.getDescent();
}
@Override
@@ -147,7 +146,7 @@
getGraphics().getFontRenderContext());
final Rectangle2D rect = layout.getBounds();
final int xHeight = (int) rect.getHeight();
- return FontConstants.MILLIPOINTS_PER_POINT * xHeight;
+ return TypographicConstants.MILLIPOINTS_PER_POINT * xHeight;
}
@Override
@@ -161,7 +160,7 @@
ac[0] = (char) c;
double dWidth = fm.getStringBounds(ac, 0, 1, getGraphics()).getWidth()
- * FontConstants.MILLIPOINTS_PER_POINT;
+ * TypographicConstants.MILLIPOINTS_PER_POINT;
// The following was left in based on this comment from the past (may be
// vestigial)
@@ -344,7 +343,7 @@
* If so, returns it.
* If not, creates and caches new one with the new size.
*/
- final float s = WellKnownConstants.millipointsToPoints(fontSize);
+ final float s = fontSize / (float) TypographicConstants.MILLIPOINTS_PER_POINT;
/* Get local copies to make sure thread-safe. */
final FontMetrics lastFontMetrics = this.lastMetrics;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -31,8 +31,8 @@
import org.foray.font.Font4a;
import org.axsl.constants.NumericConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontServer;
import org.axsl.ps.Encoding;
@@ -254,8 +254,8 @@
public float getSimulateSmallCaps() {
if (this.simulateSmallCaps == FontServer.SMALL_CAP_SIMULATION_NATIVE) {
final Font4a font = this.getRegisteredFont().getBestFont();
- this.simulateSmallCaps = font.getXheight(FontConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps /= font.getAscender(FontConstants.MILLIPOINTS_PER_POINT);
+ this.simulateSmallCaps = font.getXheight(TypographicConstants.MILLIPOINTS_PER_POINT);
+ this.simulateSmallCaps /= font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT);
this.simulateSmallCaps *= NumericConstants.PERCENT_CONVERSION;
}
return this.simulateSmallCaps;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -35,8 +35,8 @@
import org.foray.font.output.FontPdfUtilities;
import org.foray.primitive.BitUtils;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.ps.BoundingBox;
import org.axsl.ps.Cmap;
@@ -535,7 +535,7 @@
final TtfTableHead headTable = this.getHeadTable();
final int unitsPerEm = headTable.unitsPerEm();
- final double result = ((float) fUnits) * FontConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
+ final double result = ((float) fUnits) * TypographicConstants.MILLIPOINTS_PER_POINT / unitsPerEm;
final long roundedResult = Math.round(result);
/* This cast from a long to a short looks horrible, but should be safe. The results should almost always be in
* the range +/- 1500. Log an error if there is any truncation. */
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -33,7 +33,7 @@
package org.foray.graphic;
-import org.foray.common.WellKnownConstants;
+import org.foray.primitive.ByteUtils;
import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.PrimitiveConstants;
@@ -354,10 +354,8 @@
final byte[] header = new byte[BmpGraphic.HEADERMAP_LENGTH];
getInputStream().read(header);
/* Little endian format. */
- this.pixelWidth = (int) WellKnownConstants.unsignedBytesToLongLE(header,
- BmpGraphic.WIDTH_OFFSET);
- this.pixelHeight = (int) WellKnownConstants.unsignedBytesToLongLE(header,
- BmpGraphic.HEIGHT_OFFSET);
+ this.pixelWidth = (int) ByteUtils.unsignedBytesToLongLE(header, BmpGraphic.WIDTH_OFFSET);
+ this.pixelHeight = (int) ByteUtils.unsignedBytesToLongLE(header, BmpGraphic.HEIGHT_OFFSET);
}
@Override
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,8 +28,8 @@
package org.foray.graphic;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.BoundingBoxUtils;
+import org.foray.primitive.ByteUtils;
import org.foray.primitive.sequence.ByteArray;
import org.axsl.graphic.Graphic;
@@ -187,18 +187,12 @@
final byte[] fileStart = new byte[this.maxBytesToParseBasics()];
getInputStream().read(fileStart);
if (! this.isAscii) {
- this.psStart = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.PS_START_OFFSET);
- this.psLength = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.PS_LENGTH_OFFSET);
- this.wmfStart = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.WMF_START_OFFSET);
- this.wmfLength = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.WMF_LENGTH_OFFSET);
- this.tiffStart = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.TIFF_START_OFFSET);
- this.tiffLength = (int) WellKnownConstants.unsignedBytesToLongBE(fileStart,
- EpsGraphic.TIFF_LENGTH_OFFSET);
+ this.psStart = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.PS_START_OFFSET);
+ this.psLength = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.PS_LENGTH_OFFSET);
+ this.wmfStart = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.WMF_START_OFFSET);
+ this.wmfLength = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.WMF_LENGTH_OFFSET);
+ this.tiffStart = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.TIFF_START_OFFSET);
+ this.tiffLength = (int) ByteUtils.unsignedBytesToLongBE(fileStart, EpsGraphic.TIFF_LENGTH_OFFSET);
}
readBBox(fileStart);
if (this.bbox != null) {
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.graphic;
-import org.foray.common.WellKnownConstants;
+import org.foray.primitive.ByteUtils;
import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.PrimitiveConstants;
@@ -208,12 +208,12 @@
icm.getGreens(greens);
icm.getBlues(blues);
for (int i = 0; i < icm.getMapSize(); i++) {
- final int alpha = WellKnownConstants.unsignedByteToInt(alphas[i]);
+ final int alpha = ByteUtils.unsignedByteToInt(alphas[i]);
if (alpha == 0) {
this.isTransparent = true;
- final int red = WellKnownConstants.unsignedByteToInt(reds[i]);
- final int green = WellKnownConstants.unsignedByteToInt(greens[i]);
- final int blue = WellKnownConstants.unsignedByteToInt(blues[i]);
+ final int red = ByteUtils.unsignedByteToInt(reds[i]);
+ final int green = ByteUtils.unsignedByteToInt(greens[i]);
+ final int blue = ByteUtils.unsignedByteToInt(blues[i]);
this.transparentColor = new Color(red, green, blue);
break;
}
@@ -241,10 +241,8 @@
final byte[] header = new byte[GifGraphic.GIF_BASICS_LENGTH];
getInputStream().read(header);
/* Little endian notation */
- this.pixelWidth = WellKnownConstants.unsignedBytesToIntLE(header,
- GifGraphic.PIXEL_WIDTH_OFFSET);
- this.pixelHeight = WellKnownConstants.unsignedBytesToIntLE(header,
- GifGraphic.PIXEL_HEIGHT_OFFSET);
+ this.pixelWidth = ByteUtils.unsignedBytesToIntLE(header, GifGraphic.PIXEL_WIDTH_OFFSET);
+ this.pixelHeight = ByteUtils.unsignedBytesToIntLE(header, GifGraphic.PIXEL_HEIGHT_OFFSET);
}
@Override
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -33,7 +33,6 @@
import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.TypographicConstants;
-import org.axsl.font.FontConstants;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.output.GraphicOutput;
import org.axsl.primitive.sequence.ByteSequence;
@@ -266,7 +265,7 @@
final int computedWidth = Math.round(
((float) pixelWidth / (float) pixelsPerInch)
* TypographicConstants.POINTS_PER_INCH
- * FontConstants.MILLIPOINTS_PER_POINT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
return computedWidth;
}
@@ -298,7 +297,7 @@
final int computedHeight = Math.round(
((float) pixelHeight / (float) pixelsPerInch)
* TypographicConstants.POINTS_PER_INCH
- * FontConstants.MILLIPOINTS_PER_POINT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
return computedHeight;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -35,7 +35,7 @@
package org.foray.graphic;
import org.foray.common.ColorSpaceCmyk;
-import org.foray.common.WellKnownConstants;
+import org.foray.primitive.ByteUtils;
import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.PrimitiveConstants;
@@ -247,7 +247,7 @@
cont = processNextChunk(contentBytes, iccStream, index);
if (cont) {
index += 2;
- index += WellKnownConstants.unsignedBytesToIntBE(contentBytes, index);
+ index += ByteUtils.unsignedBytesToIntBE(contentBytes, index);
}
}
}
@@ -407,8 +407,7 @@
iccString, 0,
compareString.length());
if (compareString.equals(new String(iccString))) {
- final int chunkSize = WellKnownConstants.unsignedBytesToIntBE(contentBytes,
- index + 2);
+ final int chunkSize = ByteUtils.unsignedBytesToIntBE(contentBytes, index + 2);
iccStream.write(contentBytes, index + JpegGraphic.ICC_HEADER_SIZE,
chunkSize - JpegGraphic.ICC_HEADER_SIZE);
}
@@ -510,17 +509,14 @@
// index + 4 is the data precision (bits/sample).
// index + 5 & index + 6 are the image heigh, in pixels
// index + 7 & index + 8 are the image width, in pixels
- this.pixelHeight = WellKnownConstants.unsignedBytesToIntBE(readBuffer,
- index + JpegGraphic.HEIGHT_OFFSET);
- this.pixelWidth = WellKnownConstants.unsignedBytesToIntBE(readBuffer,
- index + JpegGraphic.WIDTH_OFFSET);
+ this.pixelHeight = ByteUtils.unsignedBytesToIntBE(readBuffer, index + JpegGraphic.HEIGHT_OFFSET);
+ this.pixelWidth = ByteUtils.unsignedBytesToIntBE(readBuffer, index + JpegGraphic.WIDTH_OFFSET);
break;
}
default: {
// Eat the segment marker and segment type bytes
index += 2;
- final int toSkip = WellKnownConstants.unsignedBytesToIntBE(readBuffer,
- index);
+ final int toSkip = ByteUtils.unsignedBytesToIntBE(readBuffer, index);
index += toSkip;
}
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -37,7 +37,6 @@
import org.axsl.constants.PrimitiveConstants;
import org.axsl.constants.TypographicConstants;
-import org.axsl.font.FontConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.primitive.sequence.ByteSequence;
@@ -354,7 +353,7 @@
return Math.round(this.pixelWidth()
/ this.xResolution
* TypographicConstants.POINTS_PER_INCH
- * FontConstants.MILLIPOINTS_PER_POINT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
@Override
@@ -362,7 +361,7 @@
return Math.round(this.pixelHeight()
/ this.yResolution
* TypographicConstants.POINTS_PER_INCH
- * FontConstants.MILLIPOINTS_PER_POINT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
@Override
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfTextPainter.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -33,10 +33,8 @@
package org.foray.graphic.batik;
-import org.foray.common.WellKnownConstants;
-
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
import org.axsl.font.FontException;
@@ -281,9 +279,9 @@
final int letterSpacing = 0;
/* TODO: Pass the font options below instead of hard-coding them. */
final int width = fontToUse.width(txt, 0, txt.length(),
- awtFontSize * FontConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
+ awtFontSize * TypographicConstants.MILLIPOINTS_PER_POINT, letterSpacing, 0, FontContext.DEFAULT,
this.orthography);
- final float advance = WellKnownConstants.millipointsToPoints(width);
+ final float advance = width / (float) TypographicConstants.MILLIPOINTS_PER_POINT;
float tx = 0;
if (anchor != null) {
switch (anchor.getType()) {
@@ -334,7 +332,7 @@
FontUtility.foFontFamily(this.fontFamily),
style, weight, Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- fsize * FontConstants.MILLIPOINTS_PER_POINT,
+ fsize * TypographicConstants.MILLIPOINTS_PER_POINT,
' ');
if (font != null) {
/* TODO: Since PdfGraphics2D has moved to the foray-pdf project, this test can no longer be done.
@@ -355,7 +353,7 @@
weight,
Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- fsize * FontConstants.MILLIPOINTS_PER_POINT,
+ fsize * TypographicConstants.MILLIPOINTS_PER_POINT,
' ');
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -40,7 +40,7 @@
import org.foray.primitive.StringUtils;
import org.axsl.constants.PrimitiveConstants;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.graphic.Graphic;
import org.apache.xmlgraphics.java2d.AbstractGraphics2D;
@@ -313,7 +313,7 @@
final int qtyElements) {
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < qtyElements; i++) {
- buffer.append(PsUtil.doubleOut(FontConstants.MILLIPOINTS_PER_POINT * matrix[i]));
+ buffer.append(PsUtil.doubleOut(TypographicConstants.MILLIPOINTS_PER_POINT * matrix[i]));
buffer.append(StringUtils.SINGLE_SPACE);
}
return buffer.toString();
@@ -426,7 +426,7 @@
this.out.write("[");
for (int count = 0; count < da.length; count++) {
this.out.write(""
- + (FontConstants.MILLIPOINTS_PER_POINT
+ + (TypographicConstants.MILLIPOINTS_PER_POINT
* (int) da[count]));
if (count < da.length - 1) {
this.out.write(" ");
@@ -434,7 +434,7 @@
}
this.out.write("] ");
final float offset = bs.getDashPhase();
- this.out.write((FontConstants.MILLIPOINTS_PER_POINT
+ this.out.write((TypographicConstants.MILLIPOINTS_PER_POINT
* (int) offset) + " setdash");
}
final int ec = bs.getEndCap();
@@ -464,12 +464,12 @@
}
final float lw = bs.getLineWidth();
this.out.write(PsUtil.doubleOut(
- FontConstants.MILLIPOINTS_PER_POINT * lw)
+ TypographicConstants.MILLIPOINTS_PER_POINT * lw)
+ " setlinewidth");
final float ml = bs.getMiterLimit();
this.out.write(PsUtil.doubleOut(
- FontConstants.MILLIPOINTS_PER_POINT * ml)
+ TypographicConstants.MILLIPOINTS_PER_POINT * ml)
+ " setmiterlimit");
}
}
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifDocument.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
/**
* A MIF Document.
@@ -56,8 +56,8 @@
final StringBuilder mif = new StringBuilder();
mif.append(MifBook.EOL
+ "<Document " + MifBook.EOL
- + "<DPageSize " + this.width / FontConstants.MILLIPOINTS_PER_POINT
- + " " + this.height / FontConstants.MILLIPOINTS_PER_POINT + " >"
+ + "<DPageSize " + this.width / TypographicConstants.MILLIPOINTS_PER_POINT
+ + " " + this.height / TypographicConstants.MILLIPOINTS_PER_POINT + " >"
+ MifBook.EOL
+ ">");
return mif.toString();
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifFrame.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import java.util.ArrayList;
import java.util.List;
@@ -109,10 +109,10 @@
+ MifBook.TAB + "<AnchorAlign Center>" + MifBook.EOL);
mif.append(MifBook.TAB + "<ShapeRect "
- + this.x / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.y / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / FontConstants.MILLIPOINTS_PER_POINT + " >");
+ + this.x / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.y / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / TypographicConstants.MILLIPOINTS_PER_POINT + " >");
for (int i = 0; i < this.content.size(); i++) {
mif.append(this.content.get(i).mifContent());
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifImportObject.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
/**
* A MIF Import Object.
@@ -95,10 +95,10 @@
mif.append(MifBook.TAB + "<ImportObFileDI " + "`<c\\>" + path + "'"
+ " >" + MifBook.EOL);
mif.append(MifBook.TAB + "<ShapeRect "
- + this.x / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.y / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / FontConstants.MILLIPOINTS_PER_POINT + " >"
+ + this.x / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.y / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / TypographicConstants.MILLIPOINTS_PER_POINT + " >"
+ MifBook.EOL);
mif.append("> #End ImportObj");
return mif.toString();
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifPgf.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import java.util.ArrayList;
import java.util.List;
@@ -104,11 +104,10 @@
+ "<Pgf" + MifBook.EOL
+ "<PgfTag `Body'>" + MifBook.EOL
+ "<PgfLIndent "
- + this.pgf.getStartIndent()
- / FontConstants.MILLIPOINTS_PER_POINT
+ + this.pgf.getStartIndent() / TypographicConstants.MILLIPOINTS_PER_POINT
+ ">" + MifBook.EOL);
mif.append("<PgfRIndent "
- + this.pgf.getEndIndent() / FontConstants.MILLIPOINTS_PER_POINT
+ + this.pgf.getEndIndent() / TypographicConstants.MILLIPOINTS_PER_POINT
+ ">"
+ MifBook.EOL
+ ">");
Modified: trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java
===================================================================
--- trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-mif/src/main/java/org/foray/mif/MifTextRect.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -28,7 +28,7 @@
package org.foray.mif;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
/**
* A MIF Text Rectangle.
@@ -114,15 +114,15 @@
+ "<TextRect" + MifBook.EOL
+ MifBook.TAB + "<ID " + this.textRectID + ">" + MifBook.EOL
+ MifBook.TAB + "<ShapeRect "
- + this.rx / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.ry / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.w / FontConstants.MILLIPOINTS_PER_POINT + " "
- + this.h / FontConstants.MILLIPOINTS_PER_POINT + ">");
+ + this.rx / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.ry / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.w / TypographicConstants.MILLIPOINTS_PER_POINT + " "
+ + this.h / TypographicConstants.MILLIPOINTS_PER_POINT + ">");
if (this.numCols > 1) {
mif.append(MifBook.EOL + "<TRNumColumns " + this.numCols + ">");
mif.append(MifBook.EOL + "<TRColumnGap "
- + this.colGap / FontConstants.MILLIPOINTS_PER_POINT + ">");
+ + this.colGap / TypographicConstants.MILLIPOINTS_PER_POINT + ">");
}
mif.append(MifBook.EOL + "> #End TextRect");
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -35,7 +35,7 @@
import org.foray.pdf.structure.PdfTextString;
import org.foray.primitive.sequence.ByteArray;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.primitive.sequence.ByteSequencePlus;
import java.awt.geom.Rectangle2D;
@@ -124,13 +124,13 @@
+ "/Type /Annot" + EOL
+ "/Subtype /Link" + EOL
+ "/Rect ["
- + getRectangle().getX() / FontConstants.MILLIPOINTS_PER_POINT
+ + getRectangle().getX() / TypographicConstants.MILLIPOINTS_PER_POINT
+ " "
- + getRectangle().getY() / FontConstants.MILLIPOINTS_PER_POINT
+ + getRectangle().getY() / TypographicConstants.MILLIPOINTS_PER_POINT
+ " "
- + (getRectangle().getX() + getRectangle().getWidth()) / FontConstants.MILLIPOINTS_PER_POINT
+ + (getRectangle().getX() + getRectangle().getWidth()) / TypographicConstants.MILLIPOINTS_PER_POINT
+ " "
- + (getRectangle().getY() - getRectangle().getHeight()) / FontConstants.MILLIPOINTS_PER_POINT
+ + (getRectangle().getY() - getRectangle().getHeight()) / TypographicConstants.MILLIPOINTS_PER_POINT
+ "]" + EOL);
buffer.append("/BS " + doc.getDefaultBorderStyle()
.pdfReference(doc) + EOL);
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 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -33,8 +33,8 @@
import org.foray.pdf.type.PdfObject;
import org.foray.primitive.sequence.ByteArray;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
-import org.axsl.font.FontConstants;
import org.axsl.pdf.PdfException;
import org.axsl.primitive.sequence.ByteSequencePlus;
@@ -148,11 +148,11 @@
p.append(EOL + "/Flags ");
p.append(font.getFlags());
p.append(EOL + "/CapHeight ");
- p.append(font.getCapHeight(FontConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getCapHeight(TypographicConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/Ascent ");
- p.append(font.getAscender(FontConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getAscender(TypographicConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/Descent ");
- p.append(font.getDescender(FontConstants.MILLIPOINTS_PER_POINT));
+ p.append(font.getDescender(TypographicConstants.MILLIPOINTS_PER_POINT));
p.append(EOL + "/ItalicAngle ");
p.append(getItalicAngleFormatted());
p.append(EOL + "/StemV ");
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-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -42,7 +42,7 @@
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
-import org.axsl.font.FontConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
import org.axsl.font.FontUtility;
@@ -717,7 +717,7 @@
fontStyle, fontWeight,
org.axsl.font.Font.Variant.NORMAL,
org.axsl.font.Font.Stretch.NORMAL,
- (int) (fontSize * FontConstants.MILLIPOINTS_PER_POINT),
+ (int) (fontSize * TypographicConstants.MILLIPOINTS_PER_POINT),
' ');
if (fontUse == null) {
fontUse = this.fontConsumer.selectFontFallback();
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/ByteUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/ByteUtils.java 2022-12-13 21:13:16 UTC (rev 12852)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/ByteUtils.java 2022-12-13 21:47:57 UTC (rev 12853)
@@ -120,4 +120,150 @@
return (byte) HEX_CHARS.charAt(index);
}
+ /**
+ * Converts four unsigned bytes to a long.
+ * (It must be converted to a long because the Java int is signed).
+ * @param byte1 The high-order byte.
+ * @param byte2 The second highest-order byte.
+ * @param byte3 The third highest-order byte.
+ * @param byte4 The low-order byte.
+ * @return The long represented by the four bytes.
+ */
+ public static long unsignedBytesToLong(final byte byte1, final byte byte2,
+ final byte byte3, final byte byte4) {
+ final int int1 = unsignedByteToInt(byte1);
+ final int int2 = unsignedByteToInt(byte2);
+ final int int3 = unsignedByteToInt(byte3);
+ final int int4 = unsignedByteToInt(byte4);
+ return (int1 << PrimitiveConstants.SHIFT_3_BYTES)
+ | (int2 << PrimitiveConstants.SHIFT_2_BYTES)
+ | (int3 << PrimitiveConstants.SHIFT_1_BYTE)
+ | int4;
+ }
+
+ /**
+ * Converts one unsigned byte to its integer equivalent.
+ * @param unsignedByte The byte to be converted.
+ * @return The integer equivalent of {@code unsignedByte}.
+ */
+ public static int unsignedByteToInt(final byte unsignedByte) {
+ final int converted = unsignedByte & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
+ return converted;
+ }
+
+ /**
+ * Converts four unsigned big-endian bytes from an array of bytes to a long.
+ * (It must be converted to a long because the Java int is signed).
+ * @param byteArray The array of bytes containing the bytes to be converted.
+ * @param start The index to the first byte in the array to be converted.
+ * This is the high-order byte of the 4 bytes. The second byte will be
+ * indexed at start + 1, the third byte at start + 2, and the fourth byte
+ * at start + 3.
+ * @return The long represented by the four bytes.
+ */
+ public static long unsignedBytesToLongBE(final byte[] byteArray,
+ final int start) {
+ if (byteArray == null
+ || start < 0
+ || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
+ /* Fails silently. */
+ return 0;
+ }
+ int index = start;
+ return unsignedBytesToLong(
+ byteArray[index++],
+ byteArray[index++],
+ byteArray[index++],
+ byteArray[index]);
+ }
+
+ /**
+ * Converts four unsigned little-endian bytes from an array of bytes to a
+ * long.
+ * (It must be converted to a long because the Java int is signed).
+ * @param byteArray The array of bytes containing the bytes to be converted.
+ * @param start The index to the first byte in the array to be converted.
+ * This is the low-order byte of the 4 bytes. The second byte will be
+ * indexed at start + 1, the third byte at start + 2, and the fourth byte
+ * (the high-order byte) at start + 3.
+ * @return The long represented by the four bytes.
+ */
+ public static long unsignedBytesToLongLE(final byte[] byteArray,
+ final int start) {
+ if (byteArray == null
+ || start < 0
+ || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
+ /* Fails silently. */
+ return 0;
+ }
+ int index = start + PrimitiveConstants.BYTES_PER_INT - 1;
+ return unsignedBytesToLong(
+ byteArray[index--],
+ byteArray[index--],
+ byteArray[index--],
+ byteArray[index]);
+ }
+
+ /**
+ * Converts two unsigned bytes to an int.
+ * (It must be converted to an int because the Java short is signed).
+ * @param byte1 The high-order byte.
+ * @param byte2 The low-order byte.
+ * @return The int represented by the two bytes.
+ */
+ public static int unsignedBytesToInt(final byte byte1, final byte byte2) {
+ return (int) unsignedBytesToLong((byte) 0, (byte) 0, byte1, byte2);
+ }
+
+ /**
+ * Converts two unsigned big-endian bytes from an array of bytes to an int.
+ * (It must be converted to an int because the Java short is signed).
+ * @param byteArray The array of bytes containing the bytes to be converted.
+ * @param start The index to the first byte in the array to be converted.
+ * This is the high-order byte of the 2 bytes. The second byte (the
+ * low-order byte) will be indexed at start + 1.
+ * @return The int represented by the two bytes.
+ */
+ public static int unsignedBytesToIntBE(final byte[] byteArray,
+ final int start) {
+ if (byteArray == null
+ || start < 0
+ || start + PrimitiveConstants.BYTES_PER_SHORT > byteArray.length) {
+ /* Fails silently. */
+ return 0;
+ }
+ int index = start;
+ return (int) unsignedBytesToLong(
+ (byte) 0,
+ (byte) 0,
+ byteArray[index++],
+ byteArray[index]);
+ }
+
+ /**
+ * Converts two unsigned little-endian bytes from an array of bytes to an
+ * int.
+ * (It must be converted to an int because the Java short is signed).
+ * @param byteArray The array of bytes containing the bytes to be converted.
+ * @param start The index to the first byte in the array to be converted.
+ * This is the low-order byte of the 4 bytes. The second byte (the
+ * high-order byte) at start + 1.
+ * @return The int represented by the two bytes.
+ */
+ public static int unsignedBytesToIntLE(final byte[] byteArray,
+ final int start) {
+ if (byteArray == null
+ || start < 0
+ || star...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-13 21:13:20
|
Revision: 12852
http://sourceforge.net/p/foray/code/12852
Author: victormote
Date: 2022-12-13 21:13:16 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Move remaining constants out of WellKnownConstants.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfiguredFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderEndPrecedenceTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderLeftTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderStartPrecedenceTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ExternalDestinationTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontSelectionStrategyTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/GlyphOrientationVerticalTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/HyphenationCharacterTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IndicateDestinationTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/InternalDestinationTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IntrinsicScaleValueTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/LineStackingStrategyTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsRepeatedTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsSpannedTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageCitationStrategyTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageNumberTreatmentTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ReferenceOrientationTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RegionNameReferenceTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SuppressAtLineBreakTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TargetProcessingContextTests.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/WhiteSpaceTreatmentTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfContentStream4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCmap.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsOperatorException.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVectorInputStream.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageCollection4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -30,7 +30,7 @@
import org.foray.area.link.Link;
import org.foray.common.PositiveIntegerFormatter;
-import org.foray.common.WellKnownConstants;
+import org.foray.primitive.StringUtils;
import org.axsl.area.AreaTreeException;
import org.axsl.area.PageCollection;
@@ -387,7 +387,7 @@
public CharSequence getPageNumberPrefix() {
final FolioPrefix prefix = this.traitGeneratedBy().getFolioPrefix();
if (prefix == null) {
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
return prefix.getContentAsText();
}
@@ -396,7 +396,7 @@
public CharSequence getPageNumberSuffix() {
final FolioSuffix suffix = this.traitGeneratedBy().getFolioSuffix();
if (suffix == null) {
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
return suffix.getContentAsText();
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,11 +28,8 @@
package org.foray.common;
-import org.foray.primitive.sequence.ByteArray;
-
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.FontConstants;
-import org.axsl.unicode.block.Basic_Latin_Block;
/**
* Class containing well-known or commonly-used constants and conversions.
@@ -39,21 +36,6 @@
*/
public final class WellKnownConstants {
- /** The carriage-return / linefeed combination, cast as a byte array. */
- public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED =
- new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN, (byte) Basic_Latin_Block.CONTROL_LINE_FEED);
-
- /** An empty String useful for return values that might return "null", but
- * could return this more safely. Using this constant in such cases is
- * entirely safe as String instances are immutable. */
- public static final String EMPTY_STRING = "";
-
- /** Constant defining an invalid character value. */
- public static final char INVALID_UNICODE_CHARACTER = Character.MAX_VALUE;
-
- /** Constant defining the largest integral color value, that is, 255. */
- public static final short MAXIMUM_INTEGRAL_COLOR_VALUE = 255;
-
/**
* Private constructor. This is a utility class, and should never be instantiated.
*/
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,7 +28,6 @@
package org.foray.common.primitive;
-import org.foray.common.WellKnownConstants;
import org.foray.primitive.StringUtils;
import org.axsl.constants.PrimitiveConstants;
@@ -40,6 +39,9 @@
*/
public final class UnicodeCharUtils {
+ /** Constant containing a value that is not a valid Unicode character, which can be useful as a marker in text. */
+ public static final char INVALID_UNICODE_CHARACTER = Character.MAX_VALUE;
+
/** The minimum size for a Unicode String, that is, 3, for example "U+9". */
private static final byte MIN_UNICODE_STRING_SIZE = 3;
@@ -67,12 +69,11 @@
* "Printable" for this purpose is defined as a code point that would
* require a glyph.
* @param inputChars The array of chars to be checked.
- * @return The first printable Unicode code point in the array, or
- * {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if there is no printable
- * code point.
+ * @return The first printable Unicode code point in the array, or {@link #INVALID_UNICODE_CHARACTER} if there is no
+ * printable code point.
*/
public static int firstPrintable(final char[] inputChars) {
- final int returnChar = WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ final int returnChar = UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
if (inputChars == null) {
return returnChar;
}
@@ -95,12 +96,11 @@
* "Printable" for this purpose is defined as a code point that would
* require a glyph.
* @param inputChars The array of chars to be checked.
- * @return The first printable Unicode code point in the array, or
- * {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if there is no printable
- * code point.
+ * @return The first printable Unicode code point in the array, or {@link #INVALID_UNICODE_CHARACTER} if there is no
+ * printable code point.
*/
public static int firstPrintable(final CharSequence inputChars) {
- final int returnChar = WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ final int returnChar = UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
if (inputChars == null) {
return returnChar;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfiguredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfiguredFont.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/ConfiguredFont.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,7 +28,7 @@
package org.foray.font.config;
-import org.foray.common.WellKnownConstants;
+import org.foray.primitive.StringUtils;
import org.axsl.font.Font;
@@ -72,11 +72,11 @@
*/
public String invalidMessage() {
if (this.getPostScriptName() == null
- || this.getPostScriptName().equals(WellKnownConstants.EMPTY_STRING)) {
+ || this.getPostScriptName().equals(StringUtils.EMPTY_STRING)) {
return "Null font name";
}
if (this.getFamilyName() == null
- || this.getFamilyName().equals(WellKnownConstants.EMPTY_STRING)) {
+ || this.getFamilyName().equals(StringUtils.EMPTY_STRING)) {
return "Null family name";
}
if (this.getWeight() == null) {
@@ -94,7 +94,7 @@
*/
public String getPostScriptName() {
if (this.postScriptName == null
- || this.postScriptName.equals(WellKnownConstants.EMPTY_STRING)) {
+ || this.postScriptName.equals(StringUtils.EMPTY_STRING)) {
/* If there is no font name, use the family name instead. */
return this.familyName;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -29,7 +29,6 @@
package org.foray.fotree;
import org.foray.common.FontUtil;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.AbstractOrderedTreeNode;
import org.foray.common.i18n.Country4a;
import org.foray.common.i18n.Language4a;
@@ -57,6 +56,7 @@
import org.foray.fotree.fo.prop.PdWritingMode;
import org.foray.fotree.value.DtBorderWidth;
import org.foray.fotree.value.DtWritingMode;
+import org.foray.primitive.StringUtils;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
@@ -2916,7 +2916,7 @@
protected FontUse resolvePrimaryFont(final FoContext context) {
final CharSequence firstTextSegment = this.firstTextSegment(context);
int firstChar = UnicodeCharUtils.firstPrintable(firstTextSegment);
- if (firstChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (firstChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
/* There are no printable characters in the first text segment,
* so what we do here doesn't matter much. We set the first
* char to space so that virtually any font should pass the
@@ -3443,7 +3443,7 @@
@Override
public String traitChangeBarClass() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
@@ -3479,13 +3479,13 @@
@Override
public String traitIndexClass() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
public String traitIndexKey() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
@@ -3515,7 +3515,7 @@
@Override
public String traitRefIndexKey() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,7 +28,6 @@
package org.foray.fotree;
-import org.foray.common.WellKnownConstants;
import org.foray.common.i18n.Country4a;
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
@@ -230,6 +229,7 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.xml.XmlPropertyId;
import org.foray.fotree.xml.prop.Lang;
+import org.foray.primitive.StringUtils;
import org.axsl.font.Font;
import org.axsl.fotree.FoContext;
@@ -3539,7 +3539,7 @@
if (property != null) {
return property.getValue();
}
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,11 +28,11 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoContainerTextOnly;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
+import org.foray.primitive.StringUtils;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
@@ -190,7 +190,7 @@
@Override
public String getText() {
if (this.children.size() < 1) {
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
final AbstractCharacterSequence child = this.formattingObjectChildAt(0);
final CharSequence text = child.getRefinedText(null);
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 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,7 +28,7 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
+import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.primitive.sequence.IntArrayBuilder;
@@ -84,7 +84,7 @@
/* Check linefeed-treatment. */
final char raw = wrapped.charAt(index);
final char filtered = FoText4a.applyLinefeedTreatment(raw, linefeedTreatment);
- if (filtered == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (filtered == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
deleted.append(index);
} else if (filtered != raw) {
changed.append(index);
@@ -107,7 +107,7 @@
final int charBefore = index == 0 ? codepointBefore : wrapped.charAt(index - 1);
final int charAfter = index == wrapped.length() - 1 ? codepointAfter : wrapped.charAt(index + 1);
final char filtered = FoText4a.applyWhiteSpaceCollapse(charBefore, raw, charAfter);
- if (filtered == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (filtered == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
deleted.insertSortedUnique(index);
} else if (filtered != raw) {
final int changeIndex = changed.insertSortedUnique(index);
@@ -139,7 +139,7 @@
}
if (this.deleted.binarySearch(realIndex) > -1) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
final int deltaIndex = this.changed.binarySearch(realIndex);
final char filteredChar = deltaIndex > -1 ? this.deltas.charAt(deltaIndex) : this.wrapped.charAt(realIndex);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -27,7 +27,7 @@
*/
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
+import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
@@ -178,8 +178,8 @@
* @param index Index into charArray pointing to a char element that is to be converted.
* @param whiteSpaceTreatment The value of the whitespace-treatment trait.
* @return The character to which the charArray[index] should be converted for white-space-treatment purposes.
- * Returns {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if charArray[index] should be discarded.
- * Note that {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
+ * Returns {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if charArray[index] should be discarded.
+ * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
* therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final CharSequence charArray, final int index,
@@ -187,7 +187,7 @@
/* The char immediately before. */
final char before;
if (index == 0) {
- before = WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ before = UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
} else {
before = charArray.charAt(index - 1);
}
@@ -198,7 +198,7 @@
/* The char immediately after. */
final char after;
if (index == charArray.length() - 1) {
- after = WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ after = UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
} else {
after = charArray.charAt(index + 1);
}
@@ -212,9 +212,9 @@
* @param c The char being tested.
* @param charAfter The char immediately after the char being tested, or -1 of there is none.
* @param whiteSpaceTreatment The value of the whitespace-treatment trait.
- * @return The char at this index, or {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if this char should be
+ * @return The char at this index, or {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if this char should be
* discarded.
- * Note that {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
+ * Note that {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} is not a valid Unicode codepoint, and should
* therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final char charBefore, final char c, final char charAfter,
@@ -228,42 +228,42 @@
return c;
}
switch (whiteSpaceTreatment) {
- case IGNORE: return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ case IGNORE: return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
case PRESERVE: return ' ';
case IGNORE_IF_BEFORE_LINEFEED: {
/* If last element, no change needed. */
- if (charAfter == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (charAfter == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
return c;
}
if (charAfter != Basic_Latin_Block.CONTROL_LINE_FEED) {
return c;
}
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
case IGNORE_IF_AFTER_LINEFEED: {
/* If first element, no change needed. */
- if (charBefore == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (charBefore == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
return c;
}
if (charBefore != Basic_Latin_Block.CONTROL_LINE_FEED) {
return c;
}
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
/* default handles "initial" value IGNORE_IF_SURROUNDING_LINEFEED */
default: {
/* If first element, only check next. */
- if (charBefore == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (charBefore == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
if (charAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
return c;
}
/* If last element, only check previous. */
- if (charAfter == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (charAfter == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
if (charBefore == Basic_Latin_Block.CONTROL_LINE_FEED) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
return c;
}
@@ -270,7 +270,7 @@
/* Otherwise, check both. */
if (charBefore == Basic_Latin_Block.CONTROL_LINE_FEED
|| charAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
return c;
}
@@ -314,7 +314,7 @@
final char c = charArray.charAt(i);
final char conversionChar = applyWhiteSpaceTreatment(charArray, i,
whiteSpaceTreatment);
- if (conversionChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (conversionChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
discardElements ++;
} else if (conversionChar != c) {
changeElements ++;
@@ -333,7 +333,7 @@
for (int i = 0; i < charArray.length(); i++) {
final char conversionChar = applyWhiteSpaceTreatment(charArray,
i, whiteSpaceTreatment);
- if (conversionChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (conversionChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
discardElements ++;
} else {
returnArray[i - discardElements] = conversionChar;
@@ -349,7 +349,7 @@
* @param c The character being processed, which should always be a linefeed character.
* @param linefeedTreatment The value of the linefeed-treatment trait.
* @return The value by which the linefeed character should be replaced, or the marker
- * {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} indicating that the character should be removed.
+ * {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} indicating that the character should be removed.
*/
public static char applyLinefeedTreatment(final char c, final LinefeedTreatment linefeedTreatment) {
if (c != Basic_Latin_Block.CONTROL_LINE_FEED) {
@@ -357,7 +357,7 @@
return c;
}
switch (linefeedTreatment) {
- case IGNORE: return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ case IGNORE: return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
case TREAT_AS_SPACE: return ' ';
case TREAT_AS_ZERO_WIDTH_SPACE: return '\u200b';
// default handles the "initial" value of "preserve"
@@ -419,7 +419,7 @@
if (c == Basic_Latin_Block.CONTROL_LINE_FEED) {
final char conversionChar = applyLinefeedTreatment(c,
linefeedTreatment);
- if (conversionChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (conversionChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
discardElements ++;
} else {
returnArray[i - discardElements] = conversionChar;
@@ -487,16 +487,16 @@
* should <em>not</em> be considered.</p>
* @param charArray The char[] that is being converted.
* @param index The 0-based index into charArray that points to the char that is being tested.
- * @return {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if the previous character is whitespace or if the
+ * @return {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if the previous character is whitespace or if the
* next character is a line-feed.
* If neither of these is true, returns the original character.
*/
public static char applyWhiteSpaceCollapse(final CharSequence charArray, final int index) {
- final char charBefore = (index == 0) ? WellKnownConstants.INVALID_UNICODE_CHARACTER :
+ final char charBefore = (index == 0) ? UnicodeCharUtils.INVALID_UNICODE_CHARACTER :
charArray.charAt(index - 1);
final char c = charArray.charAt(index);
final char charAfter = (index == charArray.length() - 1) ?
- WellKnownConstants.INVALID_UNICODE_CHARACTER : charArray.charAt(index + 1);
+ UnicodeCharUtils.INVALID_UNICODE_CHARACTER : charArray.charAt(index + 1);
return applyWhiteSpaceCollapse(charBefore, c, charAfter);
}
@@ -505,7 +505,7 @@
* @param codepointBefore The codepoint before c, or -1 if there is none.
* @param c The character being considered for conversion.
* @param codepointAfter The codepoint after c, or if there is none.
- * @return {@link WellKnownConstants#INVALID_UNICODE_CHARACTER} if the previous character is whitespace or if the
+ * @return {@link UnicodeCharUtils#INVALID_UNICODE_CHARACTER} if the previous character is whitespace or if the
* next character is a line-feed.
* If neither of these is true, returns the original character.
*/
@@ -518,12 +518,12 @@
/* If it is a linefeed, nothing should change. */
return c;
}
- if (codepointBefore != WellKnownConstants.INVALID_UNICODE_CHARACTER
+ if (codepointBefore != UnicodeCharUtils.INVALID_UNICODE_CHARACTER
&& XmlCharacterUtils.isXMLWhitespace(codepointBefore)) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
if (codepointAfter == Basic_Latin_Block.CONTROL_LINE_FEED) {
- return WellKnownConstants.INVALID_UNICODE_CHARACTER;
+ return UnicodeCharUtils.INVALID_UNICODE_CHARACTER;
}
return c;
}
@@ -548,7 +548,7 @@
int discardElements = 0;
for (int i = 0; i < charArray.length(); i++) {
final char convertChar = applyWhiteSpaceCollapse(charArray, i);
- if (convertChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (convertChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
discardElements ++;
}
}
@@ -563,7 +563,7 @@
discardElements = 0;
for (int i = 0; i < charArray.length(); i++) {
final char conversionChar = applyWhiteSpaceCollapse(charArray, i);
- if (conversionChar == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (conversionChar == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
discardElements ++;
} else {
returnArray[i - discardElements] = conversionChar;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumber4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,9 +28,9 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
+import org.foray.primitive.StringUtils;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoVisitor;
@@ -85,7 +85,7 @@
@Override
public String getFolioNumberString(final int folioNumber) {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitation4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,9 +28,9 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
+import org.foray.primitive.StringUtils;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoVisitor;
@@ -86,7 +86,7 @@
@Override
public String getFolioNumberString(final int folioNumber) {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/PageNumberCitationLast4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,9 +28,9 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
+import org.foray.primitive.StringUtils;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoVisitor;
@@ -86,7 +86,7 @@
@Override
public String getFolioNumberString(final int folioNumber) {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ScalingValueCitation4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
+import org.foray.primitive.StringUtils;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoTreeException;
@@ -113,7 +113,7 @@
@Override
public String getAppliedScaleFactorString(final int actualScaleFactor) {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderEndPrecedenceTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderEndPrecedenceTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderEndPrecedenceTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdBorderEndPrecedence}.
@@ -42,7 +42,7 @@
protected PdBorderEndPrecedence createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdBorderEndPrecedence property = new PdBorderEndPrecedence(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderLeftTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderLeftTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderLeftTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdBorderLeft}.
@@ -42,7 +42,7 @@
protected PdBorderLeft createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdBorderLeft property = new PdBorderLeft(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderStartPrecedenceTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderStartPrecedenceTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/BorderStartPrecedenceTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdBorderStartPrecedence}.
@@ -42,7 +42,7 @@
protected PdBorderStartPrecedence createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdBorderStartPrecedence property = new PdBorderStartPrecedence(
- fobj, WellKnownConstants.EMPTY_STRING, attributeValue);
+ fobj, StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ExternalDestinationTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ExternalDestinationTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ExternalDestinationTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
import org.junit.jupiter.api.Test;
@@ -43,7 +43,7 @@
@Override
protected PdExternalDestination createProperty(final FoObj fobj, final String attributeValue)
throws PropertyException {
- final PdExternalDestination property = new PdExternalDestination(fobj, WellKnownConstants.EMPTY_STRING,
+ final PdExternalDestination property = new PdExternalDestination(fobj, StringUtils.EMPTY_STRING,
attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontSelectionStrategyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontSelectionStrategyTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/FontSelectionStrategyTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdFontSelectionStrategy}.
@@ -42,7 +42,7 @@
protected PdFontSelectionStrategy createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdFontSelectionStrategy property = new PdFontSelectionStrategy(
- fobj, WellKnownConstants.EMPTY_STRING, attributeValue);
+ fobj, StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/GlyphOrientationVerticalTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/GlyphOrientationVerticalTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/GlyphOrientationVerticalTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdGlyphOrientationVertical}.
@@ -42,7 +42,7 @@
protected PdGlyphOrientationVertical createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdGlyphOrientationVertical property =
- new PdGlyphOrientationVertical(fobj, WellKnownConstants.EMPTY_STRING,
+ new PdGlyphOrientationVertical(fobj, StringUtils.EMPTY_STRING,
attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/HyphenationCharacterTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/HyphenationCharacterTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/HyphenationCharacterTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdHyphenationCharacter}.
@@ -42,7 +42,7 @@
protected PdHyphenationCharacter createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdHyphenationCharacter property = new PdHyphenationCharacter(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IndicateDestinationTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IndicateDestinationTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IndicateDestinationTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdIndicateDestination}.
@@ -42,7 +42,7 @@
protected PdIndicateDestination createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdIndicateDestination property = new PdIndicateDestination(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/InternalDestinationTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/InternalDestinationTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/InternalDestinationTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,9 +28,9 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdInternalDestination}.
@@ -41,7 +41,7 @@
protected PdInternalDestination createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdInternalDestination property = new PdInternalDestination(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IntrinsicScaleValueTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IntrinsicScaleValueTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/IntrinsicScaleValueTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdIntrinsicScaleValue}.
@@ -42,7 +42,7 @@
protected PdIntrinsicScaleValue createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdIntrinsicScaleValue property = new PdIntrinsicScaleValue(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/LineStackingStrategyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/LineStackingStrategyTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/LineStackingStrategyTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdLineStackingStrategy}.
@@ -42,7 +42,7 @@
protected PdLineStackingStrategy createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdLineStackingStrategy property = new PdLineStackingStrategy(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsRepeatedTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsRepeatedTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsRepeatedTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdNumberColumnsRepeated}.
@@ -42,7 +42,7 @@
protected PdNumberColumnsRepeated createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdNumberColumnsRepeated property = new PdNumberColumnsRepeated(
- fobj, WellKnownConstants.EMPTY_STRING, attributeValue);
+ fobj, StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsSpannedTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsSpannedTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/NumberColumnsSpannedTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdNumberColumnsSpanned}.
@@ -42,7 +42,7 @@
protected PdNumberColumnsSpanned createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdNumberColumnsSpanned property = new PdNumberColumnsSpanned(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageCitationStrategyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageCitationStrategyTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageCitationStrategyTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdPageCitationStrategy}.
@@ -42,7 +42,7 @@
protected PdPageCitationStrategy createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdPageCitationStrategy property = new PdPageCitationStrategy(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageNumberTreatmentTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageNumberTreatmentTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/PageNumberTreatmentTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdPageNumberTreatment}.
@@ -42,7 +42,7 @@
protected PdPageNumberTreatment createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdPageNumberTreatment property = new PdPageNumberTreatment(fobj,
- WellKnownConstants.EMPTY_STRING,
+ StringUtils.EMPTY_STRING,
attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ReferenceOrientationTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ReferenceOrientationTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/ReferenceOrientationTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdReferenceOrientation}.
@@ -42,7 +42,7 @@
protected PdReferenceOrientation createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdReferenceOrientation property = new PdReferenceOrientation(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RegionNameReferenceTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RegionNameReferenceTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/RegionNameReferenceTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,9 +28,9 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdRegionNameReference}.
@@ -41,7 +41,7 @@
protected PdRegionNameReference createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdRegionNameReference property = new PdRegionNameReference(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SuppressAtLineBreakTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SuppressAtLineBreakTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/SuppressAtLineBreakTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdSuppressAtLineBreak}.
@@ -42,7 +42,7 @@
protected PdSuppressAtLineBreak createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdSuppressAtLineBreak property = new PdSuppressAtLineBreak(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TargetProcessingContextTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TargetProcessingContextTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/TargetProcessingContextTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
import org.junit.jupiter.api.Test;
@@ -45,7 +45,7 @@
final FoObj fobj, final String attributeValue)
throws PropertyException {
final PdTargetProcessingContext property =
- new PdTargetProcessingContext(fobj, WellKnownConstants.EMPTY_STRING,
+ new PdTargetProcessingContext(fobj, StringUtils.EMPTY_STRING,
attributeValue);
return property;
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/WhiteSpaceTreatmentTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/WhiteSpaceTreatmentTests.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/prop/WhiteSpaceTreatmentTests.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.AbstractPropertyTests;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.foray.primitive.StringUtils;
/**
* JUnit test class for the class {@link PdWhiteSpaceTreatment}.
@@ -42,7 +42,7 @@
protected PdWhiteSpaceTreatment createProperty(final FoObj fobj,
final String attributeValue) throws PropertyException {
final PdWhiteSpaceTreatment property = new PdWhiteSpaceTreatment(fobj,
- WellKnownConstants.EMPTY_STRING, attributeValue);
+ StringUtils.EMPTY_STRING, attributeValue);
return property;
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -35,7 +35,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.WellKnownConstants;
import org.foray.primitive.StringUtils;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
@@ -123,25 +122,25 @@
@Override
public String preDelete() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
public String preInsert() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
public String postDelete() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
public String postInsert() {
/* TODO: Implement this. */
- return WellKnownConstants.EMPTY_STRING;
+ return StringUtils.EMPTY_STRING;
}
@Override
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-13 20:18:31 UTC (rev 12851)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2022-12-13 21:13:16 UTC (rev 12852)
@@ -31,6 +31,7 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharSequenceUtils;
+import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
import org.axsl.fotree.text.FoWhitespace;
@@ -179,7 +180,7 @@
/* Apply linefeed-treatment. */
returnValue = applyLinefeedTreatment(returnValue, textModifiers.traitLinefeedTreatment());
- if (returnValue == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (returnValue == UnicodeCharUtils.INVALID_UNICODE_CHARACTER) {
return 0;
}
@@ -201,7 +202,7 @@
char returnValue = this.nativeChar;
returnValue = applyLinefeedTreatment(returnValue, textModifiers.traitLinefeedTreatment());
- if (returnValue == WellKnownConstants.INVALID_UNICODE_CHARACTER) {
+ if (returnValue == UnicodeCharUtils.INVALID_UNICO...
[truncated message content] |