[FOray-commit] SF.net SVN: foray:[12326] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-01-03 16:31:06
|
Revision: 12326
http://sourceforge.net/p/foray/code/12326
Author: victormote
Date: 2022-01-03 16:31:03 +0000 (Mon, 03 Jan 2022)
Log Message:
-----------
Improvements toward handline word-based text.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
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-01-03 15:03:22 UTC (rev 12325)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LineArea4a.java 2022-01-03 16:31:03 UTC (rev 12326)
@@ -1005,8 +1005,8 @@
final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine) {
if (shouldCreateTextArea(foText, this, startOffset, sizeInChars, isLastItemOnLine, this)) {
- final TextArea newTextArea = TextAreaCharacters.makeTextArea(foText, this, startOffset, sizeInChars, ipd,
- hasDiscretionaryHyphen, hasFauxSmallCaps);
+ final TextAreaCharacters newTextArea = TextAreaCharacters.makeTextArea(foText, this, startOffset,
+ sizeInChars, ipd, hasDiscretionaryHyphen, hasFauxSmallCaps);
this.children.add(newTextArea);
return newTextArea;
}
@@ -1016,7 +1016,9 @@
@Override
public GlyphAreaSequenceG5 makeGlyphAreaSequence(final FoTextWords paragraph, final int startLeaf,
final int sizeInLeaves, final boolean hasFauxSmallCaps) {
- throw new UnsupportedOperationException();
+ final TextAreaWords newTextArea = TextAreaWords.makeTextArea(paragraph, this, startLeaf, sizeInLeaves);
+ this.children.add(newTextArea);
+ return newTextArea;
}
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-01-03 15:03:22 UTC (rev 12325)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaWords.java 2022-01-03 16:31:03 UTC (rev 12326)
@@ -97,8 +97,9 @@
@Override
public CharSequence getText() {
final StringBuilder builder = new StringBuilder();
- for (int index = this.startingLeafIndex; index < (this.startingLeafIndex + qtyLeaves); index ++) {
- final ParaLeaf leaf = this.foLink.getGenerator().paraLeafAt(index);
+ final FoTextWords words = this.foLink.getGenerator();
+ for (int index = this.startingLeafIndex; index < (this.startingLeafIndex + this.qtyLeaves); index ++) {
+ final ParaLeaf leaf = words.paraLeafAt(index);
builder.append(leaf.getText());
}
return builder.toString();
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-01-03 15:03:22 UTC (rev 12325)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2022-01-03 16:31:03 UTC (rev 12326)
@@ -28,7 +28,6 @@
package org.foray.orthography;
-import org.axsl.common.para.ParaLeaf;
import org.axsl.orthography.Word;
import org.axsl.orthography.WordSegment;
@@ -116,9 +115,9 @@
}
@Override
- public ParaLeaf paraLeafAt(final int index) {
- // TODO Auto-generated method stub
- return null;
+ public StringWordSegment paraLeafAt(final int index) {
+ final int dictionaryIndex = this.segments[index];
+ return this.dictionary.getWordSegment(dictionaryIndex);
}
@Override
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-01-03 15:03:22 UTC (rev 12325)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-01-03 16:31:03 UTC (rev 12326)
@@ -83,7 +83,7 @@
lastLeafIndex = currentLeafIndex;
}
- throw new UnsupportedOperationException(result.toString());
+ return Status.OK;
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|