com.lowagie.text.pdf

Class ArabicLigaturizer

public class ArabicLigaturizer extends Object

Shape arabic characters. This code was inspired by an LGPL'ed C library: Pango ( see http://www.pango.com/ ). Note that the code of this is the original work of Paulo Soares. Hence it is perfectly justifiable to distribute it under the MPL.

Author: Paulo Soares (psoares@consiste.pt)

Nested Class Summary
static classArabicLigaturizer.charstruct
Field Summary
static charALEF
static charALEFHAMZA
static charALEFHAMZABELOW
static charALEFMADDA
static charALEFMAKSURA
static intar_composedtashkeel
static intar_lig
static intar_nothing
static intar_novowel
static char[][]chartable
static charDAMMA
static intDIGITS_AN2EN
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
static intDIGITS_EN2AN
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
static intDIGITS_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 intDIGITS_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 intDIGITS_MASK
Bit mask for digit shaping options.
static intDIGITS_RESERVED
Not a valid option value.
static intDIGIT_TYPE_AN
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
static intDIGIT_TYPE_AN_EXTENDED
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
static intDIGIT_TYPE_MASK
Bit mask for digit type options.
static charFARSIYEH
static charFATHA
static charHAMZA
static charHAMZAABOVE
static charHAMZABELOW
static charKASRA
static charLAM
static charLAM_ALEF
static charLAM_ALEFHAMZA
static charLAM_ALEFHAMZABELOW
static charLAM_ALEFMADDA
static charMADDA
static charSHADDA
static charTATWEEL
static charWAW
static charWAWHAMZA
static charYEH
static charYEHHAMZA
static charZWJ
Method Summary
static intarabic_shape(char[] src, int srcoffset, int srclength, char[] dest, int destoffset, int destlength, int level)
static charcharshape(char s, int which)
static booleanconnects_to_left(ArabicLigaturizer.charstruct a)
static voidcopycstostring(StringBuffer string, ArabicLigaturizer.charstruct s, int level)
static voiddoublelig(StringBuffer string, int level)
static booleanisVowel(char s)
static intligature(char newchar, ArabicLigaturizer.charstruct oldchar)
static voidprocessNumbers(char[] text, int offset, int length, int options)
static voidshape(char[] text, StringBuffer string, int level)
static intshapecount(char s)
static voidshapeToArabicDigitsWithContext(char[] dest, int start, int length, char digitBase, boolean lastStrongWasAL)

Field Detail

ALEF

private static final char ALEF

ALEFHAMZA

private static final char ALEFHAMZA

ALEFHAMZABELOW

private static final char ALEFHAMZABELOW

ALEFMADDA

private static final char ALEFMADDA

ALEFMAKSURA

private static final char ALEFMAKSURA

ar_composedtashkeel

public static final int ar_composedtashkeel

ar_lig

public static final int ar_lig

ar_nothing

public static final int ar_nothing

ar_novowel

public static final int ar_novowel

chartable

private static final char[][] chartable

DAMMA

private static final char DAMMA

DIGITS_AN2EN

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

DIGITS_EN2AN

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

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.

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.

DIGITS_MASK

public static final int DIGITS_MASK
Bit mask for digit shaping options.

DIGITS_RESERVED

private static final int DIGITS_RESERVED
Not a valid option value.

DIGIT_TYPE_AN

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

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).

DIGIT_TYPE_MASK

public static final int DIGIT_TYPE_MASK
Bit mask for digit type options.

FARSIYEH

private static final char FARSIYEH

FATHA

private static final char FATHA

HAMZA

private static final char HAMZA

HAMZAABOVE

private static final char HAMZAABOVE

HAMZABELOW

private static final char HAMZABELOW

KASRA

private static final char KASRA

LAM

private static final char LAM

LAM_ALEF

private static final char LAM_ALEF

LAM_ALEFHAMZA

private static final char LAM_ALEFHAMZA

LAM_ALEFHAMZABELOW

private static final char LAM_ALEFHAMZABELOW

LAM_ALEFMADDA

private static final char LAM_ALEFMADDA

MADDA

private static final char MADDA

SHADDA

private static final char SHADDA

TATWEEL

private static final char TATWEEL

WAW

private static final char WAW

WAWHAMZA

private static final char WAWHAMZA

YEH

private static final char YEH

YEHHAMZA

private static final char YEHHAMZA

ZWJ

private static final char ZWJ

Method Detail

arabic_shape

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

charshape

static char charshape(char s, int which)

connects_to_left

static boolean connects_to_left(ArabicLigaturizer.charstruct a)

copycstostring

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

doublelig

static void doublelig(StringBuffer string, int level)

isVowel

static boolean isVowel(char s)

ligature

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

processNumbers

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

shape

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

shapecount

static int shapecount(char s)

shapeToArabicDigitsWithContext

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