]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/ArabicShaping.h
ICU-491.11.1.tar.gz
[apple/icu.git] / icuSources / layout / ArabicShaping.h
CommitLineData
b75a7d8f 1/*
b75a7d8f 2 *
73c04bcf 3 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
b75a7d8f
A
4 *
5 */
6
7#ifndef __ARABICSHAPING_H
8#define __ARABICSHAPING_H
9
10/**
11 * \file
12 * \internal
13 */
14
15#include "LETypes.h"
16#include "OpenTypeTables.h"
17
18U_NAMESPACE_BEGIN
19
374ca955 20class LEGlyphStorage;
b75a7d8f
A
21
22class ArabicShaping /* not : public UObject because all methods are static */ {
23public:
73c04bcf
A
24 // Joining types
25 enum JoiningTypes
26 {
27 JT_NON_JOINING = 0,
28 JT_JOIN_CAUSING = 1,
29 JT_DUAL_JOINING = 2,
30 JT_LEFT_JOINING = 3,
31 JT_RIGHT_JOINING = 4,
32 JT_TRANSPARENT = 5,
33 JT_COUNT = 6
34 };
35
b75a7d8f
A
36 // shaping bit masks
37 enum ShapingBitMasks
38 {
39 MASK_SHAPE_RIGHT = 1, // if this bit set, shapes to right
40 MASK_SHAPE_LEFT = 2, // if this bit set, shapes to left
41 MASK_TRANSPARENT = 4, // if this bit set, is transparent (ignore other bits)
42 MASK_NOSHAPE = 8 // if this bit set, don't shape this char, i.e. tatweel
43 };
44
45 // shaping values
46 enum ShapeTypeValues
47 {
48 ST_NONE = 0,
49 ST_RIGHT = MASK_SHAPE_RIGHT,
50 ST_LEFT = MASK_SHAPE_LEFT,
51 ST_DUAL = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,
52 ST_TRANSPARENT = MASK_TRANSPARENT,
53 ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,
54 ST_NOSHAPE_NONE = MASK_NOSHAPE
55 };
56
57 typedef le_int32 ShapeType;
58
59 static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
374ca955 60 le_bool rightToLeft, LEGlyphStorage &glyphStorage);
b75a7d8f 61
73c04bcf 62 static const FeatureMap *getFeatureMap(le_int32 &count);
b75a7d8f 63
b75a7d8f
A
64private:
65 // forbid instantiation
66 ArabicShaping();
67
374ca955 68 static ShapeType getShapeType(LEUnicode c);
b75a7d8f 69
73c04bcf 70 static const le_uint8 shapingTypeTable[];
374ca955 71 static const ShapeType shapeTypes[];
b75a7d8f 72
374ca955 73 static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage);
b75a7d8f
A
74};
75
76U_NAMESPACE_END
77#endif