ReactOS 0.4.17-dev-966-gf06eace
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_16 (const unsigned short *table, WCHAR ch)
 
static unsigned short get_table_entry_32 (const unsigned short *table, UINT ch)
 
BOOL usp10_array_reserve (void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
 
int USP10_FindGlyphInLogClust (const WORD *pwLogClust, int cChars, WORD target)
 
BOOL BIDI_DetermineLevels (const WCHAR *string, unsigned int count, const SCRIPT_STATE *s, const SCRIPT_CONTROL *c, WORD *levels, WORD *overrides)
 
BOOL BIDI_GetStrengths (const WCHAR *string, unsigned int count, const SCRIPT_CONTROL *c, WORD *strength)
 
INT BIDI_ReorderV2lLevel (int level, int *pIndices, const BYTE *plevel, int cch, BOOL fReverse)
 
INT BIDI_ReorderL2vLevel (int level, int *pIndices, const BYTE *plevel, int cch, BOOL fReverse)
 
HRESULT SHAPE_ContextualShaping (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
void SHAPE_ApplyDefaultOpentypeFeatures (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, INT cChars, WORD *pwLogClust)
 
void SHAPE_ApplyOpenTypePositions (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WORD *glyphs, INT cGlyphs, int *piAdvance, GOFFSET *goffset)
 
HRESULT SHAPE_CheckFontForRequiredFeatures (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa)
 
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)
 
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)
 
HRESULT SHAPE_GetFontScriptTags (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
 
HRESULT SHAPE_GetFontLanguageTags (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, int cMaxTags, OPENTYPE_TAG *pLangSysTags, int *pcTags)
 
HRESULT SHAPE_GetFontFeatureTags (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags)
 
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)
 
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)
 
void BREAK_line (const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la)
 
DWORD OpenType_CMAP_GetGlyphIndex (HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags)
 
void OpenType_GDEF_UpdateGlyphProps (ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD *pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp)
 
int OpenType_apply_GSUB_lookup (const void *table, unsigned int lookup_index, WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count)
 
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)
 
HRESULT OpenType_GetFontScriptTags (ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
 
HRESULT OpenType_GetFontLanguageTags (ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags)
 
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)
 

Macro Definition Documentation

◆ BIDI_NEUTRAL

#define BIDI_NEUTRAL   0

Definition at line 254 of file usp10_internal.h.

◆ BIDI_STRONG

#define BIDI_STRONG   1

Definition at line 252 of file usp10_internal.h.

◆ BIDI_WEAK

#define BIDI_WEAK   2

Definition at line 253 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 251 of file usp10_internal.h.

Typedef Documentation

◆ lexical_function

typedef int(* lexical_function) (WCHAR c)

Definition at line 248 of file usp10_internal.h.

◆ reorder_function

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

Definition at line 249 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 1087 of file bidi.c.

1095{
1096 WORD *chartype;
1097 unsigned baselevel = 0;
1098 struct list IsolatingRuns;
1099 IsolatedRun *iso_run, *next;
1100
1101 TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount);
1102
1103 if (!(chartype = malloc(uCount * sizeof(*chartype))))
1104 {
1105 WARN("Out of memory\n");
1106 return FALSE;
1107 }
1108
1109 baselevel = s->uBidiLevel;
1110
1111 classify(lpString, chartype, uCount, c);
1112 if (TRACE_ON(bidi)) dump_types("Start ", chartype, 0, uCount);
1113
1114 memset(lpOutOverrides, 0, sizeof(WORD) * uCount);
1115
1116 /* resolve explicit */
1117 resolveExplicit(baselevel, chartype, lpOutLevels, lpOutOverrides, uCount, s->fOverrideDirection);
1118 if (TRACE_ON(bidi)) dump_types("After Explicit", chartype, 0, uCount);
1119
1120 /* X10/BD13: Computer Isolating runs */
1121 computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, lpString, uCount, &IsolatingRuns);
1122
1123 LIST_FOR_EACH_ENTRY_SAFE(iso_run, next, &IsolatingRuns, IsolatedRun, entry)
1124 {
1125 if (TRACE_ON(bidi)) iso_dump_types("Run", iso_run);
1126
1127 /* resolve weak */
1128 resolveWeak(iso_run);
1129 if (TRACE_ON(bidi)) iso_dump_types("After Weak", iso_run);
1130
1131 /* resolve neutrals */
1132 resolveNeutrals(iso_run);
1133 if (TRACE_ON(bidi)) iso_dump_types("After Neutrals", iso_run);
1134
1135 list_remove(&iso_run->entry);
1136 free(iso_run);
1137 }
1138
1139 if (TRACE_ON(bidi)) dump_types("Before Implicit", chartype, 0, uCount);
1140 /* resolveImplicit */
1141 resolveImplicit(chartype, lpOutLevels, 0, uCount-1);
1142
1143 /* resolveResolvedLevels*/
1144 classify(lpString, chartype, uCount, c);
1145 resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1);
1146
1147 free(chartype);
1148 return TRUE;
1149}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define WARN(fmt,...)
Definition: precomp.h:61
Definition: list.h:39
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#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:242
#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:890
static void iso_dump_types(const char *header, IsolatedRun *iso_run)
Definition: bidi.c:474
static void resolveWeak(IsolatedRun *iso_run)
Definition: bidi.c:505
static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, const WORD *pLevel, const WCHAR *string, unsigned int uCount, struct list *set)
Definition: bidi.c:948
static void resolveResolved(unsigned baselevel, const WORD *pcls, WORD *plevel, int sos, int eos)
Definition: bidi.c:912
static void dump_types(const char *header, WORD *types, int start, int end)
Definition: bidi.c:145
static void resolveExplicit(int level, WORD *pclass, WORD *poutLevel, WORD *poutOverrides, int count, BOOL initialOverride)
Definition: bidi.c:226
static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c)
Definition: bidi.c:160
static void resolveNeutrals(IsolatedRun *iso_run)
Definition: bidi.c:733

Referenced by _ItemizeInternal().

◆ BIDI_GetStrengths()

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

Definition at line 1248 of file bidi.c.

1249{
1250 unsigned int i;
1251
1252 classify(string, strength, count, c);
1253 for (i = 0; i < count; i++)
1254 {
1255 switch (strength[i])
1256 {
1257 case L:
1258 case LRE:
1259 case LRO:
1260 case R:
1261 case AL:
1262 case RLE:
1263 case RLO:
1264 strength[i] = BIDI_STRONG;
1265 break;
1266 case PDF:
1267 case EN:
1268 case ES:
1269 case ET:
1270 case AN:
1271 case CS:
1272 case BN:
1273 strength[i] = BIDI_WEAK;
1274 break;
1275 case B:
1276 case S:
1277 case WS:
1278 case ON:
1279 default: /* Neutrals and NSM */
1280 strength[i] = BIDI_NEUTRAL;
1281 }
1282 }
1283 return TRUE;
1284}
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
#define BIDI_NEUTRAL
#define BIDI_STRONG
#define BIDI_WEAK
@ LRO
Definition: bidi.c:103
@ WS
Definition: bidi.c:97
@ EN
Definition: bidi.c:85
@ R
Definition: bidi.c:83
@ LRE
Definition: bidi.c:104
@ RLE
Definition: bidi.c:102
@ B
Definition: bidi.c:98
@ ET
Definition: bidi.c:90
@ AN
Definition: bidi.c:84
@ ES
Definition: bidi.c:89
@ PDF
Definition: bidi.c:105
@ RLO
Definition: bidi.c:101
@ CS
Definition: bidi.c:88
@ ON
Definition: bidi.c:81
@ AL
Definition: bidi.c:86
@ BN
Definition: bidi.c:93
@ L
Definition: bidi.c:82
@ S
Definition: bidi.c:96

Referenced by _ItemizeInternal().

◆ BIDI_ReorderL2vLevel()

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

Definition at line 1214 of file bidi.c.

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

Referenced by BIDI_ReorderL2vLevel(), and ScriptLayout().

◆ BIDI_ReorderV2lLevel()

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

Definition at line 1187 of file bidi.c.

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

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 76 of file breaking.c.

77{
78 int i,j;
79 short *break_class;
80 short *break_before;
81
82 TRACE("In %s\n",debugstr_wn(chars,count));
83
84 break_class = malloc(count * sizeof(*break_class));
85 break_before = malloc(count * sizeof(*break_before));
86
87 for (i = 0; i < count; i++)
88 {
89 break_class[i] = get_table_entry_32( wine_linebreak_table, chars[i] );
90 break_before[i] = 0;
91
92 memset(&la[i],0,sizeof(SCRIPT_LOGATTR));
93
94 la[i].fCharStop = TRUE;
95 switch (break_class[i])
96 {
97 case b_BK:
98 case b_ZW:
99 case b_SP:
100 la[i].fWhiteSpace = TRUE;
101 break;
102 case b_CM:
103 la[i].fCharStop = FALSE;
104 break;
105 }
106 }
107
108 /* LB1 */
109 /* TODO: Have outside algorithms for these scripts */
110 for (i = 0; i < count; i++)
111 {
112 switch(break_class[i])
113 {
114 case b_AI:
115 case b_SA:
116 case b_SG:
117 case b_XX:
118 break_class[i] = b_AL;
119 break;
120 case b_CJ:
121 break_class[i] = b_NS;
122 break;
123 }
124 }
125
126 /* LB2 - LB3 */
127 break_before[0] = b_x;
128 for (i = 0; i < count; i++)
129 {
130 switch(break_class[i])
131 {
132 /* LB4 - LB6 */
133 case b_CR:
134 if (i < count-1 && break_class[i+1] == b_LF)
135 {
136 else_break(&break_before[i],b_x);
137 else_break(&break_before[i+1],b_x);
138 break;
139 }
140 case b_LF:
141 case b_NL:
142 case b_BK:
143 if (i < count-1) else_break(&break_before[i+1],b_r);
144 else_break(&break_before[i],b_x);
145 break;
146 /* LB7 */
147 case b_SP:
148 else_break(&break_before[i],b_x);
149 break;
150 case b_ZW:
151 else_break(&break_before[i],b_x);
152 /* LB8 */
153 while (i < count-1 && break_class[i+1] == b_SP)
154 i++;
155 else_break(&break_before[i],b_s);
156 break;
157 }
158 }
159
160 debug_output_breaks(break_before,count);
161
162 /* LB9 - LB10 */
163 for (i = 0; i < count; i++)
164 {
165 if (break_class[i] == b_CM)
166 {
167 if (i > 0)
168 {
169 switch (break_class[i-1])
170 {
171 case b_SP:
172 case b_BK:
173 case b_CR:
174 case b_LF:
175 case b_NL:
176 case b_ZW:
177 break_class[i] = b_AL;
178 break;
179 default:
180 break_class[i] = break_class[i-1];
181 }
182 }
183 else break_class[i] = b_AL;
184 }
185 }
186
187 for (i = 0; i < count; i++)
188 {
189 switch(break_class[i])
190 {
191 /* LB11 */
192 case b_WJ:
193 else_break(&break_before[i],b_x);
194 if (i < count-1)
195 else_break(&break_before[i+1],b_x);
196 break;
197 /* LB12 */
198 case b_GL:
199 if (i < count-1)
200 else_break(&break_before[i+1],b_x);
201 /* LB12a */
202 if (i > 0)
203 {
204 if (break_class[i-1] != b_SP &&
205 break_class[i-1] != b_BA &&
206 break_class[i-1] != b_HY &&
207 break_class[i-1] != b_HH)
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_HH:
291 case b_NS:
292 else_break(&break_before[i],b_x);
293 break;
294 case b_BB:
295 if (i < count-1)
296 else_break(&break_before[i+1],b_x);
297 break;
298 /* LB21a */
299 case b_HL:
300 if (i < count-2)
301 switch (break_class[i+1])
302 {
303 case b_HY:
304 case b_HH:
305 case b_BA:
306 else_break(&break_before[i+2], b_x);
307 }
308 break;
309 /* LB22 */
310 case b_IN:
311 if (i > 0)
312 {
313 switch (break_class[i-1])
314 {
315 case b_AL:
316 case b_HL:
317 case b_ID:
318 case b_IN:
319 case b_NU:
320 else_break(&break_before[i], b_x);
321 }
322 }
323 break;
324 }
325
326 if (i < count-1)
327 {
328 /* LB23 */
329 if ((break_class[i] == b_ID && break_class[i+1] == b_PO) ||
330 (break_class[i] == b_AL && break_class[i+1] == b_NU) ||
331 (break_class[i] == b_HL && break_class[i+1] == b_NU) ||
332 (break_class[i] == b_NU && break_class[i+1] == b_AL) ||
333 (break_class[i] == b_NU && break_class[i+1] == b_HL))
334 else_break(&break_before[i+1],b_x);
335 /* LB24 */
336 if ((break_class[i] == b_PR && break_class[i+1] == b_ID) ||
337 (break_class[i] == b_PR && break_class[i+1] == b_AL) ||
338 (break_class[i] == b_PR && break_class[i+1] == b_HL) ||
339 (break_class[i] == b_PO && break_class[i+1] == b_AL) ||
340 (break_class[i] == b_PO && break_class[i+1] == b_HL))
341 else_break(&break_before[i+1],b_x);
342
343 /* LB25 */
344 if ((break_class[i] == b_CL && break_class[i+1] == b_PO) ||
345 (break_class[i] == b_CP && break_class[i+1] == b_PO) ||
346 (break_class[i] == b_CL && break_class[i+1] == b_PR) ||
347 (break_class[i] == b_CP && break_class[i+1] == b_PR) ||
348 (break_class[i] == b_NU && break_class[i+1] == b_PO) ||
349 (break_class[i] == b_NU && break_class[i+1] == b_PR) ||
350 (break_class[i] == b_PO && break_class[i+1] == b_OP) ||
351 (break_class[i] == b_PO && break_class[i+1] == b_NU) ||
352 (break_class[i] == b_PR && break_class[i+1] == b_OP) ||
353 (break_class[i] == b_PR && break_class[i+1] == b_NU) ||
354 (break_class[i] == b_HY && break_class[i+1] == b_NU) ||
355 (break_class[i] == b_IS && break_class[i+1] == b_NU) ||
356 (break_class[i] == b_NU && break_class[i+1] == b_NU) ||
357 (break_class[i] == b_SY && break_class[i+1] == b_NU))
358 else_break(&break_before[i+1],b_x);
359
360 /* LB26 */
361 if (break_class[i] == b_JL)
362 {
363 switch (break_class[i+1])
364 {
365 case b_JL:
366 case b_JV:
367 case b_H2:
368 case b_H3:
369 else_break(&break_before[i+1],b_x);
370 }
371 }
372 if ((break_class[i] == b_JV || break_class[i] == b_H2) &&
373 (break_class[i+1] == b_JV || break_class[i+1] == b_JT))
374 else_break(&break_before[i+1],b_x);
375 if ((break_class[i] == b_JT || break_class[i] == b_H3) &&
376 break_class[i+1] == b_JT)
377 else_break(&break_before[i+1],b_x);
378
379 /* LB27 */
380 switch (break_class[i])
381 {
382 case b_JL:
383 case b_JV:
384 case b_JT:
385 case b_H2:
386 case b_H3:
387 if (break_class[i+1] == b_IN || break_class[i+1] == b_PO)
388 else_break(&break_before[i+1],b_x);
389 }
390 if (break_class[i] == b_PR)
391 {
392 switch (break_class[i+1])
393 {
394 case b_JL:
395 case b_JV:
396 case b_JT:
397 case b_H2:
398 case b_H3:
399 else_break(&break_before[i+1],b_x);
400 }
401 }
402
403 /* LB28 */
404 if ((break_class[i] == b_AL && break_class[i+1] == b_AL) ||
405 (break_class[i] == b_AL && break_class[i+1] == b_HL) ||
406 (break_class[i] == b_HL && break_class[i+1] == b_AL) ||
407 (break_class[i] == b_HL && break_class[i+1] == b_HL))
408 else_break(&break_before[i+1],b_x);
409
410 /* LB29 */
411 if ((break_class[i] == b_IS && break_class[i+1] == b_AL) ||
412 (break_class[i] == b_IS && break_class[i+1] == b_HL))
413 else_break(&break_before[i+1],b_x);
414
415 /* LB30 */
416 if ((break_class[i] == b_AL || break_class[i] == b_HL || break_class[i] == b_NU) &&
417 break_class[i+1] == b_OP)
418 else_break(&break_before[i+1],b_x);
419 if (break_class[i] == b_CP &&
420 (break_class[i+1] == b_AL || break_class[i+1] == b_HL || break_class[i+1] == b_NU))
421 else_break(&break_before[i+1],b_x);
422
423 /* LB30a */
424 if (break_class[i] == b_RI && break_class[i+1] == b_RI)
425 else_break(&break_before[i+1],b_x);
426 }
427 }
428 debug_output_breaks(break_before,count);
429
430 /* LB31 */
431 for (i = 0; i < count-1; i++)
432 else_break(&break_before[i+1],b_s);
433
434 debug_output_breaks(break_before,count);
435 for (i = 0; i < count; i++)
436 {
437 if (break_before[i] != b_x)
438 {
439 la[i].fSoftBreak = TRUE;
440 la[i].fWordStop = TRUE;
441 }
442 }
443
444 free(break_before);
445 free(break_class);
446}
static void else_break(short *before, short class)
Definition: breaking.c:71
static void debug_output_breaks(const short *breaks, int count)
Definition: breaking.c:49
@ b_s
Definition: breaking.c:47
@ b_r
Definition: breaking.c:47
@ b_x
Definition: breaking.c:47
const unsigned short wine_linebreak_table[]
Definition: linebreak.c:7
@ b_H2
Definition: breaking.c:42
@ b_IS
Definition: breaking.c:43
@ b_JL
Definition: breaking.c:42
@ b_CB
Definition: breaking.c:42
@ b_OP
Definition: breaking.c:42
@ b_CJ
Definition: breaking.c:44
@ b_ID
Definition: breaking.c:43
@ b_QU
Definition: breaking.c:43
@ b_HY
Definition: breaking.c:43
@ b_SY
Definition: breaking.c:43
@ b_NL
Definition: breaking.c:42
@ b_WJ
Definition: breaking.c:42
@ b_EX
Definition: breaking.c:43
@ b_BB
Definition: breaking.c:43
@ b_XX
Definition: breaking.c:42
@ b_HL
Definition: breaking.c:43
@ b_PO
Definition: breaking.c:43
@ b_ZW
Definition: breaking.c:42
@ b_JT
Definition: breaking.c:42
@ b_LF
Definition: breaking.c:42
@ b_CL
Definition: breaking.c:42
@ b_GL
Definition: breaking.c:42
@ b_HH
Definition: breaking.c:44
@ b_PR
Definition: breaking.c:43
@ b_CM
Definition: breaking.c:42
@ b_RI
Definition: breaking.c:44
@ b_BA
Definition: breaking.c:43
@ b_JV
Definition: breaking.c:42
@ b_BK
Definition: breaking.c:42
@ b_CP
Definition: breaking.c:43
@ b_CR
Definition: breaking.c:42
@ b_AI
Definition: breaking.c:43
@ b_NU
Definition: breaking.c:43
@ b_SA
Definition: breaking.c:43
@ b_H3
Definition: breaking.c:42
@ b_SG
Definition: breaking.c:42
@ b_AL
Definition: breaking.c:43
@ b_NS
Definition: breaking.c:43
@ b_SP
Definition: breaking.c:42
@ b_B2
Definition: breaking.c:43
@ b_IN
Definition: breaking.c:43
static unsigned short get_table_entry_32(const unsigned short *table, UINT ch)
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
BYTE fWhiteSpace
Definition: usp10.h:188

Referenced by ScriptBreak().

◆ get_table_entry_16()

static unsigned short get_table_entry_16 ( 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}
unsigned char ch[4][2]
Definition: console.c:118

◆ get_table_entry_32()

static unsigned short get_table_entry_32 ( const unsigned short *  table,
UINT  ch 
)
inlinestatic

Definition at line 243 of file usp10_internal.h.

244{
245 return table[table[table[table[ch >> 12] + ((ch >> 8) & 0x0f)] + ((ch >> 4) & 0x0f)] + (ch & 0xf)];
246}

◆ 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 323 of file indic.c.

325{
326 unsigned int center = 0;
327 int index = 0;
328 int next = 0;
329
330 *syllable_count = 0;
331
332 if (!lex)
333 {
334 ERR("Failure to have required functions\n");
335 return;
336 }
337
338 debug_output_string(input, cChar, lex);
339 while (next != -1)
340 {
341 while((next < cChar) && lex(input[next]) == lex_Generic)
342 next++;
343 index = next;
344 if (next >= cChar)
345 break;
346 next = Indic_process_next_syllable(input, cChar, 0, &center, index, lex);
347 if (next != -1)
348 {
349 *syllables = realloc(*syllables, sizeof(IndicSyllable)*(*syllable_count+1));
350 (*syllables)[*syllable_count].start = index;
351 (*syllables)[*syllable_count].base = center;
352 (*syllables)[*syllable_count].ralf = -1;
353 (*syllables)[*syllable_count].blwf = -1;
354 (*syllables)[*syllable_count].pref = -1;
355 (*syllables)[*syllable_count].end = next-1;
356 FindBaseConsonant(hdc, psa, psc, input, &(*syllables)[*syllable_count], lex, modern);
357 index = next;
358 *syllable_count = (*syllable_count)+1;
359 }
360 else if (index < cChar)
361 {
362 TRACE("Processing failed at %i\n",index);
363 next = ++index;
364 }
365 }
366 TRACE("Processed %i of %i characters into %i syllables\n",index,cChar,*syllable_count);
367}
#define index(s, c)
Definition: various.h:29
#define ERR(fmt,...)
Definition: precomp.h:57
#define realloc
Definition: debug_ros.c:6
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:184
static int FindBaseConsonant(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, IndicSyllable *s, lexical_function lex, BOOL modern)
Definition: indic.c:274
static void debug_output_string(const WCHAR *str, unsigned int char_count, lexical_function f)
Definition: indic.c:39
HDC hdc
Definition: main.c:9

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 369 of file indic.c.

371{
372 int i;
373
374 if (!reorder_f)
375 {
376 ERR("Failure to have required functions\n");
377 return;
378 }
379
380 Indic_ParseSyllables(hdc, psa, psc, input, cChar, syllables, syllable_count, lex, modern);
381 for (i = 0; i < *syllable_count; i++)
382 reorder_f(input, &(*syllables)[i], lex);
383}
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:323

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 2599 of file opentype.c.

2602{
2603 const GPOS_Header *header = (const GPOS_Header *)script_cache->GPOS_Table;
2604 const OT_LookupList *lookup = (const OT_LookupList*)((const BYTE*)header + GET_BE_WORD(header->LookupList));
2605
2606 return GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup,
2607 lookup_index, glyphs, glyph_index, glyph_count, goffset);
2608}
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
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:2405
#define GET_BE_WORD(x)
Definition: opentype.c:47
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 1544 of file opentype.c.

1546{
1547 const GSUB_Header *header = (const GSUB_Header *)table;
1548 const OT_LookupList *lookup = (const OT_LookupList*)((const BYTE*)header + GET_BE_WORD(header->LookupList));
1549
1550 return GSUB_apply_lookup(lookup, lookup_index, glyphs, glyph_index, write_dir, glyph_count);
1551}
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:1489

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 755 of file opentype.c.

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

2915{
2916 int i;
2917 LoadedLanguage *language;
2919 HRESULT rc = S_OK;
2920
2922 if (!(script = usp10_script_cache_get_script(psc, script_tag)))
2923 {
2924 *pcTags = 0;
2925 if (!filtered)
2926 return S_OK;
2927 else
2928 return E_INVALIDARG;
2929 }
2930
2932
2933 language = &script->default_language;
2934 if (language->tag != language_tag || (!language->table[USP10_LANGUAGE_TABLE_GSUB]
2935 && !language->table[USP10_LANGUAGE_TABLE_GPOS]))
2936 language = usp10_script_get_language(script, language_tag);
2937
2938 if (!language)
2939 {
2940 *pcTags = 0;
2941 return S_OK;
2942 }
2943
2944 _initialize_feature_cache(psc, language);
2945
2946 if (tableType)
2947 {
2948 *pcTags = 0;
2949 for (i = 0; i < language->feature_count; i++)
2950 if (language->features[i].tableType == tableType)
2951 *pcTags = (*pcTags)+1;
2952 }
2953 else
2954 *pcTags = language->feature_count;
2955
2956 if (!searchingFor && cMaxTags < *pcTags)
2957 rc = E_OUTOFMEMORY;
2958 else if (searchingFor)
2959 rc = E_INVALIDARG;
2960
2961 for (i = 0; i < language->feature_count; i++)
2962 {
2963 if (i < cMaxTags)
2964 {
2965 if (!tableType || language->features[i].tableType == tableType)
2966 pFeatureTags[i] = language->features[i].tag;
2967 }
2968
2969 if (searchingFor)
2970 {
2971 if ((searchingFor == language->features[i].tag) &&
2972 (!tableType || language->features[i].tableType == tableType))
2973 {
2974 pFeatureTags[0] = language->features[i].tag;
2975 *pcTags = 1;
2976 if (feature)
2977 *feature = &language->features[i];
2978 rc = S_OK;
2979 break;
2980 }
2981 }
2982 }
2983 return rc;
2984}
#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:1807
script
Definition: msipriv.h:396
OPENTYPE_TAG tag
OPENTYPE_TAG tag
LoadedFeature * features
const void * table[USP10_LANGUAGE_TABLE_COUNT]
static void _initialize_script_cache(ScriptCache *script_cache)
Definition: opentype.c:2670
static void _initialize_language_cache(LoadedScript *script)
Definition: opentype.c:2788
static LoadedScript * usp10_script_cache_get_script(ScriptCache *script_cache, OPENTYPE_TAG tag)
Definition: opentype.c:2627
static void _initialize_feature_cache(ScriptCache *psc, LoadedLanguage *language)
Definition: opentype.c:2889
static LoadedLanguage * usp10_script_get_language(LoadedScript *script, OPENTYPE_TAG tag)
Definition: opentype.c:2737

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 2803 of file opentype.c.

2804{
2805 int i;
2806 HRESULT rc = S_OK;
2808
2810 if (!(script = usp10_script_cache_get_script(psc, script_tag)))
2811 return E_INVALIDARG;
2812
2814
2815 if (!searchingFor && cMaxTags < script->language_count)
2816 rc = E_OUTOFMEMORY;
2817 else if (searchingFor)
2818 rc = E_INVALIDARG;
2819
2820 *pcTags = script->language_count;
2821
2822 for (i = 0; i < script->language_count; i++)
2823 {
2824 if (i < cMaxTags)
2825 pLanguageTags[i] = script->languages[i].tag;
2826
2827 if (searchingFor)
2828 {
2829 if (searchingFor == script->languages[i].tag)
2830 {
2831 pLanguageTags[0] = script->languages[i].tag;
2832 *pcTags = 1;
2833 rc = S_OK;
2834 break;
2835 }
2836 }
2837 }
2838
2839 if (script->default_language.table[USP10_LANGUAGE_TABLE_GSUB])
2840 {
2841 if (i < cMaxTags)
2842 pLanguageTags[i] = script->default_language.tag;
2843
2844 if (searchingFor && FAILED(rc))
2845 {
2846 pLanguageTags[0] = script->default_language.tag;
2847 }
2848 i++;
2849 *pcTags = (*pcTags) + 1;
2850 }
2851
2852 return rc;
2853}
#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 2689 of file opentype.c.

2690{
2691 int i;
2692 const LoadedScript *script;
2693 HRESULT rc = S_OK;
2694
2696
2697 *pcTags = psc->script_count;
2698
2699 if (searchingFor)
2700 {
2701 if (!(script = usp10_script_cache_get_script(psc, searchingFor)))
2703
2704 *pScriptTags = script->tag;
2705 *pcTags = 1;
2706 return S_OK;
2707 }
2708
2709 if (cMaxTags < *pcTags)
2710 rc = E_OUTOFMEMORY;
2711
2712 cMaxTags = min(cMaxTags, psc->script_count);
2713 for (i = 0; i < cMaxTags; ++i)
2714 {
2715 pScriptTags[i] = psc->scripts[i].tag;
2716 }
2717 return rc;
2718}
#define min(a, b)
Definition: monoChain.cc:55
OPENTYPE_TAG tag
SIZE_T script_count
LoadedScript * scripts
#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 3455 of file shape.c.

3456{
3457const TEXTRANGE_PROPERTIES *rpRangeProperties;
3458rpRangeProperties = &ShapingData[psa->eScript].defaultTextRange;
3459
3460 SHAPE_ApplyOpenTypeFeatures(hdc, psc, psa, pwOutGlyphs, pcGlyphs, cMaxGlyphs, cChars, rpRangeProperties, pwLogClust);
3461}
TEXTRANGE_PROPERTIES defaultTextRange
Definition: shape.c:457
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:3430
static const ScriptShapeData ShapingData[]
Definition: shape.c:466

Referenced by ScriptShapeOpenType().

◆ SHAPE_ApplyOpenTypePositions()

void SHAPE_ApplyOpenTypePositions ( HDC  hdc,
ScriptCache *  psc,
SCRIPT_ANALYSIS *  psa,
const WORD *  glyphs,
INT  cGlyphs,
int *  piAdvance,
GOFFSET *  goffset 
)

Definition at line 3463 of file shape.c.

3464{
3465 const TEXTRANGE_PROPERTIES *rpRangeProperties = &ShapingData[psa->eScript].defaultGPOSTextRange;
3466 int i;
3467
3468 load_ot_tables(hdc, psc);
3469
3470 if (!psc->GPOS_Table || !psc->otm)
3471 return;
3472
3473 for (i = 0; i < rpRangeProperties->cotfRecords; i++)
3474 {
3475 if (rpRangeProperties->potfRecords[i].lParameter > 0)
3476 {
3478
3479 feature = load_OT_feature(hdc, psa, psc, FEATURE_GPOS_TABLE, (const char*)&rpRangeProperties->potfRecords[i].tagFeature);
3480 if (!feature)
3481 continue;
3482
3483 GPOS_apply_feature(psc, psc->otm, &psc->lf, psa, piAdvance, feature, pwGlyphs, cGlyphs, pGoffset);
3484 }
3485 }
3486}
void * GPOS_Table
OUTLINETEXTMETRICW * otm
TEXTRANGE_PROPERTIES defaultGPOSTextRange
Definition: shape.c:458
OPENTYPE_TAG tagFeature
Definition: usp10.h:209
OPENTYPE_FEATURE_RECORD * potfRecords
Definition: usp10.h:227
#define FEATURE_GPOS_TABLE
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:872
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:624
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:713

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 3411 of file shape.c.

3412{
3413 load_ot_tables(hdc, psc);
3414
3416 ShapingData[psa->eScript].charGlyphPropProc(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3417 else
3418 ShapeCharGlyphProp_Default(psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3419}
ShapeCharGlyphPropProc charGlyphPropProc
Definition: shape.c:462
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:2937

Referenced by ScriptShapeOpenType().

◆ SHAPE_CheckFontForRequiredFeatures()

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

Definition at line 3488 of file shape.c.

3489{
3491 int i;
3492
3494 return S_OK;
3495
3496 load_ot_tables(hdc, psc);
3497
3498 /* we need to have at least one of the required features */
3499 i = 0;
3500 while (ShapingData[psa->eScript].requiredFeatures[i])
3501 {
3503 if (feature)
3504 return S_OK;
3505 i++;
3506 }
3507
3509}
const char *const * requiredFeatures
Definition: shape.c:459
#define FEATURE_ALL_TABLES

Referenced by requires_fallback(), and ScriptShapeOpenType().

◆ SHAPE_ContextualShaping()

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

Definition at line 3421 of file shape.c.

3422{
3423 load_ot_tables(hdc, psc);
3424
3426 return ShapingData[psa->eScript].contextProc(hdc, psc, psa, pwcChars, cChars, pwOutGlyphs, pcGlyphs, cMaxGlyphs, pwLogClust);
3427 return S_OK;
3428}
ContextualShapingProc contextProc
Definition: shape.c:461

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 3557 of file shape.c.

3561{
3562 HRESULT hr;
3563 BOOL filter = FALSE;
3564
3565 load_ot_tables(hdc, psc);
3566
3567 if (psa && scriptInformation[psa->eScript].scriptTag)
3568 {
3569 FIXME("Filtering not implemented\n");
3570 filter = TRUE;
3571 }
3572
3573 hr = OpenType_GetFontFeatureTags(psc, tagScript, tagLangSys, filter, 0x00000000, FEATURE_ALL_TABLES, cMaxTags, pFeatureTags, pcTags, NULL);
3574
3575 if (FAILED(hr))
3576 *pcTags = 0;
3577 return hr;
3578}
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT hr
Definition: delayimp.cpp:582
unsigned int BOOL
Definition: ntddk_ex.h:94
OPENTYPE_TAG scriptTag
Definition: filter.c:165
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:2914
scriptData scriptInformation[]
Definition: usp10.c:312

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 3529 of file shape.c.

3533{
3534 HRESULT hr;
3535 OPENTYPE_TAG searching = 0x00000000;
3536 BOOL fellback = FALSE;
3537
3538 load_ot_tables(hdc, psc);
3539
3540 if (psa && psc->userLang != 0)
3541 searching = psc->userLang;
3542
3543 hr = OpenType_GetFontLanguageTags(psc, tagScript, searching, cMaxTags, pLangSysTags, pcTags);
3544 if (FAILED(hr))
3545 {
3546 fellback = TRUE;
3547 hr = OpenType_GetFontLanguageTags(psc, MS_MAKE_TAG('l','a','t','n'), searching, cMaxTags, pLangSysTags, pcTags);
3548 }
3549
3550 if (FAILED(hr) || fellback)
3551 *pcTags = 0;
3552 if (SUCCEEDED(hr) && fellback && psa)
3553 hr = E_INVALIDARG;
3554 return hr;
3555}
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
Definition: font.c:112
#define SUCCEEDED(hr)
Definition: intsafe.h:50
OPENTYPE_TAG userLang
ULONG OPENTYPE_TAG
Definition: usp10.h:205
HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags)
Definition: opentype.c:2803

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 3511 of file shape.c.

3514{
3515 HRESULT hr;
3516 OPENTYPE_TAG searching = 0x00000000;
3517
3518 load_ot_tables(hdc, psc);
3519
3520 if (psa && scriptInformation[psa->eScript].scriptTag)
3521 searching = scriptInformation[psa->eScript].scriptTag;
3522
3523 hr = OpenType_GetFontScriptTags(psc, searching, cMaxTags, pScriptTags, pcTags);
3524 if (FAILED(hr))
3525 *pcTags = 0;
3526 return hr;
3527}
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
Definition: opentype.c:2689

Referenced by ScriptGetFontScriptTags().

◆ usp10_array_reserve()

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

Definition at line 655 of file usp10.c.

656{
657 SIZE_T max_capacity, new_capacity;
658 void *new_elements;
659
660 if (count <= *capacity)
661 return TRUE;
662
663 max_capacity = ~(SIZE_T)0 / size;
664 if (count > max_capacity)
665 return FALSE;
666
667 new_capacity = max(1, *capacity);
668 while (new_capacity < count && new_capacity <= max_capacity / 2)
669 new_capacity *= 2;
670 if (new_capacity < count)
671 new_capacity = count;
672
673 new_elements = realloc(*elements, new_capacity * size);
674 if (!new_elements)
675 return FALSE;
676 memset( (char *)new_elements + *capacity * size, 0, (new_capacity - *capacity) * size );
677
678 *elements = new_elements;
679 *capacity = new_capacity;
680 return TRUE;
681}
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 967 of file usp10.c.

968{
970 WORD *ptr;
971 INT k;
972
973 if (pwLogClust[0] < pwLogClust[cChars-1])
974 fgs.ascending = TRUE;
975 else
976 fgs.ascending = FALSE;
977
978 fgs.target = target;
979 ptr = bsearch(&fgs, pwLogClust, cChars, sizeof(WORD), compare_FindGlyph);
980
981 if (!ptr)
982 return -1;
983
984 for (k = (ptr - pwLogClust)-1; k >= 0 && pwLogClust[k] == target; k--)
985 ;
986 k++;
987
988 return k;
989}
static int __cdecl compare_FindGlyph(const void *a, const void *b)
Definition: usp10.c:951
static PVOID ptr
Definition: dispmode.c:27
BOOL ascending
Definition: usp10.c:651
Definition: tools.h:99
#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().