ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

usp10_internal.h
Go to the documentation of this file.
00001 /*
00002  * Implementation of Uniscribe Script Processor (usp10.dll)
00003  *
00004  * Copyright 2010 CodeWeavers, Aric Stewart
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  *
00020  */
00021 #define MS_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
00022           ( ( (ULONG)_x4 << 24 ) |     \
00023             ( (ULONG)_x3 << 16 ) |     \
00024             ( (ULONG)_x2 <<  8 ) |     \
00025               (ULONG)_x1         )
00026 
00027 
00028 #define Script_Latin   1
00029 #define Script_CR      2
00030 #define Script_Numeric 3
00031 #define Script_Control 4
00032 #define Script_Punctuation 5
00033 #define Script_Arabic  6
00034 #define Script_Arabic_Numeric  7
00035 #define Script_Hebrew  8
00036 #define Script_Syriac  9
00037 #define Script_Persian 10
00038 #define Script_Thaana  11
00039 #define Script_Greek   12
00040 #define Script_Cyrillic   13
00041 #define Script_Armenian 14
00042 #define Script_Georgian 15
00043 /* Unicode Chapter 10 */
00044 #define Script_Sinhala 16
00045 #define Script_Tibetan 17
00046 #define Script_Tibetan_Numeric 18
00047 #define Script_Phags_pa 19
00048 /* Unicode Chapter 11 */
00049 #define Script_Thai 20
00050 #define Script_Thai_Numeric 21
00051 #define Script_Lao 22
00052 #define Script_Lao_Numeric 23
00053 /* Unicode Chapter 9 */
00054 #define Script_Devanagari 24
00055 #define Script_Devanagari_Numeric 25
00056 #define Script_Bengali 26
00057 #define Script_Bengali_Numeric 27
00058 #define Script_Bengali_Currency 28
00059 #define Script_Gurmukhi 29
00060 #define Script_Gurmukhi_Numeric 30
00061 #define Script_Gujarati 31
00062 #define Script_Gujarati_Numeric 32
00063 #define Script_Gujarati_Currency 33
00064 #define Script_Oriya 34
00065 #define Script_Oriya_Numeric 35
00066 #define Script_Tamil 36
00067 #define Script_Tamil_Numeric 37
00068 #define Script_Telugu 38
00069 #define Script_Telugu_Numeric 39
00070 #define Script_Kannada 40
00071 #define Script_Kannada_Numeric 41
00072 #define Script_Malayalam 42
00073 #define Script_Malayalam_Numeric 43
00074 /* More supplemental */
00075 #define Script_Diacritical 44
00076 #define Script_Punctuation2 45
00077 #define Script_Numeric2 46
00078 /* Unicode Chapter 11 continued */
00079 #define Script_Myanmar 47
00080 #define Script_Myanmar_Numeric 48
00081 #define Script_Tai_Le 49
00082 #define Script_New_Tai_Lue 50
00083 #define Script_New_Tai_Lue_Numeric 51
00084 #define Script_Khmer 52
00085 #define Script_Khmer_Numeric 53
00086 /* Unicode Chapter 12 */
00087 #define Script_CJK_Han  54
00088 #define Script_Ideograph  55
00089 #define Script_Bopomofo 56
00090 #define Script_Kana 57
00091 #define Script_Hangul 58
00092 #define Script_Yi 59
00093 /* Unicode Chapter 13 */
00094 #define Script_Ethiopic 60
00095 #define Script_Ethiopic_Numeric 61
00096 #define Script_Mongolian 62
00097 #define Script_Mongolian_Numeric 63
00098 #define Script_Tifinagh 64
00099 #define Script_NKo 65
00100 #define Script_Vai 66
00101 #define Script_Vai_Numeric 67
00102 #define Script_Cherokee 68
00103 #define Script_Canadian 69
00104 /* Unicode Chapter 14 */
00105 #define Script_Ogham 70
00106 #define Script_Runic 71
00107 /* Unicode Chapter 15 */
00108 #define Script_Braille 72
00109 /* Unicode Chapter 16 */
00110 #define Script_Surrogates 73
00111 #define Script_Private 74
00112 /* Unicode Chapter 13 : Plane 1 */
00113 #define Script_Deseret 75
00114 #define Script_Osmanya 76
00115 #define Script_Osmanya_Numeric 77
00116 /* Unicode Chapter 15 : Plane 1 */
00117 #define Script_MathAlpha 78
00118 /* Additional Currency Scripts */
00119 #define Script_Hebrew_Currency 79
00120 #define Script_Vietnamese_Currency 80
00121 #define Script_Thai_Currency 81
00122 
00123 #define GLYPH_BLOCK_SHIFT 8
00124 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)
00125 #define GLYPH_BLOCK_MASK  (GLYPH_BLOCK_SIZE - 1)
00126 #define GLYPH_MAX         65536
00127 
00128 #define GSUB_E_NOFEATURE -2
00129 #define GSUB_E_NOGLYPH -1
00130 
00131 typedef struct {
00132     OPENTYPE_TAG tag;
00133     LPCVOID  feature;
00134     INT lookup_count;
00135     WORD *lookups;
00136 } LoadedFeature;
00137 
00138 typedef struct {
00139     OPENTYPE_TAG tag;
00140     LPCVOID table;
00141     INT feature_count;
00142     LoadedFeature *features;
00143 } LoadedLanguage;
00144 
00145 typedef struct {
00146     OPENTYPE_TAG tag;
00147     LPCVOID table;
00148     LoadedLanguage default_language;
00149     INT language_count;
00150     LoadedLanguage *languages;
00151 } LoadedScript;
00152 
00153 typedef struct {
00154     LOGFONTW lf;
00155     TEXTMETRICW tm;
00156     BOOL sfnt;
00157     WORD *glyphs[GLYPH_MAX / GLYPH_BLOCK_SIZE];
00158     ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE];
00159     LPVOID GSUB_Table;
00160     LPVOID GDEF_Table;
00161     LPVOID CMAP_Table;
00162     LPVOID CMAP_format12_Table;
00163     INT script_count;
00164     LoadedScript *scripts;
00165 
00166     OPENTYPE_TAG userScript;
00167     OPENTYPE_TAG userLang;
00168 } ScriptCache;
00169 
00170 typedef struct _scriptData
00171 {
00172     SCRIPT_ANALYSIS a;
00173     SCRIPT_PROPERTIES props;
00174     OPENTYPE_TAG scriptTag;
00175     WCHAR fallbackFont[LF_FACESIZE];
00176 } scriptData;
00177 
00178 typedef struct {
00179     INT start;
00180     INT base;
00181     INT ralf;
00182     INT blwf;
00183     INT pref;
00184     INT end;
00185 } IndicSyllable;
00186 
00187 enum {lex_Halant, lex_Composed_Vowel, lex_Matra_post, lex_Matra_pre, lex_Matra_above, lex_Matra_below, lex_ZWJ, lex_ZWNJ, lex_NBSP, lex_Modifier, lex_Vowel, lex_Consonant, lex_Generic, lex_Ra, lex_Vedic, lex_Anudatta, lex_Nukta};
00188 
00189 static inline BOOL is_consonant( int type )
00190 {
00191     return (type == lex_Ra || type == lex_Consonant);
00192 }
00193 
00194 static inline WCHAR get_table_entry( const unsigned short *table, WCHAR ch )
00195 {
00196     return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
00197 }
00198 
00199 typedef int (*lexical_function)(WCHAR c);
00200 typedef void (*reorder_function)(LPWSTR pwChar, IndicSyllable *syllable, lexical_function lex);
00201 
00202 #define odd(x) ((x) & 1)
00203 #define BIDI_STRONG  1
00204 #define BIDI_WEAK    2
00205 #define BIDI_NEUTRAL 0
00206 
00207 int USP10_FindGlyphInLogClust(const WORD* pwLogClust, int cChars, WORD target) DECLSPEC_HIDDEN;
00208 
00209 BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s,
00210                 const SCRIPT_CONTROL *c, WORD *lpOutLevels ) DECLSPEC_HIDDEN;
00211 BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c,
00212                       WORD* lpStrength) DECLSPEC_HIDDEN;
00213 INT BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
00214 INT BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN;
00215 void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN;
00216 void SHAPE_ApplyDefaultOpentypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust) DECLSPEC_HIDDEN;
00217 HRESULT SHAPE_CheckFontForRequiredFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa) DECLSPEC_HIDDEN;
00218 void SHAPE_CharGlyphProp(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN;
00219 INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *chars, INT write_dir, INT count, const char* feature) DECLSPEC_HIDDEN;
00220 HRESULT SHAPE_GetFontScriptTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN;
00221 HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangSysTags, int *pcTags) DECLSPEC_HIDDEN;
00222 HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags) DECLSPEC_HIDDEN;
00223 
00224 void Indic_ReorderCharacters( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPWSTR input, int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN;
00225 void Indic_ParseSyllables( HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, LPCWSTR input, const int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN;
00226 
00227 void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN;
00228 
00229 DWORD OpenType_CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN;
00230 void OpenType_GDEF_UpdateGlyphProps(HDC hdc, ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD* pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN;
00231 INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) DECLSPEC_HIDDEN;
00232 HRESULT OpenType_GSUB_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags, LPCVOID* script_table) DECLSPEC_HIDDEN;
00233 HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags, LPCVOID* language_table) DECLSPEC_HIDDEN;
00234 HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;

Generated on Sun May 27 2012 04:26:45 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.