ICU-4336 Use shaping types generated from Unicode data.

X-SVN-Rev: 18319
This commit is contained in:
Eric Mader 2005-07-21 18:30:10 +00:00
parent 789d366b99
commit 7e826f29cb
5 changed files with 119 additions and 39 deletions

View File

@ -1,6 +1,6 @@
/*
*
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
*
*/
@ -8,35 +8,20 @@
#include "OpenTypeTables.h"
#include "ArabicShaping.h"
#include "LEGlyphStorage.h"
#include "ClassDefinitionTables.h"
U_NAMESPACE_BEGIN
enum {
_c_ = ArabicShaping::ST_NOSHAPE_DUAL,
_d_ = ArabicShaping::ST_DUAL,
_n_ = ArabicShaping::ST_NONE,
_r_ = ArabicShaping::ST_RIGHT,
_t_ = ArabicShaping::ST_TRANSPARENT,
_x_ = ArabicShaping::ST_NOSHAPE_NONE
};
// This table maps Unicode joining types to
// ShapeTypes.
const ArabicShaping::ShapeType ArabicShaping::shapeTypes[] =
{
_t_, _t_, _t_, _t_, _t_, _t_, _x_, _x_, _x_, _x_, _x_, _n_, _x_, _x_, _x_, _n_, // 0x610 - 0x61f
_x_, _n_, _r_, _r_, _r_, _r_, _d_, _r_, _d_, _r_, _d_, _d_, _d_, _d_, _d_, _r_, // 0x620 - 0x62f
_r_, _r_, _r_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _x_, _x_, _x_, _x_, _x_, // 0x630 - 0x63f
_c_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _r_, _d_, _d_, _t_, _t_, _t_, _t_, _t_, // 0x640 - 0x64f
_t_, _t_, _t_, _t_, _t_, _t_, _t_, _t_, _t_, _x_, _x_, _x_, _x_, _x_, _x_, _x_, // 0x650 - 0x65f
_n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _d_, _d_, // 0x660 - 0x66f
_t_, _r_, _r_, _r_, _n_, _r_, _r_, _r_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x670 - 0x67f
_d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, // 0x680 - 0x68f
_r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x690 - 0x69f
_d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x6a0 - 0x6af
_d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, _d_, // 0x6b0 - 0x6bf
_r_, _d_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _r_, _d_, _r_, _d_, _r_, // 0x6c0 - 0x6cf
_d_, _d_, _r_, _r_, _n_, _r_, _t_, _t_, _t_, _t_, _t_, _t_, _t_, _x_, _t_, _t_, // 0x6d0 - 0x6df
_t_, _t_, _t_, _t_, _t_, _n_, _n_, _t_, _t_, _n_, _t_, _t_, _t_, _t_, _r_, _r_, // 0x6e0 - 0x6ef
_n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _n_, _d_, _d_, _d_, _n_, _n_, _d_ // 0x6f0 - 0x6ff
ArabicShaping::ST_NOSHAPE_NONE, // [U]
ArabicShaping::ST_NOSHAPE_DUAL, // [C]
ArabicShaping::ST_DUAL, // [D]
ArabicShaping::ST_LEFT, // [L]
ArabicShaping::ST_RIGHT, // [R]
ArabicShaping::ST_TRANSPARENT // [T]
};
/*
@ -48,21 +33,14 @@ const ArabicShaping::ShapeType ArabicShaping::shapeTypes[] =
*/
ArabicShaping::ShapeType ArabicShaping::getShapeType(LEUnicode c)
{
if (c >= 0x0610 && c <= 0x206f) {
if (c < 0x0700) {
return shapeTypes[c - 0x0610];
} else if (c == 0x200c) { // ZWNJ
return ST_NOSHAPE_NONE;
} else if (c == 0x200d) { // ZWJ
return ST_NOSHAPE_DUAL;
} else if (c >= 0x202a && c <= 0x202e) { // LRE - RLO
return ST_TRANSPARENT;
} else if (c >= 0x206a && c <= 0x206f) { // Inhibit Symmetric Swapping - Nominal Digit Shapes
return ST_TRANSPARENT;
}
const ClassDefinitionTable *joiningTypes = (const ClassDefinitionTable *) ArabicShaping::shapingTypeTable;
le_int32 joiningType = joiningTypes->getGlyphClass(c);
if (joiningType >= 0 && joiningType < ArabicShaping::JT_COUNT) {
return ArabicShaping::shapeTypes[joiningType];
}
return ST_NOSHAPE_NONE;
return ArabicShaping::ST_NOSHAPE_NONE;
}
static const LETag isolFeatureTag = LE_ISOL_FEATURE_TAG;

View File

@ -1,6 +1,6 @@
/*
*
* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
*
*/
@ -21,6 +21,18 @@ class LEGlyphStorage;
class ArabicShaping /* not : public UObject because all methods are static */ {
public:
// Joining types
enum JoiningTypes
{
JT_NON_JOINING = 0,
JT_JOIN_CAUSING = 1,
JT_DUAL_JOINING = 2,
JT_LEFT_JOINING = 3,
JT_RIGHT_JOINING = 4,
JT_TRANSPARENT = 5,
JT_COUNT = 6
};
// shaping bit masks
enum ShapingBitMasks
{
@ -57,6 +69,7 @@ private:
static ShapeType getShapeType(LEUnicode c);
static const le_uint8 shapingTypeTable[];
static const ShapeType shapeTypes[];
static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage);

View File

@ -112,6 +112,7 @@ OpenTypeUtilities.o \
PairPositioningSubtables.o \
ScriptAndLanguage.o \
ScriptAndLanguageTags.o \
ShapingTypeData.o \
SinglePositioningSubtables.o \
SingleSubstitutionSubtables.o \
SubstitutionLookups.o \

View File

@ -0,0 +1,85 @@
/*
*
* (C) Copyright IBM Corp. 1998-2005. All Rights Reserved.
*
* WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS
* YOU REALLY KNOW WHAT YOU'RE DOING.
*
* Generated on: 07/21/2005 10:31:02 AM PDT
*/
#include "LETypes.h"
#include "ArabicShaping.h"
U_NAMESPACE_BEGIN
const le_uint8 ArabicShaping::shapingTypeTable[] = {
0x00, 0x02, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0x05, 0x03, 0x00, 0x03, 0x6F, 0x00, 0x05,
0x04, 0x83, 0x04, 0x86, 0x00, 0x05, 0x04, 0x88, 0x04, 0x89, 0x00, 0x05, 0x05, 0x91, 0x05, 0xB9,
0x00, 0x05, 0x05, 0xBB, 0x05, 0xBD, 0x00, 0x05, 0x05, 0xBF, 0x05, 0xBF, 0x00, 0x05, 0x05, 0xC1,
0x05, 0xC2, 0x00, 0x05, 0x05, 0xC4, 0x05, 0xC5, 0x00, 0x05, 0x05, 0xC7, 0x05, 0xC7, 0x00, 0x05,
0x06, 0x10, 0x06, 0x15, 0x00, 0x05, 0x06, 0x22, 0x06, 0x25, 0x00, 0x04, 0x06, 0x26, 0x06, 0x26,
0x00, 0x02, 0x06, 0x27, 0x06, 0x27, 0x00, 0x04, 0x06, 0x28, 0x06, 0x28, 0x00, 0x02, 0x06, 0x29,
0x06, 0x29, 0x00, 0x04, 0x06, 0x2A, 0x06, 0x2E, 0x00, 0x02, 0x06, 0x2F, 0x06, 0x32, 0x00, 0x04,
0x06, 0x33, 0x06, 0x3A, 0x00, 0x02, 0x06, 0x40, 0x06, 0x40, 0x00, 0x01, 0x06, 0x41, 0x06, 0x47,
0x00, 0x02, 0x06, 0x48, 0x06, 0x48, 0x00, 0x04, 0x06, 0x49, 0x06, 0x4A, 0x00, 0x02, 0x06, 0x4B,
0x06, 0x5E, 0x00, 0x05, 0x06, 0x6E, 0x06, 0x6F, 0x00, 0x02, 0x06, 0x70, 0x06, 0x70, 0x00, 0x05,
0x06, 0x71, 0x06, 0x73, 0x00, 0x04, 0x06, 0x75, 0x06, 0x77, 0x00, 0x04, 0x06, 0x78, 0x06, 0x87,
0x00, 0x02, 0x06, 0x88, 0x06, 0x99, 0x00, 0x04, 0x06, 0x9A, 0x06, 0xBF, 0x00, 0x02, 0x06, 0xC0,
0x06, 0xC0, 0x00, 0x04, 0x06, 0xC1, 0x06, 0xC2, 0x00, 0x02, 0x06, 0xC3, 0x06, 0xCB, 0x00, 0x04,
0x06, 0xCC, 0x06, 0xCC, 0x00, 0x02, 0x06, 0xCD, 0x06, 0xCD, 0x00, 0x04, 0x06, 0xCE, 0x06, 0xCE,
0x00, 0x02, 0x06, 0xCF, 0x06, 0xCF, 0x00, 0x04, 0x06, 0xD0, 0x06, 0xD1, 0x00, 0x02, 0x06, 0xD2,
0x06, 0xD3, 0x00, 0x04, 0x06, 0xD5, 0x06, 0xD5, 0x00, 0x04, 0x06, 0xD6, 0x06, 0xDC, 0x00, 0x05,
0x06, 0xDE, 0x06, 0xE4, 0x00, 0x05, 0x06, 0xE7, 0x06, 0xE8, 0x00, 0x05, 0x06, 0xEA, 0x06, 0xED,
0x00, 0x05, 0x06, 0xEE, 0x06, 0xEF, 0x00, 0x04, 0x06, 0xFA, 0x06, 0xFC, 0x00, 0x02, 0x06, 0xFF,
0x06, 0xFF, 0x00, 0x02, 0x07, 0x0F, 0x07, 0x0F, 0x00, 0x05, 0x07, 0x10, 0x07, 0x10, 0x00, 0x04,
0x07, 0x11, 0x07, 0x11, 0x00, 0x05, 0x07, 0x12, 0x07, 0x14, 0x00, 0x02, 0x07, 0x15, 0x07, 0x19,
0x00, 0x04, 0x07, 0x1A, 0x07, 0x1D, 0x00, 0x02, 0x07, 0x1E, 0x07, 0x1E, 0x00, 0x04, 0x07, 0x1F,
0x07, 0x27, 0x00, 0x02, 0x07, 0x28, 0x07, 0x28, 0x00, 0x04, 0x07, 0x29, 0x07, 0x29, 0x00, 0x02,
0x07, 0x2A, 0x07, 0x2A, 0x00, 0x04, 0x07, 0x2B, 0x07, 0x2B, 0x00, 0x02, 0x07, 0x2C, 0x07, 0x2C,
0x00, 0x04, 0x07, 0x2D, 0x07, 0x2E, 0x00, 0x02, 0x07, 0x2F, 0x07, 0x2F, 0x00, 0x04, 0x07, 0x30,
0x07, 0x4A, 0x00, 0x05, 0x07, 0x4D, 0x07, 0x4D, 0x00, 0x04, 0x07, 0x4E, 0x07, 0x58, 0x00, 0x02,
0x07, 0x59, 0x07, 0x5B, 0x00, 0x04, 0x07, 0x5C, 0x07, 0x6A, 0x00, 0x02, 0x07, 0x6B, 0x07, 0x6C,
0x00, 0x04, 0x07, 0x6D, 0x07, 0x6D, 0x00, 0x02, 0x07, 0xA6, 0x07, 0xB0, 0x00, 0x05, 0x09, 0x01,
0x09, 0x02, 0x00, 0x05, 0x09, 0x3C, 0x09, 0x3C, 0x00, 0x05, 0x09, 0x41, 0x09, 0x48, 0x00, 0x05,
0x09, 0x4D, 0x09, 0x4D, 0x00, 0x05, 0x09, 0x51, 0x09, 0x54, 0x00, 0x05, 0x09, 0x62, 0x09, 0x63,
0x00, 0x05, 0x09, 0x81, 0x09, 0x81, 0x00, 0x05, 0x09, 0xBC, 0x09, 0xBC, 0x00, 0x05, 0x09, 0xC1,
0x09, 0xC4, 0x00, 0x05, 0x09, 0xCD, 0x09, 0xCD, 0x00, 0x05, 0x09, 0xE2, 0x09, 0xE3, 0x00, 0x05,
0x0A, 0x01, 0x0A, 0x02, 0x00, 0x05, 0x0A, 0x3C, 0x0A, 0x3C, 0x00, 0x05, 0x0A, 0x41, 0x0A, 0x42,
0x00, 0x05, 0x0A, 0x47, 0x0A, 0x48, 0x00, 0x05, 0x0A, 0x4B, 0x0A, 0x4D, 0x00, 0x05, 0x0A, 0x70,
0x0A, 0x71, 0x00, 0x05, 0x0A, 0x81, 0x0A, 0x82, 0x00, 0x05, 0x0A, 0xBC, 0x0A, 0xBC, 0x00, 0x05,
0x0A, 0xC1, 0x0A, 0xC5, 0x00, 0x05, 0x0A, 0xC7, 0x0A, 0xC8, 0x00, 0x05, 0x0A, 0xCD, 0x0A, 0xCD,
0x00, 0x05, 0x0A, 0xE2, 0x0A, 0xE3, 0x00, 0x05, 0x0B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05, 0x0F, 0x37, 0x0F, 0x37, 0x00, 0x05, 0x0F, 0x39, 0x0F, 0x39, 0x00, 0x05, 0x0F, 0x71,
0x0F, 0x7E, 0x00, 0x05, 0x0F, 0x80, 0x0F, 0x84, 0x00, 0x05, 0x0F, 0x86, 0x0F, 0x87, 0x00, 0x05,
0x0F, 0x90, 0x0F, 0x97, 0x00, 0x05, 0x0F, 0x99, 0x0F, 0xBC, 0x00, 0x05, 0x0F, 0xC6, 0x0F, 0xC6,
0x00, 0x05, 0x10, 0x2D, 0x10, 0x30, 0x00, 0x05, 0x10, 0x32, 0x10, 0x32, 0x00, 0x05, 0x10, 0x36,
0x10, 0x37, 0x00, 0x05, 0x10, 0x39, 0x10, 0x39, 0x00, 0x05, 0x10, 0x58, 0x10, 0x59, 0x00, 0x05,
0x13, 0x5F, 0x13, 0x5F, 0x00, 0x05, 0x17, 0x12, 0x17, 0x14, 0x00, 0x05, 0x17, 0x32, 0x17, 0x34,
0x00, 0x05, 0x17, 0x52, 0x17, 0x53, 0x00, 0x05, 0x17, 0x72, 0x17, 0x73, 0x00, 0x05, 0x17, 0xB4,
0x17, 0xB5, 0x00, 0x05, 0x17, 0xB7, 0x17, 0xBD, 0x00, 0x05, 0x17, 0xC6, 0x17, 0xC6, 0x00, 0x05,
0x17, 0xC9, 0x17, 0xD3, 0x00, 0x05, 0x17, 0xDD, 0x17, 0xDD, 0x00, 0x05, 0x18, 0x0B, 0x18, 0x0D,
0x00, 0x05, 0x18, 0xA9, 0x18, 0xA9, 0x00, 0x05, 0x19, 0x20, 0x19, 0x22, 0x00, 0x05, 0x19, 0x27,
0x19, 0x28, 0x00, 0x05, 0x19, 0x32, 0x19, 0x32, 0x00, 0x05, 0x19, 0x39, 0x19, 0x3B, 0x00, 0x05,
0x1A, 0x17, 0x1A, 0x18, 0x00, 0x05, 0x1D, 0xC0, 0x1D, 0xC3, 0x00, 0x05, 0x20, 0x0B, 0x20, 0x0B,
0x00, 0x05, 0x20, 0x0D, 0x20, 0x0D, 0x00, 0x01, 0x20, 0x0E, 0x20, 0x0F, 0x00, 0x05, 0x20, 0x2A,
0x20, 0x2E, 0x00, 0x05, 0x20, 0x60, 0x20, 0x63, 0x00, 0x05, 0x20, 0x6A, 0x20, 0x6F, 0x00, 0x05,
0x20, 0xD0, 0x20, 0xEB, 0x00, 0x05, 0x30, 0x2A, 0x30, 0x2F, 0x00, 0x05, 0x30, 0x99, 0x30, 0x9A,
0x00, 0x05, 0xA8, 0x06, 0xA8, 0x06, 0x00, 0x05, 0xA8, 0x0B, 0xA8, 0x0B, 0x00, 0x05, 0xA8, 0x25,
0xA8, 0x26, 0x00, 0x05, 0xFB, 0x1E, 0xFB, 0x1E, 0x00, 0x05, 0xFE, 0x00, 0xFE, 0x0F, 0x00, 0x05,
0xFE, 0x20, 0xFE, 0x23, 0x00, 0x05, 0xFE, 0xFF, 0xFE, 0xFF, 0x00, 0x05, 0xFF, 0xF9, 0xFF, 0xFB,
0x00, 0x05
};
U_NAMESPACE_END

View File

@ -319,6 +319,9 @@
<File
RelativePath=".\SegmentSingleProcessor.cpp">
</File>
<File
RelativePath=".\ShapingTypeData.cpp">
</File>
<File
RelativePath=".\SimpleArrayProcessor.cpp">
</File>