public final class ArabicTextHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.text.AttributedCharacterIterator.Attribute |
ARABIC_FORM |
private static java.lang.Integer |
ARABIC_INITIAL |
private static java.lang.Integer |
ARABIC_ISOLATED |
private static java.lang.Integer |
ARABIC_MEDIAL |
private static java.lang.Integer |
ARABIC_NONE |
private static java.lang.Integer |
ARABIC_TERMINAL |
private static int |
arabicEnd |
private static int |
arabicStart |
(package private) static int |
doubleCharFirst |
(package private) static int |
doubleCharLast |
(package private) static int[][][] |
doubleCharRemappings |
(package private) static int |
singleCharFirst |
(package private) static int |
singleCharLast |
(package private) static int[][] |
singleCharRemappings |
Modifier | Constructor and Description |
---|---|
private |
ArabicTextHandler()
private ctor prevents unnecessary instantiation of this class.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
arabicChar(char c)
Returns true if the char is a standard arabic char.
|
private static boolean |
arabicCharShaped(char c)
Returns true if character is shaped.
|
private static boolean |
arabicCharShapesDuel(char c)
Returns true if character has duel shaping.
|
private static boolean |
arabicCharShapesLeft(char c)
Returns true if character shapes to the left.
|
private static boolean |
arabicCharShapesRight(char c)
Returns true if the character shapes to the right.
|
static boolean |
arabicCharTransparent(char c)
Returns true if the char is transparent.
|
static java.text.AttributedString |
assignArabicForms(java.text.AttributedString as)
If the AttributedString contains any arabic chars, assigns an
arabic form attribute, i.e. initial|medial|terminal|isolated,
to each arabic char.
|
static boolean |
charStartsLigature(char c)
Returns true if a ligature exists that starts with the
specified character.
|
static boolean |
containsArabic(java.text.AttributedCharacterIterator aci)
Returns true if the ACI contains any arabic characters.
|
static boolean |
containsArabic(java.text.AttributedString as)
Returns true if the string contains any arabic characters.
|
static java.lang.String |
createSubstituteString(java.text.AttributedCharacterIterator aci)
Where possible substitues plain arabic glyphs with their shaped
forms.
|
static int |
getNumChars(char c)
Returns the number of characters the glyph for the specified
character represents.
|
static int |
getSubstituteChar(char ch1,
char ch2,
int form)
Will try and find a substitute character of the specified form.
|
static int |
getSubstituteChar(char ch,
int form) |
static boolean |
hasSubstitute(char ch1,
char ch2) |
static boolean |
isLigature(char c)
Returns true if the glyph for the specified character
respresents a ligature.
|
private static final int arabicStart
private static final int arabicEnd
private static final java.text.AttributedCharacterIterator.Attribute ARABIC_FORM
private static final java.lang.Integer ARABIC_NONE
private static final java.lang.Integer ARABIC_ISOLATED
private static final java.lang.Integer ARABIC_TERMINAL
private static final java.lang.Integer ARABIC_INITIAL
private static final java.lang.Integer ARABIC_MEDIAL
static int singleCharFirst
static int singleCharLast
static int[][] singleCharRemappings
static int doubleCharFirst
static int doubleCharLast
static int[][][] doubleCharRemappings
private ArabicTextHandler()
public static java.text.AttributedString assignArabicForms(java.text.AttributedString as)
as
- The string to attach the arabic form attributes to.public static boolean arabicChar(char c)
c
- The character to test.public static boolean containsArabic(java.text.AttributedString as)
as
- The string to test.public static boolean containsArabic(java.text.AttributedCharacterIterator aci)
aci
- The AttributedCharacterIterator to test.public static boolean arabicCharTransparent(char c)
c
- The character to test.private static boolean arabicCharShapesRight(char c)
c
- The character to test.private static boolean arabicCharShapesDuel(char c)
c
- The character to test.private static boolean arabicCharShapesLeft(char c)
c
- The character to test.private static boolean arabicCharShaped(char c)
c
- The character to test.public static boolean hasSubstitute(char ch1, char ch2)
public static int getSubstituteChar(char ch1, char ch2, int form)
ch1
- The first character of two to replace.ch2
- The second character of two to replace.form
- Indicates the required arabic form.
(isolated = 1, final = 2, initial = 3, medial = 4)public static int getSubstituteChar(char ch, int form)
public static java.lang.String createSubstituteString(java.text.AttributedCharacterIterator aci)
aci
- Contains the text to process. Arabic form attributes
should already be assigned to each arabic character.public static boolean charStartsLigature(char c)
c
- The character to test.public static int getNumChars(char c)
c
- The character to test.public static boolean isLigature(char c)
c
- The character to test.