- All Implemented Interfaces:
public class Kashida extends Object implements Comparable<Kashida>
Represents a means of Kashida justification that is completely independent from the way the underlying text is stored. The process works like so: 1. Call "find" on each String on the line 2. Sort the list populated by find 3. Apply the List in order until the available difference has gone.
Method SummaryModifier and TypeMethodDescription
static StringApply the list of Kashidas to the specified String by inserting Tatweels (U+0640) at appropriate points and returning the modified String.
static booleanSearch the specified text for possible Kashida insertion points and add them to the list.
textpublic final String text
wordStartpublic final int wordStart
wordEndpublic final int wordEnd
wordCountpublic final int wordCount
rulepublic final int rule
indexpublic final int index
pospublic final int pos
minpublic final int min
compareTopublic int compareTo
- Specified by:
findSearch the specified text for possible Kashida insertion points and add them to the list. The index represents the position in display order of the text on the line, 0 for left-most.
- true if any kashida points were found
applypublic static String apply
(String text, int index, float kashidaWidth, float difference, List<Kashida> list)Apply the list of Kashidas to the specified String by inserting Tatweels (U+0640) at appropriate points and returning the modified String.
text- the original text
index- the original index, which must be the same as passed into
find(java.lang.String, int, java.util.List<org.faceless.publisher.output.Kashida>)
kashidaWidth- the width of the U+0640 character in the font used for this text
difference- the amount of space we are trying to fill with kashidas.
ilst- the sorted list of Kashida opportunities, which may not all apply to this text.
- the modified text. The difference can then be adjusted by
kashidaWidth * (text.length()-oldtext.length())