]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/ushape.h
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / common / unicode / ushape.h
index f165e140310439d7ae1110815c4f2da2829a7f65..6c3655f7a1a62245347717052b2b878a30f42ae3 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2000-2007, International Business Machines
+*   Copyright (C) 2000-2010, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -104,10 +104,19 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
 
 /**
  * Memory option: allow the result to have a different length than the source.
+ * Affects: LamAlef options
  * @stable ICU 2.0
  */
 #define U_SHAPE_LENGTH_GROW_SHRINK              0
 
+/**
+ * Memory option: allow the result to have a different length than the source.
+ * Affects: LamAlef options
+ * This option is an alias to U_SHAPE_LENGTH_GROW_SHRINK
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_RESIZE                  0 
+
 /**
  * Memory option: the result must have the same length as the source.
  * If more room is necessary, then try to consume spaces next to modified characters.
@@ -115,6 +124,15 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
  */
 #define U_SHAPE_LENGTH_FIXED_SPACES_NEAR        1
 
+/**
+ * Memory option: the result must have the same length as the source.
+ * If more room is necessary, then try to consume spaces next to modified characters.
+ * Affects: LamAlef options
+ * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_NEAR
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_NEAR                    1 
+
 /**
  * Memory option: the result must have the same length as the source.
  * If more room is necessary, then try to consume spaces at the end of the text.
@@ -122,6 +140,15 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
  */
 #define U_SHAPE_LENGTH_FIXED_SPACES_AT_END      2
 
+/**
+ * Memory option: the result must have the same length as the source.
+ * If more room is necessary, then try to consume spaces at the end of the text.
+ * Affects: LamAlef options
+ * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_END
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_END                     2 
+
 /**
  * Memory option: the result must have the same length as the source.
  * If more room is necessary, then try to consume spaces at the beginning of the text.
@@ -129,13 +156,53 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
  */
 #define U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING 3
 
+/**
+ * Memory option: the result must have the same length as the source.
+ * If more room is necessary, then try to consume spaces at the beginning of the text.
+ * Affects: LamAlef options
+ * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_BEGIN                    3 
+
+
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping Mode: For each LAMALEF character found, expand LAMALEF using space at end.
+ *               If there is no space at end, use spaces at beginning of the buffer. If there
+ *               is no space at beginning of the buffer, use spaces at the near (i.e. the space
+ *               after the LAMALEF character).
+ *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h) 
+ *               will be set in pErrorCode
+ *
+ * Deshaping Mode: Perform the same function as the flag equals U_SHAPE_LAMALEF_END. 
+ * Affects: LamAlef options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_AUTO                     0x10000 
+
 /** Bit mask for memory options. @stable ICU 2.0 */
-#define U_SHAPE_LENGTH_MASK                     3
+#define U_SHAPE_LENGTH_MASK                      0x10003 /* Changed old value 3 */
+
 
+/**
+ * Bit mask for LamAlef memory options.
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_LAMALEF_MASK                     0x10003 /* updated */
 
 /** Direction indicator: the source is in logical (keyboard) order. @stable ICU 2.0 */
 #define U_SHAPE_TEXT_DIRECTION_LOGICAL          0
 
+/**
+ * Direction indicator:
+ * the source is in visual RTL order,
+ * the rightmost displayed character stored first.
+ * This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TEXT_DIRECTION_VISUAL_RTL       0
+
 /**
  * Direction indicator:
  * the source is in visual LTR order,
@@ -166,8 +233,9 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
  */
 #define U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED 0x18
 
+
 /** Bit mask for letter shaping options. @stable ICU 2.0 */
-#define U_SHAPE_LETTERS_MASK                    0x18
+#define U_SHAPE_LETTERS_MASK                        0x18
 
 
 /** Digit shaping option: do not perform digit shaping. @stable ICU 2.0 */
@@ -229,7 +297,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
 #define U_SHAPE_DIGIT_TYPE_RESERVED             0x200
 
 /** Bit mask for digit type options. @stable ICU 2.0 */
-#define U_SHAPE_DIGIT_TYPE_MASK                 0x3f00
+#define U_SHAPE_DIGIT_TYPE_MASK                 0x300 /* I need to change this from 0x3f00 to 0x300 */
 
 /** 
  * Tashkeel aggregation option:
@@ -260,4 +328,147 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
 /** Bit mask for preserve presentation form. @stable ICU 3.6 */
 #define U_SHAPE_PRESERVE_PRESENTATION_MASK      0x8000
 
+/* Seen Tail option */ 
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping mode: The SEEN family character will expand into two characters using space near 
+ *               the SEEN family character(i.e. the space after the character).
+ *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h) 
+ *               will be set in pErrorCode
+ *
+ * De-shaping mode: Any Seen character followed by Tail character will be
+ *                  replaced by one cell Seen and a space will replace the Tail.
+ * Affects: Seen options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_SEEN_TWOCELL_NEAR     0x200000
+
+/**
+ * Bit mask for Seen memory options. 
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_SEEN_MASK             0x700000
+
+/* YehHamza option */ 
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping mode: The YEHHAMZA character will expand into two characters using space near it 
+ *              (i.e. the space after the character
+ *               If there are no spaces found, an error U_NO_SPACE_AVAILABLE (as defined in utypes.h) 
+ *               will be set in pErrorCode
+ *
+ * De-shaping mode: Any Yeh (final or isolated) character followed by Hamza character will be
+ *                  replaced by one cell YehHamza and space will replace the Hamza.
+ * Affects: YehHamza options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_YEHHAMZA_TWOCELL_NEAR      0x1000000
+
+
+/**
+ * Bit mask for YehHamza memory options. 
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_YEHHAMZA_MASK              0x3800000
+
+/* New Tashkeel options */ 
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping mode: Tashkeel characters will be replaced by spaces. 
+ *               Spaces will be placed at beginning of the buffer
+ *
+ * De-shaping mode: N/A
+ * Affects: Tashkeel options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TASHKEEL_BEGIN                      0x40000
+
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping mode: Tashkeel characters will be replaced by spaces. 
+ *               Spaces will be placed at end of the buffer
+ *
+ * De-shaping mode: N/A
+ * Affects: Tashkeel options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TASHKEEL_END                        0x60000
+
+/**
+ * Memory option: allow the result to have a different length than the source.
+ * Shaping mode: Tashkeel characters will be removed, buffer length will shrink. 
+ * De-shaping mode: N/A 
+ *
+ * Affect: Tashkeel options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TASHKEEL_RESIZE                     0x80000
+
+/**
+ * Memory option: the result must have the same length as the source.
+ * Shaping mode: Tashkeel characters will be replaced by Tatweel if it is connected to adjacent
+ *               characters (i.e. shaped on Tatweel) or replaced by space if it is not connected.
+ *
+ * De-shaping mode: N/A
+ * Affects: YehHamza options
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL         0xC0000
+
+/** 
+ * Bit mask for Tashkeel replacement with Space or Tatweel memory options. 
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_TASHKEEL_MASK                       0xE0000
+
+
+/* Space location Control options */ 
+/**
+ * This option affect the meaning of BEGIN and END options. if this option is not used the default
+ * for BEGIN and END will be as following: 
+ * The Default (for both Visual LTR, Visual RTL and Logical Text)
+ *           1. BEGIN always refers to the start address of physical memory.
+ *           2. END always refers to the end address of physical memory.
+ *
+ * If this option is used it will swap the meaning of BEGIN and END only for Visual LTR text. 
+ *
+ * The effect on BEGIN and END Memory Options will be as following:
+ *    A. BEGIN For Visual LTR text: This will be the beginning (right side) of the visual text(
+ *       corresponding to the physical memory address end for Visual LTR text, Same as END in 
+ *       default behavior)
+ *    B. BEGIN For Logical text: Same as BEGIN in default behavior. 
+ *    C. END For Visual LTR text: This will be the end (left side) of the visual text (corresponding
+ *       to the physical memory address beginning for Visual LTR text, Same as BEGIN in default behavior.
+ *    D. END For Logical text: Same as END in default behavior). 
+ * Affects: All LamAlef BEGIN, END and AUTO options.
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_SPACES_RELATIVE_TO_TEXT_BEGIN_END 0x4000000
+
+/**
+ * Bit mask for swapping BEGIN and END for Visual LTR text 
+ * @stable ICU 4.2
+ */
+#define U_SHAPE_SPACES_RELATIVE_TO_TEXT_MASK      0x4000000
+
+/**
+ * If this option is used, shaping will use the new Unicode code point for TAIL (i.e. 0xFE73). 
+ * If this option is not specified (Default), old unofficial Unicode TAIL code point is used (i.e. 0x200B)
+ * De-shaping will not use this option as it will always search for both the new Unicode code point for the 
+ * TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0x200B) and de-shape the
+ * Seen-Family letter accordingly.
+ *
+ * Shaping Mode: Only shaping.
+ * De-shaping Mode: N/A.
+ * Affects: All Seen options
+ * @draft ICU 4.2
+ */
+#define SHAPE_TAIL_NEW_UNICODE        0x8000000
+
+/**
+ * Bit mask for new Unicode Tail option 
+ * @draft ICU 4.2
+ */
+#define SHAPE_TAIL_TYPE_MASK          0x8000000
+
 #endif