1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru******************************************************************************
3b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius*   Copyright (C) 2000-2012, International Business Machines
5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   Corporation and others.  All Rights Reserved.
6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru******************************************************************************
8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   file name:  ushape.h
9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   encoding:   US-ASCII
10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   tab size:   8 (not used)
11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   indentation:4
12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   created on: 2000jun29
14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   created by: Markus W. Scherer
15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/
16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef __USHAPE_H__
18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define __USHAPE_H__
19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/utypes.h"
21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \file
24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \brief C API:  Arabic shaping
25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Shape Arabic text on a character basis.
30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
31b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>This function performs basic operations for "shaping" Arabic text. It is most
32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * useful for use with legacy data formats and legacy display technology
33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (simple terminals). All operations are performed on Unicode characters.</p>
34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>Text-based shaping means that some character code points in the text are
36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * replaced by others depending on the context. It transforms one kind of text
37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * into another. In comparison, modern displays for Arabic text select
38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * appropriate, context-dependent font glyphs for each text element, which means
39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * that they transform text into a glyph vector.</p>
40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>Text transformations are necessary when modern display technology is not
42b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * available or when text needs to be transformed to or from legacy formats that
43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * use "shaped" characters. Since the Arabic script is cursive, connecting
44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * adjacent letters to each other, computers select images for each letter based
45b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * on the surrounding letters. This usually results in four images per Arabic
46b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * letter: initial, middle, final, and isolated forms. In Unicode, on the other
47b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * hand, letters are normally stored abstract, and a display system is expected
48b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to select the necessary glyphs. (This makes searching and other text
49b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * processing easier because the same letter has only one code.) It is possible
50b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to mimic this with text transformations because there are characters in
51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Unicode that are rendered as letters with a specific shape
52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (or cursive connectivity). They were included for interoperability with
53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * legacy systems and codepages, and for unsophisticated display systems.</p>
54b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>A second kind of text transformations is supported for Arabic digits:
56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For compatibility with legacy codepages that only include European digits,
57b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it is possible to replace one set of digits by another, changing the
58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * character code points. These operations can be performed for either
59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic
60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * digits (U+06f0...U+06f9).</p>
61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>Some replacements may result in more or fewer characters (code points).
63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * By default, this means that the destination buffer may receive text with a
64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length different from the source length. Some legacy systems rely on the
65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length of the text to be constant. They expect extra spaces to be added
66b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or consumed either next to the affected character or at the end of the
67b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * text.</p>
68b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
69b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p>For details about the available operations, see the description of the
70b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <code>U_SHAPE_...</code> options.</p>
71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source The input text.
73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
74b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param sourceLength The number of UChars in <code>source</code>.
75b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
76b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dest The destination buffer that will receive the results of the
77b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *             requested operations. It may be <code>NULL</code> only if
78b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *             <code>destSize</code> is 0. The source and destination must not
79b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *             overlap.
80b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param destSize The size (capacity) of the destination buffer in UChars.
82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                 If <code>destSize</code> is 0, then no output is produced,
83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                 but the necessary buffer size is returned ("preflighting").
84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
85b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param options This is a 32-bit set of flags that specify the operations
86b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                that are performed on the input text. If no error occurs,
87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                then the result will always be written to the destination
88b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                buffer.
89b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pErrorCode must be a valid pointer to an error code value,
91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *        which must not indicate a failure before the function call.
92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The number of UChars written to the destination buffer.
94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         If an error occured, then no output was written, or it may be
95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         incomplete. If <code>U_BUFFER_OVERFLOW_ERROR</code> is set, then
96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         the return value indicates the necessary destination buffer size.
97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2
100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruu_shapeArabic(const UChar *source, int32_t sourceLength,
101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru              UChar *dest, int32_t destSize,
10259d709d503bab6e2b61931737e662dd293b40578ccornelius              uint32_t options,
103e0266fb954621c778591bb84cd46ebe4379538d0Doug Felt              UErrorCode *pErrorCode);
104e0266fb954621c778591bb84cd46ebe4379538d0Doug Felt
105e0266fb954621c778591bb84cd46ebe4379538d0Doug Felt/**
106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Memory option: allow the result to have a different length than the source.
107b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LENGTH_GROW_SHRINK              0
111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
113b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: allow the result to have a different length than the source.
114b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
115b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option is an alias to U_SHAPE_LENGTH_GROW_SHRINK
11627f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
117b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
118b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_RESIZE                  0
119b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
120b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Memory option: the result must have the same length as the source.
122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If more room is necessary, then try to consume spaces next to modified characters.
123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LENGTH_FIXED_SPACES_NEAR        1
126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Memory option: the result must have the same length as the source.
129b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If more room is necessary, then try to consume spaces next to modified characters.
130b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
131b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_NEAR
13227f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
133b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
134b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_NEAR                    1
135b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
136b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
137b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If more room is necessary, then try to consume spaces at the end of the text.
139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LENGTH_FIXED_SPACES_AT_END      2
142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Memory option: the result must have the same length as the source.
145b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If more room is necessary, then try to consume spaces at the end of the text.
146b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
147b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_END
14827f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
149b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
150b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_END                     2
151b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
152b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
153b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If more room is necessary, then try to consume spaces at the beginning of the text.
155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING 3
158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
159b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
160b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
161b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If more room is necessary, then try to consume spaces at the beginning of the text.
162b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
163b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING
16427f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
165b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
166b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_BEGIN                    3
167b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
168b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
169b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
170b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
171b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping Mode: For each LAMALEF character found, expand LAMALEF using space at end.
172b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               If there is no space at end, use spaces at beginning of the buffer. If there
173b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               is no space at beginning of the buffer, use spaces at the near (i.e. the space
174b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               after the LAMALEF character).
175b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h)
176b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               will be set in pErrorCode
177b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
178b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Deshaping Mode: Perform the same function as the flag equals U_SHAPE_LAMALEF_END.
179b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: LamAlef options
18027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
181b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
182b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_AUTO                     0x10000
183b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for memory options. @stable ICU 2.0 */
185b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LENGTH_MASK                      0x10003 /* Changed old value 3 */
186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
18850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
18950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for LamAlef memory options.
19027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
19150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
192b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LAMALEF_MASK                     0x10003 /* updated */
193b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Direction indicator: the source is in logical (keyboard) order. @stable ICU 2.0 */
195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_TEXT_DIRECTION_LOGICAL          0
196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Direction indicator:
199b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * the source is in visual RTL order,
200b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * the rightmost displayed character stored first.
201b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL
20227f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
203b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
204b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TEXT_DIRECTION_VISUAL_RTL       0
205b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
206b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
207b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Direction indicator:
208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the source is in visual LTR order,
209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the leftmost displayed character stored first.
210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_TEXT_DIRECTION_VISUAL_LTR       4
213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for direction indicators. @stable ICU 2.0 */
215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_TEXT_DIRECTION_MASK             4
216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Letter shaping option: do not perform letter shaping. @stable ICU 2.0 */
219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LETTERS_NOOP                    0
220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Letter shaping option: replace abstract letter characters by "shaped" ones. @stable ICU 2.0 */
222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LETTERS_SHAPE                   8
223b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
224b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Letter shaping option: replace "shaped" letter characters by abstract ones. @stable ICU 2.0 */
225b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LETTERS_UNSHAPE                 0x10
226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Letter shaping option: replace abstract letter characters by "shaped" ones.
229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The only difference with U_SHAPE_LETTERS_SHAPE is that Tashkeel letters
230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * are always "shaped" into the isolated form instead of the medial form
231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (selecting code points from the Arabic Presentation Forms-B block).
232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED 0x18
235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
236b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for letter shaping options. @stable ICU 2.0 */
238b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_LETTERS_MASK                        0x18
239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Digit shaping option: do not perform digit shaping. @stable ICU 2.0 */
242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_NOOP                     0
243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Digit shaping option:
246b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replace European digits (U+0030...) by Arabic-Indic digits.
247b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
248b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
249b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_EN2AN                    0x20
250b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
251b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
252b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Digit shaping option:
253b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replace Arabic-Indic digits by European digits (U+0030...).
254b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
255b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
256b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_AN2EN                    0x40
257b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
258b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
259b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Digit shaping option:
260b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replace European digits (U+0030...) by Arabic-Indic digits if the most recent
261b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * strongly directional character is an Arabic letter
262b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (<code>u_charDirection()</code> result <code>U_RIGHT_TO_LEFT_ARABIC</code> [AL]).<br>
263b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The direction of "preceding" depends on the direction indicator option.
264b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For the first characters, the preceding strongly directional character
265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (initial state) is assumed to be not an Arabic letter
266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (it is <code>U_LEFT_TO_RIGHT</code> [L] or <code>U_RIGHT_TO_LEFT</code> [R]).
267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_ALEN2AN_INIT_LR          0x60
270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Digit shaping option:
273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replace European digits (U+0030...) by Arabic-Indic digits if the most recent
274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * strongly directional character is an Arabic letter
275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (<code>u_charDirection()</code> result <code>U_RIGHT_TO_LEFT_ARABIC</code> [AL]).<br>
276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The direction of "preceding" depends on the direction indicator option.
277b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For the first characters, the preceding strongly directional character
278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * (initial state) is assumed to be an Arabic letter.
279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_ALEN2AN_INIT_AL          0x80
282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Not a valid option value. May be replaced by a new option. @stable ICU 2.0 */
284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_RESERVED                 0xa0
285b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
286b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for digit shaping options. @stable ICU 2.0 */
287b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGITS_MASK                     0xe0
288b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
289b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
290b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Digit type option: Use Arabic-Indic digits (U+0660...U+0669). @stable ICU 2.0 */
291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGIT_TYPE_AN                   0
292b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9). @stable ICU 2.0 */
294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGIT_TYPE_AN_EXTENDED          0x100
295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Not a valid option value. May be replaced by a new option. @stable ICU 2.0 */
297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_DIGIT_TYPE_RESERVED             0x200
298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for digit type options. @stable ICU 2.0 */
300b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_DIGIT_TYPE_MASK                 0x300 /* I need to change this from 0x3f00 to 0x300 */
301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
302b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
303b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Tashkeel aggregation option:
304b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replaces any combination of U+0651 with one of
305b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U+064C, U+064D, U+064E, U+064F, U+0650 with
306b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U+FC5E, U+FC5F, U+FC60, U+FC61, U+FC62 consecutively.
307b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
308b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
309b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_AGGREGATE_TASHKEEL              0x4000
310b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Tashkeel aggregation option: do not aggregate tashkeels. @stable ICU 3.6 */
311b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_AGGREGATE_TASHKEEL_NOOP         0
312b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for tashkeel aggregation. @stable ICU 3.6 */
313b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_AGGREGATE_TASHKEEL_MASK         0x4000
314b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
315b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
316b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Presentation form option:
317b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Don't replace Arabic Presentation Forms-A and Arabic Presentation Forms-B
318b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * characters with 0+06xx characters, before shaping.
319b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
320b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
321b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_PRESERVE_PRESENTATION           0x8000
322b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Presentation form option:
323b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Replace Arabic Presentation Forms-A and Arabic Presentationo Forms-B with
324b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * their unshaped correspondants in range 0+06xx, before shaping.
325b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
326b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
327b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_PRESERVE_PRESENTATION_NOOP      0
328b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** Bit mask for preserve presentation form. @stable ICU 3.6 */
329b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define U_SHAPE_PRESERVE_PRESENTATION_MASK      0x8000
330b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
331b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/* Seen Tail option */
332b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
333b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
334b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: The SEEN family character will expand into two characters using space near
335b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               the SEEN family character(i.e. the space after the character).
336b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h)
337b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               will be set in pErrorCode
338b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
339b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: Any Seen character followed by Tail character will be
340b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *                  replaced by one cell Seen and a space will replace the Tail.
341b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: Seen options
34227f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
343b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
344b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_SEEN_TWOCELL_NEAR     0x200000
345b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
34650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
34750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for Seen memory options.
34827f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
34950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
350b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_SEEN_MASK             0x700000
351b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
352b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/* YehHamza option */
353b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
354b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
355b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: The YEHHAMZA character will expand into two characters using space near it
356b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *              (i.e. the space after the character
357b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h)
358b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               will be set in pErrorCode
359b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
360b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: Any Yeh (final or isolated) character followed by Hamza character will be
361b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *                  replaced by one cell YehHamza and space will replace the Hamza.
362b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: YehHamza options
36327f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
364b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
365b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_YEHHAMZA_TWOCELL_NEAR      0x1000000
366b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
367b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
36850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
36950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for YehHamza memory options.
37027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
37150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
372b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_YEHHAMZA_MASK              0x3800000
373b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
374b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/* New Tashkeel options */
375b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
376b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
377b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: Tashkeel characters will be replaced by spaces.
378b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               Spaces will be placed at beginning of the buffer
379b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
380b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: N/A
381b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: Tashkeel options
38227f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
383b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
384b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TASHKEEL_BEGIN                      0x40000
385b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
386b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
387b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
388b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: Tashkeel characters will be replaced by spaces.
389b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               Spaces will be placed at end of the buffer
390b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
391b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: N/A
392b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: Tashkeel options
39327f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
394b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
395b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TASHKEEL_END                        0x60000
396b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
397b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
398b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: allow the result to have a different length than the source.
399b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: Tashkeel characters will be removed, buffer length will shrink.
400b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: N/A
401b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
402b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affect: Tashkeel options
40327f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
404b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
405b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TASHKEEL_RESIZE                     0x80000
406b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
407b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
408b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Memory option: the result must have the same length as the source.
409b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping mode: Tashkeel characters will be replaced by Tatweel if it is connected to adjacent
410b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *               characters (i.e. shaped on Tatweel) or replaced by space if it is not connected.
411b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
412b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping mode: N/A
413b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: YehHamza options
41427f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
415b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
416b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL         0xC0000
417b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
41850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
41950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for Tashkeel replacement with Space or Tatweel memory options.
42027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
42150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
422b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_TASHKEEL_MASK                       0xE0000
423b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
424b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
425b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/* Space location Control options */
426b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
427b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This option affect the meaning of BEGIN and END options. if this option is not used the default
428b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * for BEGIN and END will be as following:
429b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * The Default (for both Visual LTR, Visual RTL and Logical Text)
430b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *           1. BEGIN always refers to the start address of physical memory.
431b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *           2. END always refers to the end address of physical memory.
432b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
433b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If this option is used it will swap the meaning of BEGIN and END only for Visual LTR text.
434b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
435b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * The effect on BEGIN and END Memory Options will be as following:
436b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *    A. BEGIN For Visual LTR text: This will be the beginning (right side) of the visual text(
437b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *       corresponding to the physical memory address end for Visual LTR text, Same as END in
438b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *       default behavior)
439b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *    B. BEGIN For Logical text: Same as BEGIN in default behavior.
440b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *    C. END For Visual LTR text: This will be the end (left side) of the visual text (corresponding
441b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *       to the physical memory address beginning for Visual LTR text, Same as BEGIN in default behavior.
442b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *    D. END For Logical text: Same as END in default behavior).
443b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: All LamAlef BEGIN, END and AUTO options.
44427f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
445b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
446b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_SPACES_RELATIVE_TO_TEXT_BEGIN_END 0x4000000
447b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
44850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
44950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for swapping BEGIN and END for Visual LTR text
45027f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.2
45150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
452b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru#define U_SHAPE_SPACES_RELATIVE_TO_TEXT_MASK      0x4000000
453b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
454b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru/**
455b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If this option is used, shaping will use the new Unicode code point for TAIL (i.e. 0xFE73).
456b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * If this option is not specified (Default), old unofficial Unicode TAIL code point is used (i.e. 0x200B)
457b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping will not use this option as it will always search for both the new Unicode code point for the
458b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0x200B) and de-shape the
459b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Seen-Family letter accordingly.
460b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru *
461b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Shaping Mode: Only shaping.
462b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * De-shaping Mode: N/A.
463b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Affects: All Seen options
464103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8
465b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */
466b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho#define U_SHAPE_TAIL_NEW_UNICODE        0x8000000
467b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
46850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
46950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * Bit mask for new Unicode Tail option
470103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8
47150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
472b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho#define U_SHAPE_TAIL_TYPE_MASK          0x8000000
473b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
474b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
475