com.lowagie.text.pdf

Class ArabicLigaturizer


public class ArabicLigaturizer
extends java.lang.Object

Shape arabic characters. This code was converted from a C version at www.pango.org.
Author:
Paulo Soares (psoares@consiste.pt)

Nested Class Summary

(package private) static class
ArabicLigaturizer.charstruct

Field Summary

private static char
ALEF
private static char
ALEFHAMZA
private static char
ALEFHAMZABELOW
private static char
ALEFMADDA
private static char
ALEFMAKSURA
private static char
DAMMA
static int
DIGITS_AN2EN
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
static int
DIGITS_EN2AN
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
static int
DIGITS_EN2AN_INIT_AL
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
static int
DIGITS_EN2AN_INIT_LR
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
static int
DIGITS_MASK
Bit mask for digit shaping options.
private static int
DIGITS_RESERVED
Not a valid option value.
static int
DIGIT_TYPE_AN
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
static int
DIGIT_TYPE_AN_EXTENDED
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
static int
DIGIT_TYPE_MASK
Bit mask for digit type options.
private static char
FARSIYEH
private static char
FATHA
private static char
HAMZA
private static char
HAMZAABOVE
private static char
HAMZABELOW
private static char
KASRA
private static char
LAM
private static char
LAM_ALEF
private static char
LAM_ALEFHAMZA
private static char
LAM_ALEFHAMZABELOW
private static char
LAM_ALEFMADDA
private static char
MADDA
private static char
SHADDA
private static char
TATWEEL
private static char
WAW
private static char
WAWHAMZA
private static char
YEH
private static char
YEHHAMZA
private static char
ZWJ
static int
ar_composedtashkeel
static int
ar_lig
static int
ar_nothing
static int
ar_novowel
private static char[][]
chartable

Method Summary

(package private) static int
arabic_shape(src[] , int srcoffset, int srclength, dest[] , int destoffset, int destlength, int level)
(package private) static char
charshape(char s, int which)
(package private) static boolean
connects_to_left(ArabicLigaturizer.charstruct a)
(package private) static void
copycstostring(StringBuffer string, ArabicLigaturizer.charstruct s, int level)
(package private) static void
doublelig(StringBuffer string, int level)
(package private) static boolean
isVowel(char s)
(package private) static int
ligature(char newchar, ArabicLigaturizer.charstruct oldchar)
(package private) static void
processNumbers(text[] , int offset, int length, int options)
(package private) static void
shape(text[] , StringBuffer string, int level)
(package private) static void
shapeToArabicDigitsWithContext(char[] dest, int start, int length, char digitBase, boolean lastStrongWasAL)
(package private) static int
shapecount(char s)

Field Details

ALEF

private static final char ALEF
Field Value:
'\u0627'

ALEFHAMZA

private static final char ALEFHAMZA
Field Value:
'\u0623'

ALEFHAMZABELOW

private static final char ALEFHAMZABELOW
Field Value:
'\u0625'

ALEFMADDA

private static final char ALEFMADDA
Field Value:
'\u0622'

ALEFMAKSURA

private static final char ALEFMAKSURA
Field Value:
'\u0649'

DAMMA

private static final char DAMMA
Field Value:
'\u064f'

DIGITS_AN2EN

public static final int DIGITS_AN2EN
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
Field Value:
64

DIGITS_EN2AN

public static final int DIGITS_EN2AN
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
Field Value:
32

DIGITS_EN2AN_INIT_AL

public static final int DIGITS_EN2AN_INIT_AL
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be an Arabic, letter, so European digits at the start of the text will change. Compare to DIGITS_ALEN2AN_INT_LR.
Field Value:
128

DIGITS_EN2AN_INIT_LR

public static final int DIGITS_EN2AN_INIT_LR
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be not an Arabic, letter, so European digits at the start of the text will not change. Compare to DIGITS_ALEN2AN_INIT_AL.
Field Value:
96

DIGITS_MASK

public static final int DIGITS_MASK
Bit mask for digit shaping options.
Field Value:
224

DIGITS_RESERVED

private static final int DIGITS_RESERVED
Not a valid option value.
Field Value:
160

DIGIT_TYPE_AN

public static final int DIGIT_TYPE_AN
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
Field Value:
0

DIGIT_TYPE_AN_EXTENDED

public static final int DIGIT_TYPE_AN_EXTENDED
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
Field Value:
256

DIGIT_TYPE_MASK

public static final int DIGIT_TYPE_MASK
Bit mask for digit type options.
Field Value:
256

FARSIYEH

private static final char FARSIYEH
Field Value:
'\u06cc'

FATHA

private static final char FATHA
Field Value:
'\u064e'

HAMZA

private static final char HAMZA
Field Value:
'\u0621'

HAMZAABOVE

private static final char HAMZAABOVE
Field Value:
'\u0654'

HAMZABELOW

private static final char HAMZABELOW
Field Value:
'\u0655'

KASRA

private static final char KASRA
Field Value:
'\u0650'

LAM

private static final char LAM
Field Value:
'\u0644'

LAM_ALEF

private static final char LAM_ALEF
Field Value:
'\ufefb'

LAM_ALEFHAMZA

private static final char LAM_ALEFHAMZA
Field Value:
'\ufef7'

LAM_ALEFHAMZABELOW

private static final char LAM_ALEFHAMZABELOW
Field Value:
'\ufef9'

LAM_ALEFMADDA

private static final char LAM_ALEFMADDA
Field Value:
'\ufef5'

MADDA

private static final char MADDA
Field Value:
'\u0653'

SHADDA

private static final char SHADDA
Field Value:
'\u0651'

TATWEEL

private static final char TATWEEL
Field Value:
'\u0640'

WAW

private static final char WAW
Field Value:
'\u0648'

WAWHAMZA

private static final char WAWHAMZA
Field Value:
'\u0624'

YEH

private static final char YEH
Field Value:
'\u064a'

YEHHAMZA

private static final char YEHHAMZA
Field Value:
'\u0626'

ZWJ

private static final char ZWJ
Field Value:
'\u200d'

ar_composedtashkeel

public static final int ar_composedtashkeel
Field Value:
4

ar_lig

public static final int ar_lig
Field Value:
8

ar_nothing

public static final int ar_nothing
Field Value:
0

ar_novowel

public static final int ar_novowel
Field Value:
1

chartable

private static final char[][] chartable

Method Details

arabic_shape

(package private) static int arabic_shape(src[] ,
                                          int srcoffset,
                                          int srclength,
                                          dest[] ,
                                          int destoffset,
                                          int destlength,
                                          int level)

charshape

(package private) static char charshape(char s,
                                        int which)

connects_to_left

(package private) static boolean connects_to_left(ArabicLigaturizer.charstruct a)

copycstostring

(package private) static void copycstostring(StringBuffer string,
                                             ArabicLigaturizer.charstruct s,
                                             int level)

doublelig

(package private) static void doublelig(StringBuffer string,
                                        int level)

isVowel

(package private) static boolean isVowel(char s)

ligature

(package private) static int ligature(char newchar,
                                      ArabicLigaturizer.charstruct oldchar)

processNumbers

(package private) static void processNumbers(text[] ,
                                             int offset,
                                             int length,
                                             int options)

shape

(package private) static void shape(text[] ,
                                    StringBuffer string,
                                    int level)

shapeToArabicDigitsWithContext

(package private) static void shapeToArabicDigitsWithContext(char[] dest,
                                                             int start,
                                                             int length,
                                                             char digitBase,
                                                             boolean lastStrongWasAL)

shapecount

(package private) static int shapecount(char s)