ReactOS 0.4.15-dev-7907-g95bf896
usp10_internal.h File Reference
#include "wine/list.h"
Include dependency graph for usp10_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LoadedFeature
 
struct  LoadedLanguage
 
struct  LoadedScript
 
struct  CacheGlyphPage
 
struct  ScriptCache
 
struct  _scriptData
 
struct  IndicSyllable
 

Macros

#define MS_MAKE_TAG(_x1, _x2, _x3, _x4)
 
#define GLYPH_BLOCK_SHIFT   8
 
#define GLYPH_BLOCK_SIZE   (1UL << GLYPH_BLOCK_SHIFT)
 
#define GLYPH_BLOCK_MASK   (GLYPH_BLOCK_SIZE - 1)
 
#define GLYPH_MAX   65536
 
#define NUM_PAGES   17
 
#define GSUB_E_NOFEATURE   -20
 
#define GSUB_E_NOGLYPH   -10
 
#define FEATURE_ALL_TABLES   0
 
#define FEATURE_GSUB_TABLE   1
 
#define FEATURE_GPOS_TABLE   2
 
#define odd(x)   ((x) & 1)
 
#define BIDI_STRONG   1
 
#define BIDI_WEAK   2
 
#define BIDI_NEUTRAL   0
 

Typedefs

typedef struct _scriptData scriptData
 
typedef int(* lexical_function) (WCHAR c)
 
typedef void(* reorder_function) (WCHAR *chars, IndicSyllable *syllable, lexical_function lex)
 

Enumerations

enum  usp10_script {
  Script_Undefined = 0x00 , Script_Latin = 0x01 , Script_CR = 0x02 , Script_Numeric = 0x03 ,
  Script_Control = 0x04 , Script_Punctuation = 0x05 , Script_Arabic = 0x06 , Script_Arabic_Numeric = 0x07 ,
  Script_Hebrew = 0x08 , Script_Syriac = 0x09 , Script_Persian = 0x0a , Script_Thaana = 0x0b ,
  Script_Greek = 0x0c , Script_Cyrillic = 0x0d , Script_Armenian = 0x0e , Script_Georgian = 0x0f ,
  Script_Sinhala = 0x10 , Script_Tibetan = 0x11 , Script_Tibetan_Numeric = 0x12 , Script_Phags_pa = 0x13 ,
  Script_Thai = 0x14 , Script_Thai_Numeric = 0x15 , Script_Lao = 0x16 , Script_Lao_Numeric = 0x17 ,
  Script_Devanagari = 0x18 , Script_Devanagari_Numeric = 0x19 , Script_Bengali = 0x1a , Script_Bengali_Numeric = 0x1b ,
  Script_Bengali_Currency = 0x1c , Script_Gurmukhi = 0x1d , Script_Gurmukhi_Numeric = 0x1e , Script_Gujarati = 0x1f ,
  Script_Gujarati_Numeric = 0x20 , Script_Gujarati_Currency = 0x21 , Script_Oriya = 0x22 , Script_Oriya_Numeric = 0x23 ,
  Script_Tamil = 0x24 , Script_Tamil_Numeric = 0x25 , Script_Telugu = 0x26 , Script_Telugu_Numeric = 0x27 ,
  Script_Kannada = 0x28 , Script_Kannada_Numeric = 0x29 , Script_Malayalam = 0x2a , Script_Malayalam_Numeric = 0x2b ,
  Script_Diacritical = 0x2c , Script_Punctuation2 = 0x2d , Script_Numeric2 = 0x2e , Script_Myanmar = 0x2f ,
  Script_Myanmar_Numeric = 0x30 , Script_Tai_Le = 0x31 , Script_New_Tai_Lue = 0x32 , Script_New_Tai_Lue_Numeric = 0x33 ,
  Script_Khmer = 0x34 , Script_Khmer_Numeric = 0x35 , Script_CJK_Han = 0x36 , Script_Ideograph = 0x37 ,
  Script_Bopomofo = 0x38 , Script_Kana = 0x39 , Script_Hangul = 0x3a , Script_Yi = 0x3b ,
  Script_Ethiopic = 0x3c , Script_Ethiopic_Numeric = 0x3d , Script_Mongolian = 0x3e , Script_Mongolian_Numeric = 0x3f ,
  Script_Tifinagh = 0x40 , Script_NKo = 0x41 , Script_Vai = 0x42 , Script_Vai_Numeric = 0x43 ,
  Script_Cherokee = 0x44 , Script_Canadian = 0x45 , Script_Ogham = 0x46 , Script_Runic = 0x47 ,
  Script_Braille = 0x48 , Script_Surrogates = 0x49 , Script_Private = 0x4a , Script_Deseret = 0x4b ,
  Script_Osmanya = 0x4c , Script_Osmanya_Numeric = 0x4d , Script_MathAlpha = 0x4e , Script_Hebrew_Currency = 0x4f ,
  Script_Vietnamese_Currency = 0x50 , Script_Thai_Currency = 0x51
}
 
enum  usp10_language_table { USP10_LANGUAGE_TABLE_GSUB = 0 , USP10_LANGUAGE_TABLE_GPOS , USP10_LANGUAGE_TABLE_COUNT }
 
enum  usp10_script_table { USP10_SCRIPT_TABLE_GSUB = 0 , USP10_SCRIPT_TABLE_GPOS , USP10_SCRIPT_TABLE_COUNT }
 
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
}
 

Functions

static BOOL is_consonant (int type)
 
static unsigned short get_table_entry (const unsigned short *table, WCHAR ch)
 
BOOL usp10_array_reserve (void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size) DECLSPEC_HIDDEN
 
int USP10_FindGlyphInLogClust (const WORD *pwLogClust, int cChars, WORD target) DECLSPEC_HIDDEN
 
BOOL BIDI_DetermineLevels (const WCHAR *string, unsigned int count, const SCRIPT_STATE *s, const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides) DECLSPEC_HIDDEN
 
BOOL BIDI_GetStrengths (const WCHAR *string, unsigned int count, const SCRIPT_CONTROL *c, WORD *strength) DECLSPEC_HIDDEN
 
INT BIDI_ReorderV2lLevel (int level, int *pIndexs, const BYTE *plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN
 
INT BIDI_ReorderL2vLevel (int level, int *pIndexs, const BYTE *plevel, int cch, BOOL fReverse) DECLSPEC_HIDDEN
 
void SHAPE_ContextualShaping (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) DECLSPEC_HIDDEN
 
void SHAPE_ApplyDefaultOpentypeFeatures (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust) DECLSPEC_HIDDEN
 
void SHAPE_ApplyOpenTypePositions (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WORD *pwGlyphs, INT cGlyphs, int *piAdvance, GOFFSET *pGoffset) DECLSPEC_HIDDEN
 
HRESULT SHAPE_CheckFontForRequiredFeatures (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa) DECLSPEC_HIDDEN
 
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
 
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
 
HRESULT SHAPE_GetFontScriptTags (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN
 
HRESULT SHAPE_GetFontLanguageTags (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangSysTags, int *pcTags) DECLSPEC_HIDDEN
 
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
 
void Indic_ReorderCharacters (HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChars, IndicSyllable **syllables, int *syllable_count, lexical_function lexical_f, reorder_function reorder_f, BOOL modern) DECLSPEC_HIDDEN
 
void Indic_ParseSyllables (HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern) DECLSPEC_HIDDEN
 
void BREAK_line (const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) DECLSPEC_HIDDEN
 
DWORD OpenType_CMAP_GetGlyphIndex (HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN
 
void OpenType_GDEF_UpdateGlyphProps (ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD *pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN
 
int OpenType_apply_GSUB_lookup (const void *table, unsigned int lookup_index, WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count) DECLSPEC_HIDDEN
 
unsigned int OpenType_apply_GPOS_lookup (const ScriptCache *psc, const OUTLINETEXTMETRICW *otm, const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, unsigned int lookup_index, const WORD *glyphs, unsigned int glyph_index, unsigned int glyph_count, GOFFSET *goffset) DECLSPEC_HIDDEN
 
HRESULT OpenType_GetFontScriptTags (ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN
 
HRESULT OpenType_GetFontLanguageTags (ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) DECLSPEC_HIDDEN
 
HRESULT OpenType_GetFontFeatureTags (ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, char tableType, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature **feature) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ BIDI_NEUTRAL

#define BIDI_NEUTRAL   0

Definition at line 249 of file usp10_internal.h.

◆ BIDI_STRONG

#define BIDI_STRONG   1

Definition at line 247 of file usp10_internal.h.

◆ BIDI_WEAK

#define BIDI_WEAK   2

Definition at line 248 of file usp10_internal.h.

◆ FEATURE_ALL_TABLES

#define FEATURE_ALL_TABLES   0

Definition at line 141 of file usp10_internal.h.

◆ FEATURE_GPOS_TABLE

#define FEATURE_GPOS_TABLE   2

Definition at line 143 of file usp10_internal.h.

◆ FEATURE_GSUB_TABLE

#define FEATURE_GSUB_TABLE   1

Definition at line 142 of file usp10_internal.h.

◆ GLYPH_BLOCK_MASK

#define GLYPH_BLOCK_MASK   (GLYPH_BLOCK_SIZE - 1)

Definition at line 133 of file usp10_internal.h.

◆ GLYPH_BLOCK_SHIFT

#define GLYPH_BLOCK_SHIFT   8

Definition at line 131 of file usp10_internal.h.

◆ GLYPH_BLOCK_SIZE

#define GLYPH_BLOCK_SIZE   (1UL << GLYPH_BLOCK_SHIFT)

Definition at line 132 of file usp10_internal.h.

◆ GLYPH_MAX

#define GLYPH_MAX   65536

Definition at line 134 of file usp10_internal.h.

◆ GSUB_E_NOFEATURE

#define GSUB_E_NOFEATURE   -20

Definition at line 138 of file usp10_internal.h.

◆ GSUB_E_NOGLYPH

#define GSUB_E_NOGLYPH   -10

Definition at line 139 of file usp10_internal.h.

◆ MS_MAKE_TAG

#define MS_MAKE_TAG (   _x1,
  _x2,
  _x3,
  _x4 
)
Value:
( ( (ULONG)_x4 << 24 ) | \
( (ULONG)_x3 << 16 ) | \
( (ULONG)_x2 << 8 ) | \
(ULONG)_x1 )
uint32_t ULONG
Definition: typedefs.h:59

Definition at line 26 of file usp10_internal.h.

◆ NUM_PAGES

#define NUM_PAGES   17

Definition at line 136 of file usp10_internal.h.

◆ odd

#define odd (   x)    ((x) & 1)

Definition at line 246 of file usp10_internal.h.

Typedef Documentation

◆ lexical_function

typedef int(* lexical_function) (WCHAR c)

Definition at line 243 of file usp10_internal.h.

◆ reorder_function

typedef void(* reorder_function) (WCHAR *chars, IndicSyllable *syllable, lexical_function lex)

Definition at line 244 of file usp10_internal.h.

◆ scriptData

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
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 

Definition at line 231 of file usp10_internal.h.

@ lex_Nukta
@ lex_Anudatta
@ lex_Matra_above
@ lex_Matra_below
@ lex_ZWJ
@ lex_Consonant
@ lex_Vowel
@ lex_Ra
@ lex_Modifier
@ lex_Generic
@ lex_NBSP
@ lex_Vedic
@ lex_Composed_Vowel
@ lex_Matra_post
@ lex_ZWNJ
@ lex_Halant
@ lex_Matra_pre

◆ usp10_language_table

Enumerator
USP10_LANGUAGE_TABLE_GSUB 
USP10_LANGUAGE_TABLE_GPOS 
USP10_LANGUAGE_TABLE_COUNT 

Definition at line 153 of file usp10_internal.h.

154{
158};
@ USP10_LANGUAGE_TABLE_GSUB
@ USP10_LANGUAGE_TABLE_COUNT
@ USP10_LANGUAGE_TABLE_GPOS

◆ usp10_script

Enumerator
Script_Undefined 
Script_Latin 
Script_CR 
Script_Numeric 
Script_Control 
Script_Punctuation 
Script_Arabic 
Script_Arabic_Numeric 
Script_Hebrew 
Script_Syriac 
Script_Persian 
Script_Thaana 
Script_Greek 
Script_Cyrillic 
Script_Armenian 
Script_Georgian 
Script_Sinhala 
Script_Tibetan 
Script_Tibetan_Numeric 
Script_Phags_pa 
Script_Thai 
Script_Thai_Numeric 
Script_Lao 
Script_Lao_Numeric 
Script_Devanagari 
Script_Devanagari_Numeric 
Script_Bengali 
Script_Bengali_Numeric 
Script_Bengali_Currency 
Script_Gurmukhi 
Script_Gurmukhi_Numeric 
Script_Gujarati 
Script_Gujarati_Numeric 
Script_Gujarati_Currency 
Script_Oriya 
Script_Oriya_Numeric 
Script_Tamil 
Script_Tamil_Numeric 
Script_Telugu 
Script_Telugu_Numeric 
Script_Kannada 
Script_Kannada_Numeric 
Script_Malayalam 
Script_Malayalam_Numeric 
Script_Diacritical 
Script_Punctuation2 
Script_Numeric2 
Script_Myanmar 
Script_Myanmar_Numeric 
Script_Tai_Le 
Script_New_Tai_Lue 
Script_New_Tai_Lue_Numeric 
Script_Khmer 
Script_Khmer_Numeric 
Script_CJK_Han 
Script_Ideograph 
Script_Bopomofo 
Script_Kana 
Script_Hangul 
Script_Yi 
Script_Ethiopic 
Script_Ethiopic_Numeric 
Script_Mongolian 
Script_Mongolian_Numeric 
Script_Tifinagh 
Script_NKo 
Script_Vai 
Script_Vai_Numeric 
Script_Cherokee 
Script_Canadian 
Script_Ogham 
Script_Runic 
Script_Braille 
Script_Surrogates 
Script_Private 
Script_Deseret 
Script_Osmanya 
Script_Osmanya_Numeric 
Script_MathAlpha 
Script_Hebrew_Currency 
Script_Vietnamese_Currency 
Script_Thai_Currency 

Definition at line 32 of file usp10_internal.h.

33{
34 Script_Undefined = 0x00,
35 Script_Latin = 0x01,
36 Script_CR = 0x02,
37 Script_Numeric = 0x03,
38 Script_Control = 0x04,
39 Script_Punctuation = 0x05,
40 Script_Arabic = 0x06,
42 Script_Hebrew = 0x08,
43 Script_Syriac = 0x09,
44 Script_Persian = 0x0a,
45 Script_Thaana = 0x0b,
46 Script_Greek = 0x0c,
47 Script_Cyrillic = 0x0d,
48 Script_Armenian = 0x0e,
49 Script_Georgian = 0x0f,
50 /* Unicode Chapter 10 */
51 Script_Sinhala = 0x10,
52 Script_Tibetan = 0x11,
54 Script_Phags_pa = 0x13,
55 /* Unicode Chapter 11 */
56 Script_Thai = 0x14,
58 Script_Lao = 0x16,
59 Script_Lao_Numeric = 0x17,
60 /* Unicode Chapter 9 */
61 Script_Devanagari = 0x18,
63 Script_Bengali = 0x1a,
66 Script_Gurmukhi = 0x1d,
68 Script_Gujarati = 0x1f,
71 Script_Oriya = 0x22,
73 Script_Tamil = 0x24,
75 Script_Telugu = 0x26,
77 Script_Kannada = 0x28,
79 Script_Malayalam = 0x2a,
81 /* More supplemental */
82 Script_Diacritical = 0x2c,
84 Script_Numeric2 = 0x2e,
85 /* Unicode Chapter 11 continued */
86 Script_Myanmar = 0x2f,
88 Script_Tai_Le = 0x31,
89 Script_New_Tai_Lue = 0x32,
91 Script_Khmer = 0x34,
93 /* Unicode Chapter 12 */
94 Script_CJK_Han = 0x36,
95 Script_Ideograph = 0x37,
96 Script_Bopomofo = 0x38,
97 Script_Kana = 0x39,
98 Script_Hangul = 0x3a,
99 Script_Yi = 0x3b,
100 /* Unicode Chapter 13 */
101 Script_Ethiopic = 0x3c,
103 Script_Mongolian = 0x3e,
105 Script_Tifinagh = 0x40,
106 Script_NKo = 0x41,
107 Script_Vai = 0x42,
108 Script_Vai_Numeric = 0x43,
109 Script_Cherokee = 0x44,
110 Script_Canadian = 0x45,
111 /* Unicode Chapter 14 */
112 Script_Ogham = 0x46,
113 Script_Runic = 0x47,
114 /* Unicode Chapter 15 */
115 Script_Braille = 0x48,
116 /* Unicode Chapter 16 */
117 Script_Surrogates = 0x49,
118 Script_Private = 0x4a,
119 /* Unicode Chapter 13 : Plane 1 */
120 Script_Deseret = 0x4b,
121 Script_Osmanya = 0x4c,
123 /* Unicode Chapter 15 : Plane 1 */
124 Script_MathAlpha = 0x4e,
125 /* Additional Currency Scripts */
129};
@ Script_Kannada_Numeric
@ Script_Bengali_Numeric
@ Script_Telugu
@ Script_Yi
@ Script_Bopomofo
@ Script_Cyrillic
@ Script_Private
@ Script_Tibetan_Numeric
@ Script_Gurmukhi_Numeric
@ Script_Tai_Le
@ Script_Devanagari_Numeric
@ Script_Telugu_Numeric
@ Script_Myanmar
@ Script_NKo
@ Script_Thai_Numeric
@ Script_Khmer
@ Script_Tifinagh
@ Script_Runic
@ Script_Malayalam_Numeric
@ Script_Vietnamese_Currency
@ Script_Phags_pa
@ Script_Undefined
@ Script_Mongolian_Numeric
@ Script_Cherokee
@ Script_Vai_Numeric
@ Script_Sinhala
@ Script_Hebrew
@ Script_Ethiopic
@ Script_Ogham
@ Script_CR
@ Script_Numeric2
@ Script_Gujarati_Numeric
@ Script_Thai
@ Script_Hangul
@ Script_Diacritical
@ Script_Bengali
@ Script_Syriac
@ Script_Tamil_Numeric
@ Script_Oriya_Numeric
@ Script_Osmanya_Numeric
@ Script_Arabic_Numeric
@ Script_Oriya
@ Script_Thai_Currency
@ Script_Deseret
@ Script_Kannada
@ Script_Punctuation2
@ Script_Arabic
@ Script_Hebrew_Currency
@ Script_Control
@ Script_Georgian
@ Script_Mongolian
@ Script_Gurmukhi
@ Script_Thaana
@ Script_Tibetan
@ Script_Tamil
@ Script_New_Tai_Lue
@ Script_Latin
@ Script_Bengali_Currency
@ Script_New_Tai_Lue_Numeric
@ Script_Gujarati_Currency
@ Script_Canadian
@ Script_Greek
@ Script_Persian
@ Script_Armenian
@ Script_Surrogates
@ Script_Ideograph
@ Script_Osmanya
@ Script_Kana
@ Script_Lao_Numeric
@ Script_Myanmar_Numeric
@ Script_Numeric
@ Script_Ethiopic_Numeric
@ Script_Punctuation
@ Script_Gujarati
@ Script_Devanagari
@ Script_Lao
@ Script_Braille
@ Script_Khmer_Numeric
@ Script_CJK_Han
@ Script_Vai
@ Script_Malayalam
@ Script_MathAlpha

◆ usp10_script_table

Enumerator
USP10_SCRIPT_TABLE_GSUB 
USP10_SCRIPT_TABLE_GPOS 
USP10_SCRIPT_TABLE_COUNT 

Definition at line 169 of file usp10_internal.h.

170{
174};
@ USP10_SCRIPT_TABLE_GSUB
@ USP10_SCRIPT_TABLE_COUNT
@ USP10_SCRIPT_TABLE_GPOS

Function Documentation

◆ BIDI_DetermineLevels()

BOOL BIDI_DetermineLevels ( const WCHAR string,
unsigned int  count,
const SCRIPT_STATE s,
const SCRIPT_CONTROL c,
WORD levels,
WORD overrides 
)

Definition at line 1088 of file bidi.c.

1096{
1097 WORD *chartype;
1098 unsigned baselevel = 0;
1099 struct list IsolatingRuns;
1100 IsolatedRun *iso_run, *next;
1101
1102 TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount);
1103
1104 if (!(chartype = heap_alloc(uCount * sizeof(*chartype))))
1105 {
1106 WARN("Out of memory\n");
1107 return FALSE;
1108 }
1109
1110 baselevel = s->uBidiLevel;
1111
1112 classify(lpString, chartype, uCount, c);
1113 if (TRACE_ON(bidi)) dump_types("Start ", chartype, 0, uCount);
1114
1115 memset(lpOutOverrides, 0, sizeof(WORD) * uCount);
1116
1117 /* resolve explicit */
1118 resolveExplicit(baselevel, chartype, lpOutLevels, lpOutOverrides, uCount, s->fOverrideDirection);
1119 if (TRACE_ON(bidi)) dump_types("After Explicit", chartype, 0, uCount);
1120
1121 /* X10/BD13: Computer Isolating runs */
1122 computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, lpString, uCount, &IsolatingRuns);
1123
1124 LIST_FOR_EACH_ENTRY_SAFE(iso_run, next, &IsolatingRuns, IsolatedRun, entry)
1125 {
1126 if (TRACE_ON(bidi)) iso_dump_types("Run", iso_run);
1127
1128 /* resolve weak */
1129 resolveWeak(iso_run);
1130 if (TRACE_ON(bidi)) iso_dump_types("After Weak", iso_run);
1131
1132 /* resolve neutrals */
1133 resolveNeutrals(iso_run);
1134 if (TRACE_ON(bidi)) iso_dump_types("After Neutrals", iso_run);
1135
1136 list_remove(&iso_run->entry);
1137 heap_free(iso_run);
1138 }
1139
1140 if (TRACE_ON(bidi)) dump_types("Before Implicit", chartype, 0, uCount);
1141 /* resolveImplicit */
1142 resolveImplicit(chartype, lpOutLevels, 0, uCount-1);
1143
1144 /* resolveResolvedLevels*/
1145 classify(lpString, chartype, uCount, c);
1146 resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1);
1147
1148 heap_free(chartype);
1149 return TRUE;
1150}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define WARN(fmt,...)
Definition: debug.h:112
Definition: list.h:37
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define TRACE_ON(x)
Definition: compat.h:75
unsigned short WORD
Definition: ntddk_ex.h:93
GLdouble s
Definition: gl.h:2039
const GLubyte * c
Definition: glext.h:8905
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_wn
Definition: kernel32.h:33
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
static void resolveImplicit(const WORD *pcls, WORD *plevel, int sos, int eos)
Definition: bidi.c:891
static void iso_dump_types(const char *header, IsolatedRun *iso_run)
Definition: bidi.c:475
static void resolveWeak(IsolatedRun *iso_run)
Definition: bidi.c:506
static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, const WORD *pLevel, const WCHAR *string, unsigned int uCount, struct list *set)
Definition: bidi.c:949
static void resolveResolved(unsigned baselevel, const WORD *pcls, WORD *plevel, int sos, int eos)
Definition: bidi.c:913
static void dump_types(const char *header, WORD *types, int start, int end)
Definition: bidi.c:146
static void resolveExplicit(int level, WORD *pclass, WORD *poutLevel, WORD *poutOverrides, int count, BOOL initialOverride)
Definition: bidi.c:227
static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c)
Definition: bidi.c:161
static void resolveNeutrals(IsolatedRun *iso_run)
Definition: bidi.c:734

Referenced by _ItemizeInternal().

◆ BIDI_GetStrengths()

BOOL BIDI_GetStrengths ( const WCHAR string,
unsigned int  count,
const SCRIPT_CONTROL c,
WORD strength 
)

Definition at line 1249 of file bidi.c.

1250{
1251 unsigned int i;
1252
1253 classify(string, strength, count, c);
1254 for (i = 0; i < count; i++)
1255 {
1256 switch (strength[i])
1257 {
1258 case L:
1259 case LRE:
1260 case LRO:
1261 case R:
1262 case AL:
1263 case RLE:
1264 case RLO:
1265 strength[i] = BIDI_STRONG;
1266 break;
1267 case PDF:
1268 case EN:
1269 case ES:
1270 case ET:
1271 case AN:
1272 case CS:
1273 case BN:
1274 strength[i] = BIDI_WEAK;
1275 break;
1276 case B:
1277 case S:
1278 case WS:
1279 case ON:
1280 default: /* Neutrals and NSM */
1281 strength[i] = BIDI_NEUTRAL;
1282 }
1283 }
1284 return TRUE;
1285}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ LRO
Definition: bidi.c:104
@ WS
Definition: bidi.c:98
@ EN
Definition: bidi.c:86
@ R
Definition: bidi.c:84
@ LRE
Definition: bidi.c:105
@ RLE
Definition: bidi.c:103
@ B
Definition: bidi.c:99
@ ET
Definition: bidi.c:91
@ AN
Definition: bidi.c:85
@ ES
Definition: bidi.c:90
@ PDF
Definition: bidi.c:106
@ RLO
Definition: bidi.c:102
@ CS
Definition: bidi.c:89
@ ON
Definition: bidi.c:82
@ AL
Definition: bidi.c:87
@ BN
Definition: bidi.c:94
@ L
Definition: bidi.c:83
@ S
Definition: bidi.c:97
#define BIDI_NEUTRAL
#define BIDI_STRONG
#define BIDI_WEAK

Referenced by _ItemizeInternal().

◆ BIDI_ReorderL2vLevel()

INT BIDI_ReorderL2vLevel ( int  level,
int pIndexs,
const BYTE plevel,
int  cch,
BOOL  fReverse 
)

Definition at line 1215 of file bidi.c.

1216{
1217 int ich = 0;
1218 int newlevel = -1;
1219
1220 /* true as soon as first odd level encountered */
1221 fReverse = fReverse || odd(level);
1222
1223 for (; ich < cch; ich++)
1224 {
1225 if (plevel[ich] < level)
1226 break;
1227 else if (plevel[ich] > level)
1228 newlevel = ich;
1229 }
1230 if (fReverse)
1231 {
1232 reverse(pIndexs, ich);
1233 }
1234
1235 if (newlevel >= 0)
1236 {
1237 ich = 0;
1238 for (; ich < cch; ich++)
1239 if (plevel[ich] < level)
1240 break;
1241 else if (plevel[ich] > level)
1242 ich += BIDI_ReorderL2vLevel(level + 1, pIndexs + ich, plevel + ich,
1243 cch - ich, fReverse) - 1;
1244 }
1245
1246 return ich;
1247}
GLint level
Definition: gl.h:1546
#define odd(x)
Definition: bidi.c:51
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
static void reverse(int *pidx, int cch)
Definition: bidi.c:1153
int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE *plevel, int cch, BOOL fReverse)
Definition: bidi.c:1215

Referenced by BIDI_ReorderL2vLevel(), and ScriptLayout().

◆ BIDI_ReorderV2lLevel()

INT BIDI_ReorderV2lLevel ( int  level,
int pIndexs,
const BYTE plevel,
int  cch,
BOOL  fReverse 
)

Definition at line 1188 of file bidi.c.

1189{
1190 int ich = 0;
1191
1192 /* true as soon as first odd level encountered */
1193 fReverse = fReverse || odd(level);
1194
1195 for (; ich < cch; ich++)
1196 {
1197 if (plevel[ich] < level)
1198 {
1199 break;
1200 }
1201 else if (plevel[ich] > level)
1202 {
1203 ich += BIDI_ReorderV2lLevel(level + 1, pIndexs + ich, plevel + ich,
1204 cch - ich, fReverse) - 1;
1205 }
1206 }
1207 if (fReverse)
1208 {
1209 reverse(pIndexs, ich);
1210 }
1211 return ich;
1212}
int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE *plevel, int cch, BOOL fReverse)
Definition: bidi.c:1188

Referenced by BIDI_ReorderV2lLevel(), and ScriptLayout().

◆ BREAK_line()

void BREAK_line ( const WCHAR chars,
int  count,
const SCRIPT_ANALYSIS sa,
SCRIPT_LOGATTR la 
)

Definition at line 77 of file breaking.c.

78{
79 int i,j;
80 short *break_class;
81 short *break_before;
82
83 TRACE("In %s\n",debugstr_wn(chars,count));
84
85 break_class = heap_alloc(count * sizeof(*break_class));
86 break_before = heap_alloc(count * sizeof(*break_before));
87
88 for (i = 0; i < count; i++)
89 {
90 break_class[i] = get_table_entry( wine_linebreak_table, chars[i] );
91 break_before[i] = 0;
92
93 memset(&la[i],0,sizeof(SCRIPT_LOGATTR));
94
95 la[i].fCharStop = TRUE;
96 switch (break_class[i])
97 {
98 case b_BK:
99 case b_ZW:
100 case b_SP:
101 la[i].fWhiteSpace = TRUE;
102 break;
103 case b_CM:
104 la[i].fCharStop = FALSE;
105 break;
106 }
107 }
108
109 /* LB1 */
110 /* TODO: Have outside algorithms for these scripts */
111 for (i = 0; i < count; i++)
112 {
113 switch(break_class[i])
114 {
115 case b_AI:
116 case b_SA:
117 case b_SG:
118 case b_XX:
119 break_class[i] = b_AL;
120 break;
121 case b_CJ:
122 break_class[i] = b_NS;
123 break;
124 }
125 }
126
127 /* LB2 - LB3 */
128 break_before[0] = b_x;
129 for (i = 0; i < count; i++)
130 {
131 switch(break_class[i])
132 {
133 /* LB4 - LB6 */
134 case b_CR:
135 if (i < count-1 && break_class[i+1] == b_LF)
136 {
137 else_break(&break_before[i],b_x);
138 else_break(&break_before[i+1],b_x);
139 break;
140 }
141 case b_LF:
142 case b_NL:
143 case b_BK:
144 if (i < count-1) else_break(&break_before[i+1],b_r);
145 else_break(&break_before[i],b_x);
146 break;
147 /* LB7 */
148 case b_SP:
149 else_break(&break_before[i],b_x);
150 break;
151 case b_ZW:
152 else_break(&break_before[i],b_x);
153 /* LB8 */
154 while (i < count-1 && break_class[i+1] == b_SP)
155 i++;
156 else_break(&break_before[i],b_s);
157 break;
158 }
159 }
160
161 debug_output_breaks(break_before,count);
162
163 /* LB9 - LB10 */
164 for (i = 0; i < count; i++)
165 {
166 if (break_class[i] == b_CM)
167 {
168 if (i > 0)
169 {
170 switch (break_class[i-1])
171 {
172 case b_SP:
173 case b_BK:
174 case b_CR:
175 case b_LF:
176 case b_NL:
177 case b_ZW:
178 break_class[i] = b_AL;
179 break;
180 default:
181 break_class[i] = break_class[i-1];
182 }
183 }
184 else break_class[i] = b_AL;
185 }
186 }
187
188 for (i = 0; i < count; i++)
189 {
190 switch(break_class[i])
191 {
192 /* LB11 */
193 case b_WJ:
194 else_break(&break_before[i],b_x);
195 if (i < count-1)
196 else_break(&break_before[i+1],b_x);
197 break;
198 /* LB12 */
199 case b_GL:
200 if (i < count-1)
201 else_break(&break_before[i+1],b_x);
202 /* LB12a */
203 if (i > 0)
204 {
205 if (break_class[i-1] != b_SP &&
206 break_class[i-1] != b_BA &&
207 break_class[i-1] != b_HY)
208 else_break(&break_before[i],b_x);
209 }
210 break;
211 /* LB13 */
212 case b_CL:
213 case b_CP:
214 case b_EX:
215 case b_IS:
216 case b_SY:
217 else_break(&break_before[i],b_x);
218 break;
219 /* LB14 */
220 case b_OP:
221 while (i < count-1 && break_class[i+1] == b_SP)
222 {
223 else_break(&break_before[i+1],b_x);
224 i++;
225 }
226 else_break(&break_before[i+1],b_x);
227 break;
228 /* LB15 */
229 case b_QU:
230 j = i+1;
231 while (j < count-1 && break_class[j] == b_SP)
232 j++;
233 if (break_class[j] == b_OP)
234 {
235 for (; j > i; j--)
236 else_break(&break_before[j],b_x);
237 }
238 break;
239 /* LB16 */
240 case b_NS:
241 j = i-1;
242 while(j > 0 && break_class[j] == b_SP)
243 j--;
244 if (break_class[j] == b_CL || break_class[j] == b_CP)
245 {
246 for (j++; j <= i; j++)
247 else_break(&break_before[j],b_x);
248 }
249 break;
250 /* LB17 */
251 case b_B2:
252 j = i+1;
253 while (j < count && break_class[j] == b_SP)
254 j++;
255 if (break_class[j] == b_B2)
256 {
257 for (; j > i; j--)
258 else_break(&break_before[j],b_x);
259 }
260 break;
261 }
262 }
263
264 debug_output_breaks(break_before,count);
265
266 for (i = 0; i < count; i++)
267 {
268 switch(break_class[i])
269 {
270 /* LB18 */
271 case b_SP:
272 if (i < count-1)
273 else_break(&break_before[i+1],b_s);
274 break;
275 /* LB19 */
276 case b_QU:
277 else_break(&break_before[i],b_x);
278 if (i < count-1)
279 else_break(&break_before[i+1],b_x);
280 break;
281 /* LB20 */
282 case b_CB:
283 else_break(&break_before[i],b_s);
284 if (i < count-1)
285 else_break(&break_before[i+1],b_s);
286 break;
287 /* LB21 */
288 case b_BA:
289 case b_HY:
290 case b_NS:
291 else_break(&break_before[i],b_x);
292 break;
293 case b_BB:
294 if (i < count-1)
295 else_break(&break_before[i+1],b_x);
296 break;
297 /* LB21a */
298 case b_HL:
299 if (i < count-2)
300 switch (break_class[i+1])
301 {
302 case b_HY:
303 case b_BA:
304 else_break(&break_before[i+2], b_x);
305 }
306 break;
307 /* LB22 */
308 case b_IN:
309 if (i > 0)
310 {
311 switch (break_class[i-1])
312 {
313 case b_AL:
314 case b_HL:
315 case b_ID:
316 case b_IN:
317 case b_NU:
318 else_break(&break_before[i], b_x);
319 }
320 }
321 break;
322 }
323
324 if (i < count-1)
325 {
326 /* LB23 */
327 if ((break_class[i] == b_ID && break_class[i+1] == b_PO) ||
328 (break_class[i] == b_AL && break_class[i+1] == b_NU) ||
329 (break_class[i] == b_HL && break_class[i+1] == b_NU) ||
330 (break_class[i] == b_NU && break_class[i+1] == b_AL) ||
331 (break_class[i] == b_NU && break_class[i+1] == b_HL))
332 else_break(&break_before[i+1],b_x);
333 /* LB24 */
334 if ((break_class[i] == b_PR && break_class[i+1] == b_ID) ||
335 (break_class[i] == b_PR && break_class[i+1] == b_AL) ||
336 (break_class[i] == b_PR && break_class[i+1] == b_HL) ||
337 (break_class[i] == b_PO && break_class[i+1] == b_AL) ||
338 (break_class[i] == b_PO && break_class[i+1] == b_HL))
339 else_break(&break_before[i+1],b_x);
340
341 /* LB25 */
342 if ((break_class[i] == b_CL && break_class[i+1] == b_PO) ||
343 (break_class[i] == b_CP && break_class[i+1] == b_PO) ||
344 (break_class[i] == b_CL && break_class[i+1] == b_PR) ||
345 (break_class[i] == b_CP && break_class[i+1] == b_PR) ||
346 (break_class[i] == b_NU && break_class[i+1] == b_PO) ||
347 (break_class[i] == b_NU && break_class[i+1] == b_PR) ||
348 (break_class[i] == b_PO && break_class[i+1] == b_OP) ||
349 (break_class[i] == b_PO && break_class[i+1] == b_NU) ||
350 (break_class[i] == b_PR && break_class[i+1] == b_OP) ||
351 (break_class[i] == b_PR && break_class[i+1] == b_NU) ||
352 (break_class[i] == b_HY && break_class[i+1] == b_NU) ||
353 (break_class[i] == b_IS && break_class[i+1] == b_NU) ||
354 (break_class[i] == b_NU && break_class[i+1] == b_NU) ||
355 (break_class[i] == b_SY && break_class[i+1] == b_NU))
356 else_break(&break_before[i+1],b_x);
357
358 /* LB26 */
359 if (break_class[i] == b_JL)
360 {
361 switch (break_class[i+1])
362 {
363 case b_JL:
364 case b_JV:
365 case b_H2:
366 case b_H3:
367 else_break(&break_before[i+1],b_x);
368 }
369 }
370 if ((break_class[i] == b_JV || break_class[i] == b_H2) &&
371 (break_class[i+1] == b_JV || break_class[i+1] == b_JT))
372 else_break(&break_before[i+1],b_x);
373 if ((break_class[i] == b_JT || break_class[i] == b_H3) &&
374 break_class[i+1] == b_JT)
375 else_break(&break_before[i+1],b_x);
376
377 /* LB27 */
378 switch (break_class[i])
379 {
380 case b_JL:
381 case b_JV:
382 case b_JT:
383 case b_H2:
384 case b_H3:
385 if (break_class[i+1] == b_IN || break_class[i+1] == b_PO)
386 else_break(&break_before[i+1],b_x);
387 }
388 if (break_class[i] == b_PR)
389 {
390 switch (break_class[i+1])
391 {
392 case b_JL:
393 case b_JV:
394 case b_JT:
395 case b_H2:
396 case b_H3:
397 else_break(&break_before[i+1],b_x);
398 }
399 }
400
401 /* LB28 */
402 if ((break_class[i] == b_AL && break_class[i+1] == b_AL) ||
403 (break_class[i] == b_AL && break_class[i+1] == b_HL) ||
404 (break_class[i] == b_HL && break_class[i+1] == b_AL) ||
405 (break_class[i] == b_HL && break_class[i+1] == b_HL))
406 else_break(&break_before[i+1],b_x);
407
408 /* LB29 */
409 if ((break_class[i] == b_IS && break_class[i+1] == b_AL) ||
410 (break_class[i] == b_IS && break_class[i+1] == b_HL))
411 else_break(&break_before[i+1],b_x);
412
413 /* LB30 */
414 if ((break_class[i] == b_AL || break_class[i] == b_HL || break_class[i] == b_NU) &&
415 break_class[i+1] == b_OP)
416 else_break(&break_before[i+1],b_x);
417 if (break_class[i] == b_CP &&
418 (break_class[i+1] == b_AL || break_class[i+1] == b_HL || break_class[i+1] == b_NU))
419 else_break(&break_before[i+1],b_x);
420
421 /* LB30a */
422 if (break_class[i] == b_RI && break_class[i+1] == b_RI)
423 else_break(&break_before[i+1],b_x);
424 }
425 }
426 debug_output_breaks(break_before,count);
427
428 /* LB31 */
429 for (i = 0; i < count-1; i++)
430 else_break(&break_before[i+1],b_s);
431
432 debug_output_breaks(break_before,count);
433 for (i = 0; i < count; i++)
434 {
435 if (break_before[i] != b_x)
436 {
437 la[i].fSoftBreak = TRUE;
438 la[i].fWordStop = TRUE;
439 }
440 }
441
442 heap_free(break_before);
443 heap_free(break_class);
444}
static unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
Definition: IdnToAscii.c:32
static void else_break(short *before, short class)
Definition: breaking.c:72
static void debug_output_breaks(const short *breaks, int count)
Definition: breaking.c:50
@ b_s
Definition: breaking.c:48
@ b_r
Definition: breaking.c:48
@ b_x
Definition: breaking.c:48
@ b_H2
Definition: breaking.c:43
@ b_IS
Definition: breaking.c:44
@ b_JL
Definition: breaking.c:43
@ b_CB
Definition: breaking.c:43
@ b_OP
Definition: breaking.c:43
@ b_CJ
Definition: breaking.c:45
@ b_ID
Definition: breaking.c:44
@ b_QU
Definition: breaking.c:44
@ b_HY
Definition: breaking.c:44
@ b_SY
Definition: breaking.c:44
@ b_NL
Definition: breaking.c:43
@ b_WJ
Definition: breaking.c:43
@ b_EX
Definition: breaking.c:44
@ b_BB
Definition: breaking.c:44
@ b_XX
Definition: breaking.c:43
@ b_HL
Definition: breaking.c:44
@ b_PO
Definition: breaking.c:44
@ b_ZW
Definition: breaking.c:43
@ b_JT
Definition: breaking.c:43
@ b_LF
Definition: breaking.c:43
@ b_CL
Definition: breaking.c:43
@ b_GL
Definition: breaking.c:43
@ b_PR
Definition: breaking.c:44
@ b_CM
Definition: breaking.c:43
@ b_RI
Definition: breaking.c:45
@ b_BA
Definition: breaking.c:44
@ b_JV
Definition: breaking.c:43
@ b_BK
Definition: breaking.c:43
@ b_CP
Definition: breaking.c:44
@ b_CR
Definition: breaking.c:43
@ b_AI
Definition: breaking.c:44
@ b_NU
Definition: breaking.c:44
@ b_SA
Definition: breaking.c:44
@ b_H3
Definition: breaking.c:43
@ b_SG
Definition: breaking.c:43
@ b_AL
Definition: breaking.c:44
@ b_NS
Definition: breaking.c:44
@ b_SP
Definition: breaking.c:43
@ b_B2
Definition: breaking.c:44
@ b_IN
Definition: breaking.c:44
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7216]
Definition: linebreak.c:7
BYTE fWhiteSpace
Definition: usp10.h:188

Referenced by ScriptBreak().

◆ get_table_entry()

static unsigned short get_table_entry ( const unsigned short table,
WCHAR  ch 
)
inlinestatic

Definition at line 238 of file usp10_internal.h.

239{
240 return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
241}

◆ Indic_ParseSyllables()

void Indic_ParseSyllables ( HDC  hdc,
SCRIPT_ANALYSIS psa,
ScriptCache psc,
const WCHAR input,
unsigned int  cChar,
IndicSyllable **  syllables,
int syllable_count,
lexical_function  lex,
BOOL  modern 
)

Definition at line 324 of file indic.c.

326{
327 unsigned int center = 0;
328 int index = 0;
329 int next = 0;
330
331 *syllable_count = 0;
332
333 if (!lex)
334 {
335 ERR("Failure to have required functions\n");
336 return;
337 }
338
339 debug_output_string(input, cChar, lex);
340 while (next != -1)
341 {
342 while((next < cChar) && lex(input[next]) == lex_Generic)
343 next++;
344 index = next;
345 if (next >= cChar)
346 break;
347 next = Indic_process_next_syllable(input, cChar, 0, &center, index, lex);
348 if (next != -1)
349 {
350 if (*syllable_count)
351 *syllables = HeapReAlloc(GetProcessHeap(),0,*syllables, sizeof(IndicSyllable)*(*syllable_count+1));
352 else
353 *syllables = heap_alloc(sizeof(**syllables));
354 (*syllables)[*syllable_count].start = index;
355 (*syllables)[*syllable_count].base = center;
356 (*syllables)[*syllable_count].ralf = -1;
357 (*syllables)[*syllable_count].blwf = -1;
358 (*syllables)[*syllable_count].pref = -1;
359 (*syllables)[*syllable_count].end = next-1;
360 FindBaseConsonant(hdc, psa, psc, input, &(*syllables)[*syllable_count], lex, modern);
361 index = next;
362 *syllable_count = (*syllable_count)+1;
363 }
364 else if (index < cChar)
365 {
366 TRACE("Processing failed at %i\n",index);
367 next = ++index;
368 }
369 }
370 TRACE("Processed %i of %i characters into %i syllables\n",index,cChar,*syllable_count);
371}
#define index(s, c)
Definition: various.h:29
#define ERR(fmt,...)
Definition: debug.h:110
#define GetProcessHeap()
Definition: compat.h:736
#define HeapReAlloc
Definition: compat.h:734
GLuint index
Definition: glext.h:6031
GLenum GLenum GLenum input
Definition: glext.h:9031
static int Indic_process_next_syllable(const WCHAR *input, unsigned int cChar, unsigned int start, unsigned int *main, unsigned int next, lexical_function lex)
Definition: indic.c:185
static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, IndicSyllable *s, lexical_function lex, BOOL modern)
Definition: indic.c:275
static void debug_output_string(const WCHAR *str, unsigned int char_count, lexical_function f)
Definition: indic.c:40
HDC hdc
Definition: main.c:9
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static SCRIPT_CACHE * psc
Definition: usp10.c:64

Referenced by Indic_ReorderCharacters(), and ShapeCharGlyphProp_BaseIndic().

◆ Indic_ReorderCharacters()

void Indic_ReorderCharacters ( HDC  hdc,
SCRIPT_ANALYSIS psa,
ScriptCache psc,
WCHAR input,
unsigned int  cChars,
IndicSyllable **  syllables,
int syllable_count,
lexical_function  lexical_f,
reorder_function  reorder_f,
BOOL  modern 
)

Definition at line 373 of file indic.c.

375{
376 int i;
377
378 if (!reorder_f)
379 {
380 ERR("Failure to have required functions\n");
381 return;
382 }
383
384 Indic_ParseSyllables(hdc, psa, psc, input, cChar, syllables, syllable_count, lex, modern);
385 for (i = 0; i < *syllable_count; i++)
386 reorder_f(input, &(*syllables)[i], lex);
387}
void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern)
Definition: indic.c:324

Referenced by ContextualShape_Bengali(), ContextualShape_Devanagari(), ContextualShape_Gujarati(), ContextualShape_Gurmukhi(), ContextualShape_Kannada(), ContextualShape_Khmer(), ContextualShape_Malayalam(), ContextualShape_Oriya(), ContextualShape_Sinhala(), ContextualShape_Tamil(), and ContextualShape_Telugu().

◆ is_consonant()

static BOOL is_consonant ( int  type)
inlinestatic

◆ OpenType_apply_GPOS_lookup()

unsigned int OpenType_apply_GPOS_lookup ( const ScriptCache psc,
const OUTLINETEXTMETRICW otm,
const LOGFONTW logfont,
const SCRIPT_ANALYSIS analysis,
int advance,
unsigned int  lookup_index,
const WORD glyphs,
unsigned int  glyph_index,
unsigned int  glyph_count,
GOFFSET goffset 
)

Definition at line 2557 of file opentype.c.

2560{
2561 const GPOS_Header *header = (const GPOS_Header *)script_cache->GPOS_Table;
2562 const OT_LookupList *lookup = (const OT_LookupList*)((const BYTE*)header + GET_BE_WORD(header->LookupList));
2563
2564 return GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup,
2565 lookup_index, glyphs, glyph_index, glyph_count, goffset);
2566}
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
static ULONG lookup[16]
Definition: vga.c:48
static UINT UINT LPWORD glyphs
Definition: font.c:44
static unsigned int GPOS_apply_lookup(const ScriptCache *script_cache, const OUTLINETEXTMETRICW *otm, const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, const OT_LookupList *lookup, unsigned int lookup_index, const WORD *glyphs, unsigned int glyph_index, unsigned int glyph_count, GOFFSET *goffset)
Definition: opentype.c:2382
#define GET_BE_WORD(x)
Definition: opentype.c:43
unsigned char BYTE
Definition: xxhash.c:193

Referenced by GPOS_apply_feature().

◆ OpenType_apply_GSUB_lookup()

int OpenType_apply_GSUB_lookup ( const void table,
unsigned int  lookup_index,
WORD glyphs,
unsigned int  glyph_index,
int  write_dir,
int glyph_count 
)

Definition at line 1540 of file opentype.c.

1542{
1543 const GSUB_Header *header = (const GSUB_Header *)table;
1544 const OT_LookupList *lookup = (const OT_LookupList*)((const BYTE*)header + GET_BE_WORD(header->LookupList));
1545
1546 return GSUB_apply_lookup(lookup, lookup_index, glyphs, glyph_index, write_dir, glyph_count);
1547}
static INT GSUB_apply_lookup(const OT_LookupList *lookup, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count)
Definition: opentype.c:1485

Referenced by apply_GSUB_feature(), and GSUB_apply_feature_all_lookups().

◆ OpenType_CMAP_GetGlyphIndex()

DWORD OpenType_CMAP_GetGlyphIndex ( HDC  hdc,
ScriptCache psc,
DWORD  utf32c,
LPWORD  pgi,
DWORD  flags 
)

◆ OpenType_GDEF_UpdateGlyphProps()

void OpenType_GDEF_UpdateGlyphProps ( ScriptCache psc,
const WORD pwGlyphs,
const WORD  cGlyphs,
WORD pwLogClust,
const WORD  cChars,
SCRIPT_GLYPHPROP pGlyphProp 
)

Definition at line 751 of file opentype.c.

752{
753 int i;
754 void *glyph_class_table = NULL;
755
756 if (psc->GDEF_Table)
757 {
758 const GDEF_Header *header = psc->GDEF_Table;
759 WORD offset = GET_BE_WORD( header->GlyphClassDef );
760 if (offset)
761 glyph_class_table = (BYTE *)psc->GDEF_Table + offset;
762 }
763
764 for (i = 0; i < cGlyphs; i++)
765 {
766 WORD class;
767 int char_count = 0;
768 int k;
769
771 if (k >= 0)
772 {
773 for (; k < cChars && pwLogClust[k] == i; k++)
774 char_count++;
775 }
776
777 class = OT_get_glyph_class( glyph_class_table, pwGlyphs[i] );
778
779 switch (class)
780 {
781 case 0:
782 case BaseGlyph:
783 pGlyphProp[i].sva.fClusterStart = 1;
784 pGlyphProp[i].sva.fDiacritic = 0;
785 pGlyphProp[i].sva.fZeroWidth = 0;
786 break;
787 case LigatureGlyph:
788 pGlyphProp[i].sva.fClusterStart = 1;
789 pGlyphProp[i].sva.fDiacritic = 0;
790 pGlyphProp[i].sva.fZeroWidth = 0;
791 break;
792 case MarkGlyph:
793 pGlyphProp[i].sva.fClusterStart = 0;
794 pGlyphProp[i].sva.fDiacritic = 1;
795 pGlyphProp[i].sva.fZeroWidth = 1;
796 break;
797 case ComponentGlyph:
798 pGlyphProp[i].sva.fClusterStart = 0;
799 pGlyphProp[i].sva.fDiacritic = 0;
800 pGlyphProp[i].sva.fZeroWidth = 0;
801 break;
802 default:
803 ERR("Unknown glyph class %i\n",class);
804 pGlyphProp[i].sva.fClusterStart = 1;
805 pGlyphProp[i].sva.fDiacritic = 0;
806 pGlyphProp[i].sva.fZeroWidth = 0;
807 }
808
809 if (char_count == 0)
810 pGlyphProp[i].sva.fClusterStart = 0;
811 }
812}
#define NULL
Definition: types.h:112
int USP10_FindGlyphInLogClust(const WORD *pwLogClust, int cChars, WORD target)
Definition: usp10.c:1044
GLintptr offset
Definition: glext.h:5920
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
int k
Definition: mpi.c:3369
@ LigatureGlyph
Definition: opentype.c:105
@ ComponentGlyph
Definition: opentype.c:105
@ BaseGlyph
Definition: opentype.c:105
@ MarkGlyph
Definition: opentype.c:105
static WORD OT_get_glyph_class(const void *table, WORD glyph)
Definition: opentype.c:714
SCRIPT_VISATTR sva
Definition: usp10.h:215
WORD fClusterStart
Definition: usp10.h:179
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799

Referenced by ShapeCharGlyphProp_Arabic(), ShapeCharGlyphProp_BaseIndic(), ShapeCharGlyphProp_Default(), ShapeCharGlyphProp_Hebrew(), ShapeCharGlyphProp_None(), ShapeCharGlyphProp_Thai(), and ShapeCharGlyphProp_Tibet().

◆ OpenType_GetFontFeatureTags()

HRESULT OpenType_GetFontFeatureTags ( ScriptCache psc,
OPENTYPE_TAG  script_tag,
OPENTYPE_TAG  language_tag,
BOOL  filtered,
OPENTYPE_TAG  searchingFor,
char  tableType,
int  cMaxTags,
OPENTYPE_TAG pFeatureTags,
int pcTags,
LoadedFeature **  feature 
)

Definition at line 2872 of file opentype.c.

2873{
2874 int i;
2875 LoadedLanguage *language;
2877 HRESULT rc = S_OK;
2878
2880 if (!(script = usp10_script_cache_get_script(psc, script_tag)))
2881 {
2882 *pcTags = 0;
2883 if (!filtered)
2884 return S_OK;
2885 else
2886 return E_INVALIDARG;
2887 }
2888
2890
2891 language = &script->default_language;
2892 if (language->tag != language_tag || (!language->table[USP10_LANGUAGE_TABLE_GSUB]
2893 && !language->table[USP10_LANGUAGE_TABLE_GPOS]))
2894 language = usp10_script_get_language(script, language_tag);
2895
2896 if (!language)
2897 {
2898 *pcTags = 0;
2899 return S_OK;
2900 }
2901
2902 _initialize_feature_cache(psc, language);
2903
2904 if (tableType)
2905 {
2906 *pcTags = 0;
2907 for (i = 0; i < language->feature_count; i++)
2908 if (language->features[i].tableType == tableType)
2909 *pcTags = (*pcTags)+1;
2910 }
2911 else
2912 *pcTags = language->feature_count;
2913
2914 if (!searchingFor && cMaxTags < *pcTags)
2915 rc = E_OUTOFMEMORY;
2916 else if (searchingFor)
2917 rc = E_INVALIDARG;
2918
2919 for (i = 0; i < language->feature_count; i++)
2920 {
2921 if (i < cMaxTags)
2922 {
2923 if (!tableType || language->features[i].tableType == tableType)
2924 pFeatureTags[i] = language->features[i].tag;
2925 }
2926
2927 if (searchingFor)
2928 {
2929 if ((searchingFor == language->features[i].tag) &&
2930 (!tableType || language->features[i].tableType == tableType))
2931 {
2932 pFeatureTags[0] = language->features[i].tag;
2933 *pcTags = 1;
2934 if (feature)
2935 *feature = &language->features[i];
2936 rc = S_OK;
2937 break;
2938 }
2939 }
2940 }
2941 return rc;
2942}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52
INTERNETFEATURELIST feature
Definition: misc.c:1719
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int OPENTYPE_TAG * pFeatureTags
Definition: usp10.c:68
static SCRIPT_CACHE SCRIPT_ANALYSIS int cMaxTags
Definition: usp10.c:66
static SCRIPT_CACHE SCRIPT_ANALYSIS int OPENTYPE_TAG int * pcTags
Definition: usp10.c:66
script
Definition: msipriv.h:383
static void _initialize_script_cache(ScriptCache *script_cache)
Definition: opentype.c:2628
static void _initialize_language_cache(LoadedScript *script)
Definition: opentype.c:2746
static LoadedScript * usp10_script_cache_get_script(ScriptCache *script_cache, OPENTYPE_TAG tag)
Definition: opentype.c:2585
static void _initialize_feature_cache(ScriptCache *psc, LoadedLanguage *language)
Definition: opentype.c:2847
static LoadedLanguage * usp10_script_get_language(LoadedScript *script, OPENTYPE_TAG tag)
Definition: opentype.c:2695
OPENTYPE_TAG tag
OPENTYPE_TAG tag
LoadedFeature * features
const void * table[USP10_LANGUAGE_TABLE_COUNT]

Referenced by load_OT_feature(), and SHAPE_GetFontFeatureTags().

◆ OpenType_GetFontLanguageTags()

HRESULT OpenType_GetFontLanguageTags ( ScriptCache psc,
OPENTYPE_TAG  script_tag,
OPENTYPE_TAG  searchingFor,
int  cMaxTags,
OPENTYPE_TAG pLanguageTags,
int pcTags 
)

Definition at line 2761 of file opentype.c.

2762{
2763 int i;
2764 HRESULT rc = S_OK;
2766
2768 if (!(script = usp10_script_cache_get_script(psc, script_tag)))
2769 return E_INVALIDARG;
2770
2772
2773 if (!searchingFor && cMaxTags < script->language_count)
2774 rc = E_OUTOFMEMORY;
2775 else if (searchingFor)
2776 rc = E_INVALIDARG;
2777
2778 *pcTags = script->language_count;
2779
2780 for (i = 0; i < script->language_count; i++)
2781 {
2782 if (i < cMaxTags)
2783 pLanguageTags[i] = script->languages[i].tag;
2784
2785 if (searchingFor)
2786 {
2787 if (searchingFor == script->languages[i].tag)
2788 {
2789 pLanguageTags[0] = script->languages[i].tag;
2790 *pcTags = 1;
2791 rc = S_OK;
2792 break;
2793 }
2794 }
2795 }
2796
2797 if (script->default_language.table[USP10_LANGUAGE_TABLE_GSUB])
2798 {
2799 if (i < cMaxTags)
2800 pLanguageTags[i] = script->default_language.tag;
2801
2802 if (searchingFor && FAILED(rc))
2803 {
2804 pLanguageTags[0] = script->default_language.tag;
2805 }
2806 i++;
2807 *pcTags = (*pcTags) + 1;
2808 }
2809
2810 return rc;
2811}
#define FAILED(hr)
Definition: intsafe.h:51

Referenced by SHAPE_GetFontLanguageTags().

◆ OpenType_GetFontScriptTags()

HRESULT OpenType_GetFontScriptTags ( ScriptCache psc,
OPENTYPE_TAG  searchingFor,
int  cMaxTags,
OPENTYPE_TAG pScriptTags,
int pcTags 
)

Definition at line 2647 of file opentype.c.

2648{
2649 int i;
2650 const LoadedScript *script;
2651 HRESULT rc = S_OK;
2652
2654
2655 *pcTags = psc->script_count;
2656
2657 if (searchingFor)
2658 {
2659 if (!(script = usp10_script_cache_get_script(psc, searchingFor)))
2661
2662 *pScriptTags = script->tag;
2663 *pcTags = 1;
2664 return S_OK;
2665 }
2666
2667 if (cMaxTags < *pcTags)
2668 rc = E_OUTOFMEMORY;
2669
2670 cMaxTags = min(cMaxTags, psc->script_count);
2671 for (i = 0; i < cMaxTags; ++i)
2672 {
2673 pScriptTags[i] = psc->scripts[i].tag;
2674 }
2675 return rc;
2676}
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM ULONG * pScriptTags
Definition: usp10.c:62
#define min(a, b)
Definition: monoChain.cc:55
#define USP_E_SCRIPT_NOT_IN_FONT
Definition: usp10.h:71

Referenced by get_GSUB_Indic2(), and SHAPE_GetFontScriptTags().

◆ SHAPE_ApplyDefaultOpentypeFeatures()

void SHAPE_ApplyDefaultOpentypeFeatures ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WORD pwOutGlyphs,
INT pcGlyphs,
INT  cMaxGlyphs,
INT  cChars,
WORD pwLogClust 
)

Definition at line 3421 of file shape.c.

3422{
3425
3427}
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD SCRIPT_CHARPROP WORD * pwOutGlyphs
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int cMaxGlyphs
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES ** rpRangeProperties
Definition: usp10.c:64
static void SHAPE_ApplyOpenTypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, INT cChars, const TEXTRANGE_PROPERTIES *rpRangeProperties, WORD *pwLogClust)
Definition: shape.c:3396
static const ScriptShapeData ShapingData[]
Definition: shape.c:458
TEXTRANGE_PROPERTIES defaultTextRange
Definition: shape.c:449

Referenced by ScriptShapeOpenType().

◆ SHAPE_ApplyOpenTypePositions()

void SHAPE_ApplyOpenTypePositions ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
const WORD pwGlyphs,
INT  cGlyphs,
int piAdvance,
GOFFSET pGoffset 
)

Definition at line 3429 of file shape.c.

3430{
3432 int i;
3433
3435
3436 if (!psc->GPOS_Table || !psc->otm)
3437 return;
3438
3439 for (i = 0; i < rpRangeProperties->cotfRecords; i++)
3440 {
3441 if (rpRangeProperties->potfRecords[i].lParameter > 0)
3442 {
3444
3445 feature = load_OT_feature(hdc, psa, psc, FEATURE_GPOS_TABLE, (const char*)&rpRangeProperties->potfRecords[i].tagFeature);
3446 if (!feature)
3447 continue;
3448
3449 GPOS_apply_feature(psc, psc->otm, &psc->lf, psa, piAdvance, feature, pwGlyphs, cGlyphs, pGoffset);
3450 }
3451 }
3452}
static void GPOS_apply_feature(const ScriptCache *psc, const OUTLINETEXTMETRICW *otm, const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, const LoadedFeature *feature, const WORD *glyphs, int glyph_count, GOFFSET *goffset)
Definition: shape.c:864
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:616
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:705
TEXTRANGE_PROPERTIES defaultGPOSTextRange
Definition: shape.c:450
#define FEATURE_GPOS_TABLE

Referenced by ScriptPlaceOpenType().

◆ SHAPE_CharGlyphProp()

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 
)

Definition at line 3378 of file shape.c.

3379{
3381
3382 if (ShapingData[psa->eScript].charGlyphPropProc)
3383 ShapingData[psa->eScript].charGlyphPropProc(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3384 else
3385 ShapeCharGlyphProp_Default(psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3386}
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void ShapeCharGlyphProp_Default(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)
Definition: shape.c:2903
ShapeCharGlyphPropProc charGlyphPropProc
Definition: shape.c:454

Referenced by ScriptShapeOpenType().

◆ SHAPE_CheckFontForRequiredFeatures()

HRESULT SHAPE_CheckFontForRequiredFeatures ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa 
)

Definition at line 3454 of file shape.c.

3455{
3457 int i;
3458
3459 if (!ShapingData[psa->eScript].requiredFeatures)
3460 return S_OK;
3461
3463
3464 /* we need to have at least one of the required features */
3465 i = 0;
3466 while (ShapingData[psa->eScript].requiredFeatures[i])
3467 {
3469 if (feature)
3470 return S_OK;
3471 i++;
3472 }
3473
3475}
const char *const * requiredFeatures
Definition: shape.c:451
#define FEATURE_ALL_TABLES

Referenced by requires_fallback(), and ScriptShapeOpenType().

◆ SHAPE_ContextualShaping()

void SHAPE_ContextualShaping ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WCHAR pwcChars,
INT  cChars,
WORD pwOutGlyphs,
INT pcGlyphs,
INT  cMaxGlyphs,
WORD pwLogClust 
)

Definition at line 3388 of file shape.c.

3389{
3391
3392 if (ShapingData[psa->eScript].contextProc)
3394}
ContextualShapingProc contextProc
Definition: shape.c:453

Referenced by ScriptShapeOpenType().

◆ SHAPE_does_GSUB_feature_apply_to_chars()

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 
)

◆ SHAPE_GetFontFeatureTags()

HRESULT SHAPE_GetFontFeatureTags ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
OPENTYPE_TAG  tagScript,
OPENTYPE_TAG  tagLangSys,
int  cMaxTags,
OPENTYPE_TAG pFeatureTags,
int pcTags 
)

Definition at line 3523 of file shape.c.

3527{
3528 HRESULT hr;
3529 BOOL filter = FALSE;
3530
3532
3533 if (psa && scriptInformation[psa->eScript].scriptTag)
3534 {
3535 FIXME("Filtering not implemented\n");
3536 filter = TRUE;
3537 }
3538
3540
3541 if (FAILED(hr))
3542 *pcTags = 0;
3543 return hr;
3544}
#define FIXME(fmt,...)
Definition: debug.h:111
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG tagScript
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG tagLangSys
Definition: usp10.c:64
HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, char tableType, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature **feature)
Definition: opentype.c:2872
scriptData scriptInformation[]
Definition: usp10.c:305
HRESULT hr
Definition: shlfolder.c:183
OPENTYPE_TAG scriptTag

Referenced by ScriptGetFontFeatureTags().

◆ SHAPE_GetFontLanguageTags()

HRESULT SHAPE_GetFontLanguageTags ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
OPENTYPE_TAG  tagScript,
int  cMaxTags,
OPENTYPE_TAG pLangSysTags,
int pcTags 
)

Definition at line 3495 of file shape.c.

3499{
3500 HRESULT hr;
3501 OPENTYPE_TAG searching = 0x00000000;
3502 BOOL fellback = FALSE;
3503
3505
3506 if (psa && psc->userLang != 0)
3507 searching = psc->userLang;
3508
3510 if (FAILED(hr))
3511 {
3512 fellback = TRUE;
3513 hr = OpenType_GetFontLanguageTags(psc, MS_MAKE_TAG('l','a','t','n'), searching, cMaxTags, pLangSysTags, pcTags);
3514 }
3515
3516 if (FAILED(hr) || fellback)
3517 *pcTags = 0;
3518 if (SUCCEEDED(hr) && fellback && psa)
3519 hr = E_INVALIDARG;
3520 return hr;
3521}
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
Definition: font.c:113
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG int OPENTYPE_TAG * pLangSysTags
Definition: usp10.c:67
HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags)
Definition: opentype.c:2761
ULONG OPENTYPE_TAG
Definition: usp10.h:205

Referenced by ScriptGetFontLanguageTags().

◆ SHAPE_GetFontScriptTags()

HRESULT SHAPE_GetFontScriptTags ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
int  cMaxTags,
OPENTYPE_TAG pScriptTags,
int pcTags 
)

Definition at line 3477 of file shape.c.

3480{
3481 HRESULT hr;
3482 OPENTYPE_TAG searching = 0x00000000;
3483
3485
3486 if (psa && scriptInformation[psa->eScript].scriptTag)
3487 searching = scriptInformation[psa->eScript].scriptTag;
3488
3490 if (FAILED(hr))
3491 *pcTags = 0;
3492 return hr;
3493}
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
Definition: opentype.c:2647

Referenced by ScriptGetFontScriptTags().

◆ usp10_array_reserve()

BOOL usp10_array_reserve ( void **  elements,
SIZE_T capacity,
SIZE_T  count,
SIZE_T  size 
)

Definition at line 730 of file usp10.c.

731{
732 SIZE_T max_capacity, new_capacity;
733 void *new_elements;
734
735 if (count <= *capacity)
736 return TRUE;
737
738 max_capacity = ~(SIZE_T)0 / size;
739 if (count > max_capacity)
740 return FALSE;
741
742 new_capacity = max(1, *capacity);
743 while (new_capacity < count && new_capacity <= max_capacity / 2)
744 new_capacity *= 2;
745 if (new_capacity < count)
746 new_capacity = count;
747
748 if (!*elements)
749 new_elements = heap_alloc_zero(new_capacity * size);
750 else
751 new_elements = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *elements, new_capacity * size);
752 if (!new_elements)
753 return FALSE;
754
755 *elements = new_elements;
756 *capacity = new_capacity;
757 return TRUE;
758}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLsizeiptr size
Definition: glext.h:5919
#define max(a, b)
Definition: svc.c:63
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by computeBracketPairs(), usp10_language_add_feature_list(), usp10_script_add_language(), and usp10_script_cache_add_script().

◆ USP10_FindGlyphInLogClust()

int USP10_FindGlyphInLogClust ( const WORD pwLogClust,
int  cChars,
WORD  target 
)

Definition at line 1044 of file usp10.c.

1045{
1046 FindGlyph_struct fgs;
1047 WORD *ptr;
1048 INT k;
1049
1050 if (pwLogClust[0] < pwLogClust[cChars-1])
1051 fgs.ascending = TRUE;
1052 else
1053 fgs.ascending = FALSE;
1054
1055 fgs.target = target;
1056 ptr = bsearch(&fgs, pwLogClust, cChars, sizeof(WORD), compare_FindGlyph);
1057
1058 if (!ptr)
1059 return -1;
1060
1061 for (k = (ptr - pwLogClust)-1; k >= 0 && pwLogClust[k] == target; k--)
1062 ;
1063 k++;
1064
1065 return k;
1066}
static int __cdecl compare_FindGlyph(const void *a, const void *b)
Definition: usp10.c:1028
GLenum target
Definition: glext.h:7315
static PVOID ptr
Definition: dispmode.c:27
BOOL ascending
Definition: usp10.c:726
#define bsearch
int32_t INT
Definition: typedefs.h:58

Referenced by does_glyph_start_cluster(), OpenType_GDEF_UpdateGlyphProps(), ShapeCharGlyphProp_Arabic(), ShapeCharGlyphProp_BaseIndic(), ShapeCharGlyphProp_Default(), ShapeCharGlyphProp_Hebrew(), ShapeCharGlyphProp_None(), ShapeCharGlyphProp_Thai(), ShapeCharGlyphProp_Tibet(), and UpdateClusters().