ReactOS  0.4.15-dev-448-gd6c4411
shape.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "usp10.h"
#include "winternl.h"
#include "usp10_internal.h"
#include "wine/debug.h"
#include "wine/heap.h"
Include dependency graph for shape.c:

Go to the source code of this file.

Classes

struct  tagVowelComponents
 
struct  tagConsonantComponents
 
struct  ScriptShapeDataTag
 

Macros

#define FIRST_ARABIC_CHAR   0x0600
 
#define LAST_ARABIC_CHAR   0x06ff
 
#define ALAPH   0x710
 
#define DALATH   0x715
 
#define RISH   0x72A
 
#define phags_pa_CANDRABINDU   0xA873
 
#define phags_pa_START   0xA840
 
#define phags_pa_END   0xA87F
 

Typedefs

typedef VOID(* ContextualShapingProc) (HDC, ScriptCache *, SCRIPT_ANALYSIS *, WCHAR *, INT, WORD *, INT *, INT, WORD *)
 
typedef VOID(* ShapeCharGlyphPropProc) (HDC, ScriptCache *, SCRIPT_ANALYSIS *, const WCHAR *, const INT, const WORD *, const INT, WORD *, SCRIPT_CHARPROP *, SCRIPT_GLYPHPROP *)
 
typedef struct tagVowelComponents VowelComponents
 
typedef struct tagConsonantComponents ConsonantComponents
 
typedef void(* second_reorder_function) (const WCHAR *chars, const IndicSyllable *syllable, WORD *glyphs, const IndicSyllable *glyph_index, lexical_function lex)
 
typedef int(* combining_lexical_function) (WCHAR c)
 
typedef struct ScriptShapeDataTag ScriptShapeData
 

Enumerations

enum  joining_types {
  jtU, jtT, jtR, jtL,
  jtD, jtC
}
 
enum  joined_forms {
  Xn =0, Xr, Xl, Xm,
  Afj, Afn, Afx
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (uniscribe)
 
static void ContextualShape_Control (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Arabic (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Hebrew (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Syriac (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Thaana (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Phags_pa (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Thai (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Lao (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Sinhala (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Devanagari (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Bengali (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Gurmukhi (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Gujarati (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Oriya (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Tamil (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Telugu (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Kannada (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Malayalam (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Khmer (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static void ContextualShape_Mongolian (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
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)
 
static void ShapeCharGlyphProp_Control (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)
 
static void ShapeCharGlyphProp_Latin (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)
 
static void ShapeCharGlyphProp_Arabic (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)
 
static void ShapeCharGlyphProp_Hebrew (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)
 
static void ShapeCharGlyphProp_Thai (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)
 
static void ShapeCharGlyphProp_None (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)
 
static void ShapeCharGlyphProp_Tibet (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)
 
static void ShapeCharGlyphProp_Sinhala (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)
 
static void ShapeCharGlyphProp_Devanagari (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)
 
static void ShapeCharGlyphProp_Bengali (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)
 
static void ShapeCharGlyphProp_Gurmukhi (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)
 
static void ShapeCharGlyphProp_Gujarati (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)
 
static void ShapeCharGlyphProp_Oriya (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)
 
static void ShapeCharGlyphProp_Tamil (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)
 
static void ShapeCharGlyphProp_Telugu (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)
 
static void ShapeCharGlyphProp_Kannada (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)
 
static void ShapeCharGlyphProp_Malayalam (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)
 
static void ShapeCharGlyphProp_Khmer (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)
 
static int GSUB_apply_feature_all_lookups (const void *header, LoadedFeature *feature, WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count)
 
static OPENTYPE_TAG get_opentype_script (HDC hdc, const SCRIPT_ANALYSIS *psa, const ScriptCache *script_cache, BOOL try_new)
 
static LoadedFeatureload_OT_feature (HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
 
static INT apply_GSUB_feature_to_glyph (HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
 
static VOIDload_gsub_table (HDC hdc)
 
static VOIDload_gpos_table (HDC hdc)
 
static VOIDload_gdef_table (HDC hdc)
 
static VOID load_ot_tables (HDC hdc, ScriptCache *psc)
 
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)
 
static void UpdateClustersFromGlyphProp (const int cGlyphs, const int cChars, WORD *pwLogClust, SCRIPT_GLYPHPROP *pGlyphProp)
 
static void UpdateClusters (int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
 
static int apply_GSUB_feature (HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *pwOutGlyphs, int write_dir, INT *pcGlyphs, INT cChars, const char *feat, WORD *pwLogClust)
 
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)
 
static BOOL get_GSUB_Indic2 (SCRIPT_ANALYSIS *psa, ScriptCache *psc)
 
static void insert_glyph (WORD *pwGlyphs, INT *pcGlyphs, INT cChars, INT write_dir, WORD glyph, INT index, WORD *pwLogClust)
 
static void mark_invalid_combinations (HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
 
static WCHAR neighbour_char (int i, int delta, const WCHAR *chars, INT cchLen)
 
static CHAR neighbour_joining_type (int i, int delta, const CHAR *context_type, INT cchLen, SCRIPT_ANALYSIS *psa)
 
static BOOL right_join_causing (CHAR joining_type)
 
static BOOL left_join_causing (CHAR joining_type)
 
static BOOL word_break_causing (WCHAR chr)
 
static int combining_lexical_Arabic (WCHAR c)
 
static int combining_lexical_Hebrew (WCHAR c)
 
static int combining_lexical_Syriac (WCHAR c)
 
static int combining_lexical_Thaana (WCHAR c)
 
static int combining_lexical_Thai (WCHAR c)
 
static int combining_lexical_Lao (WCHAR c)
 
static void ReplaceInsertChars (HDC hdc, INT cWalk, INT *pcChars, WCHAR *pwOutChars, const WCHAR *replacements)
 
static void DecomposeVowels (HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
 
static void ComposeConsonants (HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
 
static void Reorder_Ra_follows_base (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Ra_follows_matra (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Ra_follows_syllable (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Matra_precede_base (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Matra_precede_syllable (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void SecondReorder_Blwf_follows_matra (const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
 
static void SecondReorder_Matra_precede_base (const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
 
static void SecondReorder_Pref_precede_base (const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
 
static void Reorder_Like_Sinhala (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Like_Devanagari (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Like_Bengali (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void Reorder_Like_Kannada (WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
 
static void SecondReorder_Like_Telugu (const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
 
static void SecondReorder_Like_Tamil (const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
 
static void shift_syllable_glyph_indexs (IndicSyllable *glyph_index, INT index, INT shift)
 
static void Apply_Indic_BasicForm (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllable, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, IndicSyllable *glyph_index, LoadedFeature *feature)
 
static INT find_consonant_halant (WCHAR *pwChars, INT index, INT end, lexical_function lexical)
 
static void Apply_Indic_PreBase (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllable, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, IndicSyllable *glyph_index, const char *feature)
 
static void Apply_Indic_Rphf (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllable, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, IndicSyllable *glyph_index)
 
static INT find_halant_consonant (WCHAR *pwChars, INT index, INT end, lexical_function lexical)
 
static void Apply_Indic_PostBase (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllable, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, IndicSyllable *glyph_index, BOOL modern, const char *feat)
 
static void ShapeIndicSyllables (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
 
static int unicode_lex (WCHAR c)
 
static int sinhala_lex (WCHAR c)
 
static int devanagari_lex (WCHAR c)
 
static int bengali_lex (WCHAR c)
 
static int gurmukhi_lex (WCHAR c)
 
static int gujarati_lex (WCHAR c)
 
static int oriya_lex (WCHAR c)
 
static int tamil_lex (WCHAR c)
 
static int telugu_lex (WCHAR c)
 
static int kannada_lex (WCHAR c)
 
static int malayalam_lex (WCHAR c)
 
static int khmer_lex (WCHAR c)
 
static BOOL mongolian_wordbreak (WCHAR chr)
 
static void ShapeCharGlyphProp_BaseIndic (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, lexical_function lexical, BOOL use_syllables, BOOL override_gsub)
 
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)
 
void SHAPE_ContextualShaping (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
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)
 
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 *pwGlyphs, INT cGlyphs, int *piAdvance, GOFFSET *pGoffset)
 
HRESULT SHAPE_CheckFontForRequiredFeatures (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa)
 
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)
 

Variables

const unsigned short indic_syllabic_table [] DECLSPEC_HIDDEN
 
static const char *const contextual_features []
 
static OPENTYPE_FEATURE_RECORD standard_features []
 
static OPENTYPE_FEATURE_RECORD latin_features []
 
static OPENTYPE_FEATURE_RECORD latin_gpos_features []
 
static OPENTYPE_FEATURE_RECORD arabic_features []
 
static const char *const required_arabic_features []
 
static OPENTYPE_FEATURE_RECORD arabic_gpos_features []
 
static OPENTYPE_FEATURE_RECORD hebrew_features []
 
static OPENTYPE_FEATURE_RECORD hebrew_gpos_features []
 
static OPENTYPE_FEATURE_RECORD syriac_features []
 
static const char *const required_syriac_features []
 
static OPENTYPE_FEATURE_RECORD syriac_gpos_features []
 
static OPENTYPE_FEATURE_RECORD sinhala_features []
 
static OPENTYPE_FEATURE_RECORD tibetan_features []
 
static OPENTYPE_FEATURE_RECORD tibetan_gpos_features []
 
static OPENTYPE_FEATURE_RECORD phags_features []
 
static OPENTYPE_FEATURE_RECORD thai_features []
 
static OPENTYPE_FEATURE_RECORD thai_gpos_features []
 
static const char *const required_lao_features []
 
static const char *const required_devanagari_features []
 
static OPENTYPE_FEATURE_RECORD devanagari_features []
 
static OPENTYPE_FEATURE_RECORD devanagari_gpos_features []
 
static OPENTYPE_FEATURE_RECORD myanmar_features []
 
static const char *const required_bengali_features []
 
static const char *const required_gurmukhi_features []
 
static const char *const required_oriya_features []
 
static const char *const required_tamil_features []
 
static const char *const required_telugu_features []
 
static OPENTYPE_FEATURE_RECORD khmer_features []
 
static const char *const required_khmer_features []
 
static OPENTYPE_FEATURE_RECORD khmer_gpos_features []
 
static OPENTYPE_FEATURE_RECORD ethiopic_features []
 
static OPENTYPE_FEATURE_RECORD mongolian_features []
 
static const ScriptShapeData ShapingData []
 
scriptData scriptInformation []
 
static const VowelComponents Sinhala_vowels []
 
static const ConsonantComponents Devanagari_consonants []
 
static const VowelComponents Bengali_vowels []
 
static const ConsonantComponents Bengali_consonants []
 
static const ConsonantComponents Gurmukhi_consonants []
 
static const VowelComponents Oriya_vowels []
 
static const ConsonantComponents Oriya_consonants []
 
static const VowelComponents Tamil_vowels []
 
static const ConsonantComponents Tamil_consonants []
 
static const VowelComponents Telugu_vowels []
 
static const VowelComponents Kannada_vowels []
 
static const VowelComponents Malayalam_vowels []
 

Macro Definition Documentation

◆ ALAPH

#define ALAPH   0x710

Definition at line 1305 of file shape.c.

◆ DALATH

#define DALATH   0x715

Definition at line 1306 of file shape.c.

◆ FIRST_ARABIC_CHAR

#define FIRST_ARABIC_CHAR   0x0600

Definition at line 39 of file shape.c.

◆ LAST_ARABIC_CHAR

#define LAST_ARABIC_CHAR   0x06ff

Definition at line 40 of file shape.c.

◆ phags_pa_CANDRABINDU

#define phags_pa_CANDRABINDU   0xA873

Definition at line 1468 of file shape.c.

◆ phags_pa_END

#define phags_pa_END   0xA87F

Definition at line 1470 of file shape.c.

◆ phags_pa_START

#define phags_pa_START   0xA840

Definition at line 1469 of file shape.c.

◆ RISH

#define RISH   0x72A

Definition at line 1307 of file shape.c.

Typedef Documentation

◆ combining_lexical_function

typedef int(* combining_lexical_function) (WCHAR c)

Definition at line 127 of file shape.c.

◆ ConsonantComponents

◆ ContextualShapingProc

typedef VOID(* ContextualShapingProc) (HDC, ScriptCache *, SCRIPT_ANALYSIS *, WCHAR *, INT, WORD *, INT *, INT, WORD *)

Definition at line 42 of file shape.c.

◆ ScriptShapeData

◆ second_reorder_function

typedef void(* second_reorder_function) (const WCHAR *chars, const IndicSyllable *syllable, WORD *glyphs, const IndicSyllable *glyph_index, lexical_function lex)

Definition at line 124 of file shape.c.

◆ ShapeCharGlyphPropProc

typedef VOID(* ShapeCharGlyphPropProc) (HDC, ScriptCache *, SCRIPT_ANALYSIS *, const WCHAR *, const INT, const WORD *, const INT, WORD *, SCRIPT_CHARPROP *, SCRIPT_GLYPHPROP *)

Definition at line 66 of file shape.c.

◆ VowelComponents

Enumeration Type Documentation

◆ joined_forms

Enumerator
Xn 
Xr 
Xl 
Xm 
Afj 
Afn 
Afx 

Definition at line 101 of file shape.c.

101  {
102  Xn=0,
103  Xr,
104  Xl,
105  Xm,
106  /* Syriac Alaph */
107  Afj,
108  Afn,
109  Afx
110 };
Definition: shape.c:105
Definition: shape.c:102
Definition: shape.c:103
Definition: shape.c:109
Definition: shape.c:108
Definition: shape.c:107
Definition: shape.c:104

◆ joining_types

Enumerator
jtU 
jtT 
jtR 
jtL 
jtD 
jtC 

Definition at line 92 of file shape.c.

92  {
93  jtU,
94  jtT,
95  jtR,
96  jtL,
97  jtD,
98  jtC
99 };
Definition: shape.c:97
Definition: shape.c:93
Definition: shape.c:95
Definition: shape.c:96
Definition: shape.c:98
Definition: shape.c:94

Function Documentation

◆ apply_GSUB_feature()

static int apply_GSUB_feature ( HDC  hdc,
SCRIPT_ANALYSIS psa,
ScriptCache psc,
WORD pwOutGlyphs,
int  write_dir,
INT pcGlyphs,
INT  cChars,
const char feat,
WORD pwLogClust 
)
static

Definition at line 823 of file shape.c.

824 {
825  if (psc->GSUB_Table)
826  {
828  int lookup_index;
829 
831  if (!feature)
832  return GSUB_E_NOFEATURE;
833 
834  TRACE("applying feature %s: %i lookups\n",debugstr_an(feat,4),feature->lookup_count);
835  for (lookup_index = 0; lookup_index < feature->lookup_count; lookup_index++)
836  {
837  int i;
838 
839  if (write_dir > 0)
840  i = 0;
841  else
842  i = *pcGlyphs-1;
843  TRACE("applying lookup (%i/%i)\n",lookup_index,feature->lookup_count);
844  while(i < *pcGlyphs && i >= 0)
845  {
846  INT nextIndex;
847  INT prevCount = *pcGlyphs;
848 
849  nextIndex = OpenType_apply_GSUB_lookup(psc->GSUB_Table, feature->lookups[lookup_index], pwOutGlyphs, i, write_dir, pcGlyphs);
850  if (*pcGlyphs != prevCount)
851  {
852  UpdateClusters(nextIndex, *pcGlyphs - prevCount, write_dir, cChars, pwLogClust);
853  i = nextIndex;
854  }
855  else
856  i+=write_dir;
857  }
858  }
859  return *pcGlyphs;
860  }
861  return GSUB_E_NOFEATURE;
862 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
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: opentype.c:1540
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
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:616
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
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
#define GSUB_E_NOFEATURE
HDC hdc
Definition: main.c:9
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:47
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 * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
#define FEATURE_GSUB_TABLE

Referenced by SHAPE_ApplyOpenTypeFeatures().

◆ apply_GSUB_feature_to_glyph()

static INT apply_GSUB_feature_to_glyph ( HDC  hdc,
SCRIPT_ANALYSIS psa,
ScriptCache psc,
WORD glyphs,
INT  index,
INT  write_dir,
INT glyph_count,
const char feat 
)
static

Definition at line 654 of file shape.c.

655 {
657 
659  if (!feature)
660  return GSUB_E_NOFEATURE;
661 
662  TRACE("applying feature %s\n",feat);
663  return GSUB_apply_feature_all_lookups(psc->GSUB_Table, feature, glyphs, index, write_dir, glyph_count);
664 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
static UINT UINT LPWORD glyphs
Definition: font.c:44
GLuint index
Definition: glext.h:6031
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:616
#define TRACE(s)
Definition: solgame.cpp:4
#define GSUB_E_NOFEATURE
HDC hdc
Definition: main.c:9
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static int GSUB_apply_feature_all_lookups(const void *header, LoadedFeature *feature, WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count)
Definition: shape.c:546
#define FEATURE_GSUB_TABLE

Referenced by Apply_Indic_PostBase(), Apply_Indic_PreBase(), Apply_Indic_Rphf(), ContextualShape_Arabic(), ContextualShape_Bengali(), ContextualShape_Mongolian(), ContextualShape_Phags_pa(), ContextualShape_Syriac(), and SHAPE_does_GSUB_feature_apply_to_chars().

◆ Apply_Indic_BasicForm()

static void Apply_Indic_BasicForm ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WCHAR pwChars,
INT  cChars,
IndicSyllable syllable,
WORD pwOutGlyphs,
INT pcGlyphs,
WORD pwLogClust,
lexical_function  lexical,
IndicSyllable glyph_index,
LoadedFeature feature 
)
static

Definition at line 1993 of file shape.c.

1994 {
1995  int index = glyph_index->start;
1996 
1997  if (!feature)
1998  return;
1999 
2001  {
2002  INT nextIndex;
2003  INT prevCount = *pcGlyphs;
2004  nextIndex = GSUB_apply_feature_all_lookups(psc->GSUB_Table, feature, pwOutGlyphs, index, 1, pcGlyphs);
2005  if (nextIndex > GSUB_E_NOGLYPH)
2006  {
2007  UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2008  shift_syllable_glyph_indexs(glyph_index,index,*pcGlyphs - prevCount);
2009  index = nextIndex;
2010  }
2011  else
2012  index++;
2013  }
2014 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
static void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1974
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
GLuint GLuint end
Definition: gl.h:1545
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
GLuint index
Definition: glext.h:6031
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 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
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static int GSUB_apply_feature_all_lookups(const void *header, LoadedFeature *feature, WORD *glyphs, unsigned int glyph_index, int write_dir, int *glyph_count)
Definition: shape.c:546

Referenced by ShapeIndicSyllables().

◆ Apply_Indic_PostBase()

static void Apply_Indic_PostBase ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WCHAR pwChars,
INT  cChars,
IndicSyllable syllable,
WORD pwOutGlyphs,
INT pcGlyphs,
WORD pwLogClust,
lexical_function  lexical,
IndicSyllable glyph_index,
BOOL  modern,
const char feat 
)
static

Definition at line 2081 of file shape.c.

2082 {
2083  INT index, nextIndex;
2084  INT count, g_offset=0;
2085  INT ralf = syllable->ralf;
2086 
2087  count = syllable->end - syllable->base;
2088 
2089  index = find_halant_consonant(&pwChars[syllable->base], 0, count, lexical);
2090 
2091  while (index >= 0)
2092  {
2093  INT prevCount = *pcGlyphs;
2094  if (ralf >=0 && ralf < index)
2095  {
2096  g_offset--;
2097  ralf = -1;
2098  }
2099 
2100  if (!modern)
2101  {
2102  WORD g = pwOutGlyphs[index+glyph_index->base+g_offset];
2103  pwOutGlyphs[index+glyph_index->base+g_offset] = pwOutGlyphs[index+glyph_index->base+g_offset+1];
2104  pwOutGlyphs[index+glyph_index->base+g_offset+1] = g;
2105  }
2106 
2107  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, index+glyph_index->base+g_offset, 1, pcGlyphs, feat);
2108  if (nextIndex > GSUB_E_NOGLYPH)
2109  {
2110  UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2111  shift_syllable_glyph_indexs(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount));
2112  g_offset += (*pcGlyphs - prevCount);
2113  }
2114  else if (!modern)
2115  {
2116  WORD g = pwOutGlyphs[index+glyph_index->base+g_offset];
2117  pwOutGlyphs[index+glyph_index->base+g_offset] = pwOutGlyphs[index+glyph_index->base+g_offset+1];
2118  pwOutGlyphs[index+glyph_index->base+g_offset+1] = g;
2119  }
2120 
2121  index+=2;
2122  index = find_halant_consonant(&pwChars[syllable->base], index, count, lexical);
2123  }
2124 }
static void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1974
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
GLuint GLuint GLsizei count
Definition: gl.h:1545
static INT find_halant_consonant(WCHAR *pwChars, INT index, INT end, lexical_function lexical)
Definition: shape.c:2068
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
GLuint index
Definition: glext.h:6031
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
GLboolean GLboolean g
Definition: glext.h:6204
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
unsigned short WORD
Definition: ntddk_ex.h:93
#define index(s, c)
Definition: various.h:29
HDC hdc
Definition: main.c:9
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
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64

Referenced by ShapeIndicSyllables().

◆ Apply_Indic_PreBase()

static void Apply_Indic_PreBase ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WCHAR pwChars,
INT  cChars,
IndicSyllable syllable,
WORD pwOutGlyphs,
INT pcGlyphs,
WORD pwLogClust,
lexical_function  lexical,
IndicSyllable glyph_index,
const char feature 
)
static

Definition at line 2027 of file shape.c.

2028 {
2029  INT index, nextIndex;
2030  INT count,g_offset;
2031 
2032  count = syllable->base - syllable->start;
2033 
2034  g_offset = 0;
2035  index = find_consonant_halant(&pwChars[syllable->start], 0, count, lexical);
2036  while (index >= 0 && index + g_offset < (glyph_index->base - glyph_index->start))
2037  {
2038  INT prevCount = *pcGlyphs;
2039  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, index+glyph_index->start+g_offset, 1, pcGlyphs, feature);
2040  if (nextIndex > GSUB_E_NOGLYPH)
2041  {
2042  UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2043  shift_syllable_glyph_indexs(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount));
2044  g_offset += (*pcGlyphs - prevCount);
2045  }
2046 
2047  index+=2;
2048  index = find_consonant_halant(&pwChars[syllable->start], index, count, lexical);
2049  }
2050 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
static void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1974
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
GLuint GLuint GLsizei count
Definition: gl.h:1545
static INT find_consonant_halant(WCHAR *pwChars, INT index, INT end, lexical_function lexical)
Definition: shape.c:2016
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
GLuint index
Definition: glext.h:6031
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
#define index(s, c)
Definition: various.h:29
HDC hdc
Definition: main.c:9
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
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64

Referenced by ShapeIndicSyllables().

◆ Apply_Indic_Rphf()

static void Apply_Indic_Rphf ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
WCHAR pwChars,
INT  cChars,
IndicSyllable syllable,
WORD pwOutGlyphs,
INT pcGlyphs,
WORD pwLogClust,
lexical_function  lexical,
IndicSyllable glyph_index 
)
static

Definition at line 2052 of file shape.c.

2053 {
2054  INT nextIndex;
2055  INT prevCount = *pcGlyphs;
2056 
2057  if (syllable->ralf >= 0)
2058  {
2059  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index->ralf, 1, pcGlyphs, "rphf");
2060  if (nextIndex > GSUB_E_NOGLYPH)
2061  {
2062  UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2063  shift_syllable_glyph_indexs(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount);
2064  }
2065  }
2066 }
static void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1974
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64

Referenced by ShapeIndicSyllables().

◆ bengali_lex()

static int bengali_lex ( WCHAR  c)
static

Definition at line 2382 of file shape.c.

2383 {
2384  switch (c)
2385  {
2386  case 0x09B0: return lex_Ra;
2387  default:
2388  return unicode_lex(c);
2389  }
2390 }
static int unicode_lex(WCHAR c)
Definition: shape.c:2208
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Bengali(), and ShapeCharGlyphProp_Bengali().

◆ combining_lexical_Arabic()

static int combining_lexical_Arabic ( WCHAR  c)
static

Definition at line 1007 of file shape.c.

1008 {
1009  enum {Arab_Norm = 0, Arab_DIAC1, Arab_DIAC2, Arab_DIAC3, Arab_DIAC4, Arab_DIAC5, Arab_DIAC6, Arab_DIAC7, Arab_DIAC8};
1010 
1011  switch(c)
1012  {
1013  case 0x064B:
1014  case 0x064C:
1015  case 0x064E:
1016  case 0x064F:
1017  case 0x0652:
1018  case 0x0657:
1019  case 0x0658:
1020  case 0x06E1: return Arab_DIAC1;
1021  case 0x064D:
1022  case 0x0650:
1023  case 0x0656: return Arab_DIAC2;
1024  case 0x0651: return Arab_DIAC3;
1025  case 0x0610:
1026  case 0x0611:
1027  case 0x0612:
1028  case 0x0613:
1029  case 0x0614:
1030  case 0x0659:
1031  case 0x06D6:
1032  case 0x06DC:
1033  case 0x06DF:
1034  case 0x06E0:
1035  case 0x06E2:
1036  case 0x06E4:
1037  case 0x06E7:
1038  case 0x06E8:
1039  case 0x06EB:
1040  case 0x06EC: return Arab_DIAC4;
1041  case 0x06E3:
1042  case 0x06EA:
1043  case 0x06ED: return Arab_DIAC5;
1044  case 0x0670: return Arab_DIAC6;
1045  case 0x0653: return Arab_DIAC7;
1046  case 0x0655:
1047  case 0x0654: return Arab_DIAC8;
1048  default: return Arab_Norm;
1049  }
1050 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Arabic().

◆ combining_lexical_Hebrew()

static int combining_lexical_Hebrew ( WCHAR  c)
static

Definition at line 1178 of file shape.c.

1179 {
1180  enum {Hebr_Norm=0, Hebr_DIAC, Hebr_CANT1, Hebr_CANT2, Hebr_CANT3, Hebr_CANT4, Hebr_CANT5, Hebr_CANT6, Hebr_CANT7, Hebr_CANT8, Hebr_CANT9, Hebr_CANT10, Hebr_DAGESH, Hebr_DOTABV, Hebr_HOLAM, Hebr_METEG, Hebr_PATAH, Hebr_QAMATS, Hebr_RAFE, Hebr_SHINSIN};
1181 
1182  switch(c)
1183  {
1184  case 0x05B0:
1185  case 0x05B1:
1186  case 0x05B2:
1187  case 0x05B3:
1188  case 0x05B4:
1189  case 0x05B5:
1190  case 0x05B6:
1191  case 0x05BB: return Hebr_DIAC;
1192  case 0x0599:
1193  case 0x05A1:
1194  case 0x05A9:
1195  case 0x05AE: return Hebr_CANT1;
1196  case 0x0597:
1197  case 0x05A8:
1198  case 0x05AC: return Hebr_CANT2;
1199  case 0x0592:
1200  case 0x0593:
1201  case 0x0594:
1202  case 0x0595:
1203  case 0x05A7:
1204  case 0x05AB: return Hebr_CANT3;
1205  case 0x0598:
1206  case 0x059C:
1207  case 0x059E:
1208  case 0x059F: return Hebr_CANT4;
1209  case 0x059D:
1210  case 0x05A0: return Hebr_CANT5;
1211  case 0x059B:
1212  case 0x05A5: return Hebr_CANT6;
1213  case 0x0591:
1214  case 0x05A3:
1215  case 0x05A6: return Hebr_CANT7;
1216  case 0x0596:
1217  case 0x05A4:
1218  case 0x05AA: return Hebr_CANT8;
1219  case 0x059A:
1220  case 0x05AD: return Hebr_CANT9;
1221  case 0x05AF: return Hebr_CANT10;
1222  case 0x05BC: return Hebr_DAGESH;
1223  case 0x05C4: return Hebr_DOTABV;
1224  case 0x05B9: return Hebr_HOLAM;
1225  case 0x05BD: return Hebr_METEG;
1226  case 0x05B7: return Hebr_PATAH;
1227  case 0x05B8: return Hebr_QAMATS;
1228  case 0x05BF: return Hebr_RAFE;
1229  case 0x05C1:
1230  case 0x05C2: return Hebr_SHINSIN;
1231  default: return Hebr_Norm;
1232  }
1233 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Hebrew().

◆ combining_lexical_Lao()

static int combining_lexical_Lao ( WCHAR  c)
static

Definition at line 1607 of file shape.c.

1608 {
1609  enum {Lao_Norm=0, Lao_ABOVE1, Lao_ABOVE2, Lao_BELOW1, Lao_BELOW2, Lao_AM};
1610 
1611  switch(c)
1612  {
1613  case 0xEB1:
1614  case 0xEB4:
1615  case 0xEB5:
1616  case 0xEB6:
1617  case 0xEB7:
1618  case 0xEBB:
1619  case 0xECD: return Lao_ABOVE1;
1620  case 0xEC8:
1621  case 0xEC9:
1622  case 0xECA:
1623  case 0xECB:
1624  case 0xECC: return Lao_ABOVE2;
1625  case 0xEBC: return Lao_BELOW1;
1626  case 0xEB8:
1627  case 0xEB9: return Lao_BELOW2;
1628  case 0xEB3: return Lao_AM;
1629  default: return Lao_Norm;
1630  }
1631 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Lao().

◆ combining_lexical_Syriac()

static int combining_lexical_Syriac ( WCHAR  c)
static

Definition at line 1257 of file shape.c.

1258 {
1259  enum {Syriac_Norm=0, Syriac_DIAC1, Syriac_DIAC2, Syriac_DIAC3, Syriac_DIAC4, Syriac_DIAC5, Syriac_DIAC6, Syriac_DIAC7, Syriac_DIAC8, Syriac_DIAC9, Syriac_DIAC10, Syriac_DIAC11, Syriac_DIAC12, Syriac_DIAC13, Syriac_DIAC14, Syriac_DIAC15, Syriac_DIAC16, Syriac_DIAC17};
1260 
1261  switch(c)
1262  {
1263  case 0x730:
1264  case 0x733:
1265  case 0x736:
1266  case 0x73A:
1267  case 0x73D: return Syriac_DIAC1;
1268  case 0x731:
1269  case 0x734:
1270  case 0x737:
1271  case 0x73B:
1272  case 0x73E: return Syriac_DIAC2;
1273  case 0x740:
1274  case 0x749:
1275  case 0x74A: return Syriac_DIAC3;
1276  case 0x732:
1277  case 0x735:
1278  case 0x73F: return Syriac_DIAC4;
1279  case 0x738:
1280  case 0x739:
1281  case 0x73C: return Syriac_DIAC5;
1282  case 0x741:
1283  case 0x30A: return Syriac_DIAC6;
1284  case 0x742:
1285  case 0x325: return Syriac_DIAC7;
1286  case 0x747:
1287  case 0x303: return Syriac_DIAC8;
1288  case 0x748:
1289  case 0x32D:
1290  case 0x32E:
1291  case 0x330:
1292  case 0x331: return Syriac_DIAC9;
1293  case 0x308: return Syriac_DIAC10;
1294  case 0x304: return Syriac_DIAC11;
1295  case 0x307: return Syriac_DIAC12;
1296  case 0x323: return Syriac_DIAC13;
1297  case 0x743: return Syriac_DIAC14;
1298  case 0x744: return Syriac_DIAC15;
1299  case 0x745: return Syriac_DIAC16;
1300  case 0x746: return Syriac_DIAC17;
1301  default: return Syriac_Norm;
1302  }
1303 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Syriac().

◆ combining_lexical_Thaana()

static int combining_lexical_Thaana ( WCHAR  c)
static

Definition at line 1426 of file shape.c.

1427 {
1428  enum {Thaana_Norm=0, Thaana_FILI};
1429 
1430  switch(c)
1431  {
1432  case 0x7A6:
1433  case 0x7A7:
1434  case 0x7A8:
1435  case 0x7A9:
1436  case 0x7AA:
1437  case 0x7AB:
1438  case 0x7AC:
1439  case 0x7AD:
1440  case 0x7AE:
1441  case 0x7AF: return Thaana_FILI;
1442  default: return Thaana_Norm;
1443  }
1444 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Thaana().

◆ combining_lexical_Thai()

static int combining_lexical_Thai ( WCHAR  c)
static

Definition at line 1562 of file shape.c.

1563 {
1564  enum {Thai_Norm=0, Thai_ABOVE1, Thai_ABOVE2, Thai_ABOVE3, Thai_ABOVE4, Thai_BELOW1, Thai_BELOW2, Thai_AM};
1565 
1566  switch(c)
1567  {
1568  case 0xE31:
1569  case 0xE34:
1570  case 0xE35:
1571  case 0xE36:
1572  case 0xE37: return Thai_ABOVE1;
1573  case 0xE47:
1574  case 0xE4D: return Thai_ABOVE2;
1575  case 0xE48:
1576  case 0xE49:
1577  case 0xE4A:
1578  case 0xE4B: return Thai_ABOVE3;
1579  case 0xE4C:
1580  case 0xE4E: return Thai_ABOVE4;
1581  case 0xE38:
1582  case 0xE39: return Thai_BELOW1;
1583  case 0xE3A: return Thai_BELOW2;
1584  case 0xE33: return Thai_AM;
1585  default: return Thai_Norm;
1586  }
1587 }
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Thai().

◆ ComposeConsonants()

static void ComposeConsonants ( HDC  hdc,
WCHAR pwOutChars,
INT pcChars,
const ConsonantComponents  consonants[],
WORD pwLogClust 
)
static

Definition at line 1693 of file shape.c.

1694 {
1695  int i;
1696  int offset = 0;
1697  int cWalk;
1698 
1699  for (cWalk = 0; cWalk < *pcChars; cWalk += 2)
1700  {
1701  for (i = 0; consonants[i].output!= 0x0; i++)
1702  {
1703  int j;
1704  for (j = 0; j + cWalk < *pcChars && consonants[i].parts[j]!=0x0; j++)
1705  if (pwOutChars[cWalk+j] != consonants[i].parts[j])
1706  break;
1707 
1708  if (consonants[i].parts[j]==0x0) /* matched all */
1709  {
1710  int k;
1711  j--;
1712  pwOutChars[cWalk] = consonants[i].output;
1713  for(k = cWalk+1; k < *pcChars - j; k++)
1714  pwOutChars[k] = pwOutChars[k+j];
1715  *pcChars = *pcChars - j;
1716  for (k = j ; k > 0; k--)
1717  pwLogClust[cWalk + k + offset] = pwLogClust[cWalk + offset];
1718  offset += j;
1719  for (k = cWalk + j + offset; k < *pcChars + offset; k++)
1720  pwLogClust[k]--;
1721  break;
1722  }
1723  }
1724  }
1725 }
GLint x0
Definition: linetemp.h:95
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
GLintptr offset
Definition: glext.h:5920
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
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
int k
Definition: mpi.c:3369

Referenced by ContextualShape_Bengali(), ContextualShape_Devanagari(), ContextualShape_Gurmukhi(), ContextualShape_Oriya(), and ContextualShape_Tamil().

◆ ContextualShape_Arabic()

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

Definition at line 1055 of file shape.c.

1056 {
1057  CHAR *context_type;
1058  INT *context_shape;
1059  INT dirR, dirL;
1060  int i;
1061  int char_index;
1062  int glyph_index;
1063 
1064  if (*pcGlyphs != cChars)
1065  {
1066  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1067  return;
1068  }
1069 
1070  if (psa->fLogicalOrder && psa->fRTL)
1071  {
1072  dirR = -1;
1073  dirL = 1;
1074  }
1075  else
1076  {
1077  dirR = 1;
1078  dirL = -1;
1079  }
1080 
1082 
1083  context_type = heap_alloc(cChars);
1084  context_shape = heap_alloc(cChars * sizeof(*context_shape));
1085 
1086  for (i = 0; i < cChars; i++)
1087  context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
1088 
1089  for (i = 0; i < cChars; i++)
1090  {
1091  if (context_type[i] == jtR && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1092  context_shape[i] = Xr;
1093  else if (context_type[i] == jtL && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1094  context_shape[i] = Xl;
1095  else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)) && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1096  context_shape[i] = Xm;
1097  else if (context_type[i] == jtD && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1098  context_shape[i] = Xr;
1099  else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1100  context_shape[i] = Xl;
1101  else
1102  context_shape[i] = Xn;
1103  }
1104 
1105  /* Contextual Shaping */
1106  if (dirL > 0)
1107  char_index = glyph_index = 0;
1108  else
1109  char_index = glyph_index = cChars-1;
1110 
1111  while(char_index < cChars && char_index >= 0)
1112  {
1113  BOOL shaped = FALSE;
1114 
1115  if (psc->GSUB_Table)
1116  {
1117  INT nextIndex, offset = 0;
1118  INT prevCount = *pcGlyphs;
1119 
1120  /* Apply CCMP first */
1121  apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, "ccmp");
1122 
1123  if (prevCount != *pcGlyphs)
1124  {
1125  offset = *pcGlyphs - prevCount;
1126  if (dirL < 0)
1127  glyph_index -= offset * dirL;
1128  }
1129 
1130  /* Apply the contextual feature */
1131  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1132 
1133  if (nextIndex > GSUB_E_NOGLYPH)
1134  {
1135  UpdateClusters(glyph_index, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1136  char_index += dirL;
1137  if (!offset)
1138  glyph_index = nextIndex;
1139  else
1140  {
1141  offset = *pcGlyphs - prevCount;
1142  glyph_index += dirL * (offset + 1);
1143  }
1144  shaped = TRUE;
1145  }
1146  else if (nextIndex == GSUB_E_NOGLYPH)
1147  {
1148  char_index += dirL;
1149  glyph_index += dirL;
1150  shaped = TRUE;
1151  }
1152  }
1153 
1154  if (!shaped)
1155  {
1156  if (context_shape[char_index] == Xn)
1157  {
1158  WORD newGlyph = pwOutGlyphs[glyph_index];
1159  if (pwcChars[char_index] >= FIRST_ARABIC_CHAR && pwcChars[char_index] <= LAST_ARABIC_CHAR)
1160  {
1161  /* fall back to presentation form B */
1162  WCHAR context_char = wine_shaping_forms[pwcChars[char_index] - FIRST_ARABIC_CHAR][context_shape[char_index]];
1163  if (context_char != pwcChars[char_index] && GetGlyphIndicesW(hdc, &context_char, 1, &newGlyph, 0) != GDI_ERROR && newGlyph != 0x0000)
1164  pwOutGlyphs[glyph_index] = newGlyph;
1165  }
1166  }
1167  char_index += dirL;
1168  glyph_index += dirL;
1169  }
1170  }
1171 
1172  heap_free(context_shape);
1173  heap_free(context_type);
1174 
1176 }
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:705
#define TRUE
Definition: types.h:120
Definition: shape.c:105
Definition: shape.c:102
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
Definition: shape.c:97
char CHAR
Definition: xmlstorage.h:175
GLintptr offset
Definition: glext.h:5920
static unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
Definition: IdnToAscii.c:32
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: shape.c:103
const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944]
Definition: shaping.c:7
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
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: shape.c:95
Definition: shape.c:96
static CHAR neighbour_joining_type(int i, int delta, const CHAR *context_type, INT cchLen, SCRIPT_ANALYSIS *psa)
Definition: shape.c:964
#define FIRST_ARABIC_CHAR
Definition: shape.c:39
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
static int combining_lexical_Arabic(WCHAR c)
Definition: shape.c:1007
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
unsigned short WORD
Definition: ntddk_ex.h:93
static BOOL left_join_causing(CHAR joining_type)
Definition: shape.c:994
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static BOOL right_join_causing(CHAR joining_type)
Definition: shape.c:989
#define GSUB_E_NOGLYPH
const unsigned short DECLSPEC_HIDDEN wine_shaping_forms[256][4]
Definition: shaping.c:382
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static const char *const contextual_features[]
Definition: shape.c:130
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
#define LAST_ARABIC_CHAR
Definition: shape.c:40
#define GDI_ERROR
Definition: wingdi.h:1308
Definition: shape.c:104
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Bengali()

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

Definition at line 2404 of file shape.c.

2405 {
2406  int cCount = cChars;
2407  WCHAR *input;
2408  IndicSyllable *syllables = NULL;
2409  int syllable_count = 0;
2410  BOOL modern = get_GSUB_Indic2(psa, psc);
2411 
2412  if (*pcGlyphs != cChars)
2413  {
2414  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2415  return;
2416  }
2417 
2418  input = heap_alloc(2 * cChars * sizeof(*input));
2419  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2420 
2421  /* Step 1: Decompose Vowels and Compose Consonants */
2424  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2425 
2426  /* Step 2: Reorder within Syllables */
2427  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, bengali_lex, Reorder_Like_Bengali, modern);
2428  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2429  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2430  *pcGlyphs = cCount;
2431 
2432  /* Step 3: Initial form is only applied to the beginning of words */
2433  for (cCount = cCount - 1 ; cCount >= 0; cCount --)
2434  {
2435  if (cCount == 0 || input[cCount] == 0x0020) /* space */
2436  {
2437  int index = cCount;
2438  int gCount = 1;
2439  if (index > 0) index++;
2440 
2441  apply_GSUB_feature_to_glyph(hdc, psa, psc, &pwOutGlyphs[index], 0, 1, &gCount, "init");
2442  }
2443  }
2444 
2445  /* Step 4: Base Form application to syllables */
2446  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, bengali_lex, NULL, modern);
2447 
2448  heap_free(input);
2449  heap_free(syllables);
2450 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static int bengali_lex(WCHAR c)
Definition: shape.c:2382
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
static const ConsonantComponents Bengali_consonants[]
Definition: shape.c:2397
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static const VowelComponents Bengali_vowels[]
Definition: shape.c:2392
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Control()

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

Definition at line 932 of file shape.c.

933 {
934  int i;
935  for (i=0; i < cChars; i++)
936  {
937  switch (pwcChars[i])
938  {
939  case 0x000A:
940  case 0x000D:
941  pwOutGlyphs[i] = psc->sfp.wgBlank;
942  break;
943  default:
944  if (pwcChars[i] < 0x1C)
945  pwOutGlyphs[i] = psc->sfp.wgDefault;
946  else
947  pwOutGlyphs[i] = psc->sfp.wgBlank;
948  }
949  }
950 }
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
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 SCRIPT_CHARPROP WORD * pwOutGlyphs
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static SCRIPT_CACHE * psc
Definition: usp10.c:64

◆ ContextualShape_Devanagari()

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

Definition at line 2348 of file shape.c.

2349 {
2350  int cCount = cChars;
2351  WCHAR *input;
2352  IndicSyllable *syllables = NULL;
2353  int syllable_count = 0;
2354  BOOL modern = get_GSUB_Indic2(psa, psc);
2355 
2356  if (*pcGlyphs != cChars)
2357  {
2358  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2359  return;
2360  }
2361 
2362  input = heap_alloc(cChars * sizeof(*input));
2363  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2364 
2365  /* Step 1: Compose Consonant and Nukta */
2367  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2368 
2369  /* Step 2: Reorder within Syllables */
2370  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, devanagari_lex, Reorder_Like_Devanagari, modern);
2371  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2372  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2373  *pcGlyphs = cCount;
2374 
2375  /* Step 3: Base Form application to syllables */
2376  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, devanagari_lex, NULL, modern);
2377 
2378  heap_free(input);
2379  heap_free(syllables);
2380 }
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static const ConsonantComponents Devanagari_consonants[]
Definition: shape.c:2335
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1920
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static int devanagari_lex(WCHAR c)
Definition: shape.c:2325
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Gujarati()

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

Definition at line 2512 of file shape.c.

2513 {
2514  int cCount = cChars;
2515  WCHAR *input;
2516  IndicSyllable *syllables = NULL;
2517  int syllable_count = 0;
2518  BOOL modern = get_GSUB_Indic2(psa, psc);
2519 
2520  if (*pcGlyphs != cChars)
2521  {
2522  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2523  return;
2524  }
2525 
2526  input = heap_alloc(cChars * sizeof(*input));
2527  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2528 
2529  /* Step 1: Reorder within Syllables */
2530  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, gujarati_lex, Reorder_Like_Devanagari, modern);
2531  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2532  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2533  *pcGlyphs = cCount;
2534 
2535  /* Step 2: Base Form application to syllables */
2536  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gujarati_lex, NULL, modern);
2537 
2538  heap_free(input);
2539  heap_free(syllables);
2540 }
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1920
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static int gujarati_lex(WCHAR c)
Definition: shape.c:2502
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Gurmukhi()

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

Definition at line 2468 of file shape.c.

2469 {
2470  int cCount = cChars;
2471  WCHAR *input;
2472  IndicSyllable *syllables = NULL;
2473  int syllable_count = 0;
2474  BOOL modern = get_GSUB_Indic2(psa, psc);
2475 
2476  if (*pcGlyphs != cChars)
2477  {
2478  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2479  return;
2480  }
2481 
2482  input = heap_alloc(cChars * sizeof(*input));
2483  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2484 
2485  /* Step 1: Compose Consonants */
2487  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2488 
2489  /* Step 2: Reorder within Syllables */
2490  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, gurmukhi_lex, Reorder_Like_Bengali, modern);
2491  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2492  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2493  *pcGlyphs = cCount;
2494 
2495  /* Step 3: Base Form application to syllables */
2496  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gurmukhi_lex, NULL, modern);
2497 
2498  heap_free(input);
2499  heap_free(syllables);
2500 }
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static int gurmukhi_lex(WCHAR c)
Definition: shape.c:2452
static const ConsonantComponents Gurmukhi_consonants[]
Definition: shape.c:2460
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Hebrew()

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

Definition at line 1235 of file shape.c.

1236 {
1237  INT dirL;
1238 
1239  if (*pcGlyphs != cChars)
1240  {
1241  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1242  return;
1243  }
1244 
1245  if (!psa->fLogicalOrder && psa->fRTL)
1246  dirL = -1;
1247  else
1248  dirL = 1;
1249 
1251 }
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static int combining_lexical_Hebrew(WCHAR c)
Definition: shape.c:1178
int32_t INT
Definition: typedefs.h:57
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906

◆ ContextualShape_Kannada()

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

Definition at line 2715 of file shape.c.

2716 {
2717  int cCount = cChars;
2718  WCHAR *input;
2719  IndicSyllable *syllables = NULL;
2720  int syllable_count = 0;
2721  BOOL modern = get_GSUB_Indic2(psa, psc);
2722 
2723  if (*pcGlyphs != cChars)
2724  {
2725  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2726  return;
2727  }
2728 
2729  input = heap_alloc(3 * cChars * sizeof(*input));
2730  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2731 
2732  /* Step 1: Decompose Vowels */
2734  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2735 
2736  /* Step 2: Reorder within Syllables */
2737  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, kannada_lex, Reorder_Like_Kannada, modern);
2738  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2739  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2740  *pcGlyphs = cCount;
2741 
2742  /* Step 3: Base Form application to syllables */
2744 
2745  heap_free(input);
2746  heap_free(syllables);
2747 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static const VowelComponents Kannada_vowels[]
Definition: shape.c:2707
static void SecondReorder_Like_Telugu(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1950
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
static int kannada_lex(WCHAR c)
Definition: shape.c:2697
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 void Reorder_Like_Kannada(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1940
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Khmer()

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

Definition at line 2799 of file shape.c.

2800 {
2801  int cCount = cChars;
2802  WCHAR *input;
2803  IndicSyllable *syllables = NULL;
2804  int syllable_count = 0;
2805 
2806  if (*pcGlyphs != cChars)
2807  {
2808  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2809  return;
2810  }
2811 
2812  input = heap_alloc(cChars * sizeof(*input));
2813  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2814 
2815  /* Step 1: Reorder within Syllables */
2816  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, khmer_lex, Reorder_Like_Devanagari, FALSE);
2817  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2818  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2819  *pcGlyphs = cCount;
2820 
2821  /* Step 2: Base Form application to syllables */
2822  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, khmer_lex, NULL, FALSE);
2823 
2824  heap_free(input);
2825  heap_free(syllables);
2826 }
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1920
#define debugstr_wn
Definition: kernel32.h:33
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static int khmer_lex(WCHAR c)
Definition: shape.c:2794
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Lao()

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

Definition at line 1633 of file shape.c.

1634 {
1635  INT dirL;
1636 
1637  if (*pcGlyphs != cChars)
1638  {
1639  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1640  return;
1641  }
1642 
1643  if (!psa->fLogicalOrder && psa->fRTL)
1644  dirL = -1;
1645  else
1646  dirL = 1;
1647 
1649 }
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
int32_t INT
Definition: typedefs.h:57
static int combining_lexical_Lao(WCHAR c)
Definition: shape.c:1607
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906

◆ ContextualShape_Malayalam()

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

Definition at line 2760 of file shape.c.

2761 {
2762  int cCount = cChars;
2763  WCHAR *input;
2764  IndicSyllable *syllables = NULL;
2765  int syllable_count = 0;
2766  BOOL modern = get_GSUB_Indic2(psa, psc);
2767 
2768  if (*pcGlyphs != cChars)
2769  {
2770  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2771  return;
2772  }
2773 
2774  input = heap_alloc(2 * cChars * sizeof(*input));
2775  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2776 
2777  /* Step 1: Decompose Vowels */
2779  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2780 
2781  /* Step 2: Reorder within Syllables */
2782  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, malayalam_lex, Reorder_Like_Devanagari, modern);
2783  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2784  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2785  *pcGlyphs = cCount;
2786 
2787  /* Step 3: Base Form application to syllables */
2789 
2790  heap_free(input);
2791  heap_free(syllables);
2792 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
static const VowelComponents Malayalam_vowels[]
Definition: shape.c:2754
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1961
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1920
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static int malayalam_lex(WCHAR c)
Definition: shape.c:2749
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Mongolian()

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

Definition at line 2833 of file shape.c.

2834 {
2835  INT *context_shape;
2836  INT dirL;
2837  int i;
2838  int char_index;
2839  int glyph_index;
2840 
2841  if (*pcGlyphs != cChars)
2842  {
2843  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2844  return;
2845  }
2846 
2847  if (!psa->fLogicalOrder && psa->fRTL)
2848  dirL = -1;
2849  else
2850  dirL = 1;
2851 
2852  if (!psc->GSUB_Table)
2853  return;
2854 
2855  context_shape = heap_alloc(cChars * sizeof(*context_shape));
2856 
2857  for (i = 0; i < cChars; i++)
2858  {
2859  if (i == 0 || mongolian_wordbreak(pwcChars[i-1]))
2860  {
2861  if ((i == cChars-1) || mongolian_wordbreak(pwcChars[i+1]))
2862  context_shape[i] = Xn;
2863  else
2864  context_shape[i] = Xl;
2865  }
2866  else
2867  {
2868  if ((i == cChars-1) || mongolian_wordbreak(pwcChars[i+1]))
2869  context_shape[i] = Xr;
2870  else
2871  context_shape[i] = Xm;
2872  }
2873  }
2874 
2875  /* Contextual Shaping */
2876  if (dirL > 0)
2877  char_index = glyph_index = 0;
2878  else
2879  char_index = glyph_index = cChars-1;
2880 
2881  while(char_index < cChars && char_index >= 0)
2882  {
2883  INT nextIndex;
2884  INT prevCount = *pcGlyphs;
2885  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
2886 
2887  if (nextIndex > GSUB_E_NOGLYPH)
2888  {
2889  UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
2890  glyph_index = nextIndex;
2891  char_index += dirL;
2892  }
2893  else
2894  {
2895  char_index += dirL;
2896  glyph_index += dirL;
2897  }
2898  }
2899 
2900  heap_free(context_shape);
2901 }
Definition: shape.c:105
Definition: shape.c:102
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: shape.c:103
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
static BOOL mongolian_wordbreak(WCHAR chr)
Definition: shape.c:2828
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static const char *const contextual_features[]
Definition: shape.c:130
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
Definition: shape.c:104
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Oriya()

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

Definition at line 2563 of file shape.c.

2564 {
2565  int cCount = cChars;
2566  WCHAR *input;
2567  IndicSyllable *syllables = NULL;
2568  int syllable_count = 0;
2569  BOOL modern = get_GSUB_Indic2(psa, psc);
2570 
2571  if (*pcGlyphs != cChars)
2572  {
2573  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2574  return;
2575  }
2576 
2577  input = heap_alloc(2 * cChars * sizeof(*input));
2578  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2579 
2580  /* Step 1: Decompose Vowels and Compose Consonants */
2583  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2584 
2585  /* Step 2: Reorder within Syllables */
2586  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, oriya_lex, Reorder_Like_Bengali, modern);
2587  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2588  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2589  *pcGlyphs = cCount;
2590 
2591  /* Step 3: Base Form application to syllables */
2592  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, oriya_lex, NULL, modern);
2593 
2594  heap_free(input);
2595  heap_free(syllables);
2596 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 int oriya_lex(WCHAR c)
Definition: shape.c:2542
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static const VowelComponents Oriya_vowels[]
Definition: shape.c:2552
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static const ConsonantComponents Oriya_consonants[]
Definition: shape.c:2558
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Phags_pa()

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

Definition at line 1472 of file shape.c.

1473 {
1474  INT *context_shape;
1475  INT dirR, dirL;
1476  int i;
1477  int char_index;
1478  int glyph_index;
1479 
1480  if (*pcGlyphs != cChars)
1481  {
1482  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1483  return;
1484  }
1485 
1486  if (!psa->fLogicalOrder && psa->fRTL)
1487  {
1488  dirR = 1;
1489  dirL = -1;
1490  }
1491  else
1492  {
1493  dirR = -1;
1494  dirL = 1;
1495  }
1496 
1498 
1499  if (!psc->GSUB_Table)
1500  return;
1501 
1502  context_shape = heap_alloc(cChars * sizeof(*context_shape));
1503 
1504  for (i = 0; i < cChars; i++)
1505  {
1507  {
1508  WCHAR rchar = neighbour_char(i,dirR,pwcChars,cChars);
1509  WCHAR lchar = neighbour_char(i,dirL,pwcChars,cChars);
1510  BOOL jrchar = (rchar != phags_pa_CANDRABINDU && rchar >= phags_pa_START && rchar <= phags_pa_END);
1511  BOOL jlchar = (lchar != phags_pa_CANDRABINDU && lchar >= phags_pa_START && lchar <= phags_pa_END);
1512 
1513  if (jrchar && jlchar)
1514  context_shape[i] = Xm;
1515  else if (jrchar)
1516  context_shape[i] = Xr;
1517  else if (jlchar)
1518  context_shape[i] = Xl;
1519  else
1520  context_shape[i] = Xn;
1521  }
1522  else
1523  context_shape[i] = -1;
1524  }
1525 
1526  /* Contextual Shaping */
1527  if (dirL > 0)
1528  char_index = glyph_index = 0;
1529  else
1530  char_index = glyph_index = cChars-1;
1531 
1532  while(char_index < cChars && char_index >= 0)
1533  {
1534  if (context_shape[char_index] >= 0)
1535  {
1536  INT nextIndex;
1537  INT prevCount = *pcGlyphs;
1538  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1539 
1540  if (nextIndex > GSUB_E_NOGLYPH)
1541  {
1542  UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1543  glyph_index = nextIndex;
1544  char_index += dirL;
1545  }
1546  else
1547  {
1548  char_index += dirL;
1549  glyph_index += dirL;
1550  }
1551  }
1552  else
1553  {
1554  char_index += dirL;
1555  glyph_index += dirL;
1556  }
1557  }
1558 
1559  heap_free(context_shape);
1560 }
#define phags_pa_CANDRABINDU
Definition: shape.c:1468
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:705
Definition: shape.c:105
Definition: shape.c:102
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: shape.c:103
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
static WCHAR neighbour_char(int i, int delta, const WCHAR *chars, INT cchLen)
Definition: shape.c:952
unsigned int BOOL
Definition: ntddk_ex.h:94
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
#define phags_pa_END
Definition: shape.c:1470
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static const char *const contextual_features[]
Definition: shape.c:130
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
#define phags_pa_START
Definition: shape.c:1469
Definition: shape.c:104
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Sinhala()

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

Definition at line 2281 of file shape.c.

2282 {
2283  int cCount = cChars;
2284  int i;
2285  WCHAR *input;
2286  IndicSyllable *syllables = NULL;
2287  int syllable_count = 0;
2288 
2289  if (*pcGlyphs != cChars)
2290  {
2291  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2292  return;
2293  }
2294 
2295  input = heap_alloc(3 * cChars * sizeof(*input));
2296 
2297  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2298 
2299  /* Step 1: Decompose multi part vowels */
2301 
2302  TRACE("New double vowel expanded string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2303 
2304  /* Step 2: Reorder within Syllables */
2305  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, sinhala_lex, Reorder_Like_Sinhala, TRUE);
2306  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2307 
2308  /* Step 3: Strip dangling joiners */
2309  for (i = 0; i < cCount; i++)
2310  {
2311  if ((input[i] == 0x200D || input[i] == 0x200C) &&
2312  (i == 0 || input[i-1] == 0x0020 || i == cCount-1 || input[i+1] == 0x0020))
2313  input[i] = 0x0020;
2314  }
2315 
2316  /* Step 4: Base Form application to syllables */
2317  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2318  *pcGlyphs = cCount;
2319  ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, sinhala_lex, NULL, TRUE);
2320 
2321  heap_free(input);
2322  heap_free(syllables);
2323 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
#define TRUE
Definition: types.h:120
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static int sinhala_lex(WCHAR c)
Definition: shape.c:2261
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static void Reorder_Like_Sinhala(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1910
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
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static const VowelComponents Sinhala_vowels[]
Definition: shape.c:2274
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Syriac()

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

Definition at line 1309 of file shape.c.

1310 {
1311  CHAR *context_type;
1312  INT *context_shape;
1313  INT dirR, dirL;
1314  int i;
1315  int char_index;
1316  int glyph_index;
1317 
1318  if (*pcGlyphs != cChars)
1319  {
1320  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1321  return;
1322  }
1323 
1324  if (!psa->fLogicalOrder && psa->fRTL)
1325  {
1326  dirR = 1;
1327  dirL = -1;
1328  }
1329  else
1330  {
1331  dirR = -1;
1332  dirL = 1;
1333  }
1334 
1336 
1337  if (!psc->GSUB_Table)
1338  return;
1339 
1340  context_type = heap_alloc(cChars);
1341  context_shape = heap_alloc(cChars * sizeof(*context_shape));
1342 
1343  for (i = 0; i < cChars; i++)
1344  context_type[i] = get_table_entry( wine_shaping_table, pwcChars[i] );
1345 
1346  for (i = 0; i < cChars; i++)
1347  {
1348  if (pwcChars[i] == ALAPH)
1349  {
1350  WCHAR rchar = neighbour_char(i,dirR,pwcChars,cChars);
1351 
1353  context_shape[i] = Afj;
1354  else if ( rchar != DALATH && rchar != RISH &&
1355 !left_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)) &&
1357  context_shape[i] = Afn;
1358  else if ( (rchar == DALATH || rchar == RISH) && word_break_causing(neighbour_char(i,dirL,pwcChars,cChars)))
1359  context_shape[i] = Afx;
1360  else
1361  context_shape[i] = Xn;
1362  }
1363  else if (context_type[i] == jtR &&
1365  context_shape[i] = Xr;
1366  else if (context_type[i] == jtL && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1367  context_shape[i] = Xl;
1368  else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)) && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1369  context_shape[i] = Xm;
1370  else if (context_type[i] == jtD && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1371  context_shape[i] = Xr;
1372  else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1373  context_shape[i] = Xl;
1374  else
1375  context_shape[i] = Xn;
1376  }
1377 
1378  /* Contextual Shaping */
1379  if (dirL > 0)
1380  char_index = glyph_index = 0;
1381  else
1382  char_index = glyph_index = cChars-1;
1383 
1384  while(char_index < cChars && char_index >= 0)
1385  {
1386  INT nextIndex, offset = 0;
1387  INT prevCount = *pcGlyphs;
1388 
1389  /* Apply CCMP first */
1390  apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, "ccmp");
1391 
1392  if (prevCount != *pcGlyphs)
1393  {
1394  offset = *pcGlyphs - prevCount;
1395  if (dirL < 0)
1396  glyph_index -= offset * dirL;
1397  }
1398 
1399  /* Apply the contextual feature */
1400  nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1401  if (nextIndex > GSUB_E_NOGLYPH)
1402  {
1403  UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1404  char_index += dirL;
1405  if (!offset)
1406  glyph_index = nextIndex;
1407  else
1408  {
1409  offset = *pcGlyphs - prevCount;
1410  glyph_index += dirL * (offset + 1);
1411  }
1412  }
1413  else
1414  {
1415  char_index += dirL;
1416  glyph_index += dirL;
1417  }
1418  }
1419 
1420  heap_free(context_shape);
1421  heap_free(context_type);
1422 
1424 }
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:705
Definition: shape.c:105
Definition: shape.c:102
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
Definition: shape.c:97
char CHAR
Definition: xmlstorage.h:175
GLintptr offset
Definition: glext.h:5920
static unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
Definition: IdnToAscii.c:32
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
int32_t INT
Definition: typedefs.h:57
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
Definition: shape.c:103
Definition: shape.c:109
Definition: shape.c:108
const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944]
Definition: shaping.c:7
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
static WCHAR neighbour_char(int i, int delta, const WCHAR *chars, INT cchLen)
Definition: shape.c:952
static int combining_lexical_Syriac(WCHAR c)
Definition: shape.c:1257
Definition: shape.c:95
#define ALAPH
Definition: shape.c:1305
Definition: shape.c:96
static CHAR neighbour_joining_type(int i, int delta, const CHAR *context_type, INT cchLen, SCRIPT_ANALYSIS *psa)
Definition: shape.c:964
#define DALATH
Definition: shape.c:1306
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
#define RISH
Definition: shape.c:1307
static BOOL left_join_causing(CHAR joining_type)
Definition: shape.c:994
static BOOL word_break_causing(WCHAR chr)
Definition: shape.c:999
HDC hdc
Definition: main.c:9
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
Definition: shape.c:107
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static BOOL right_join_causing(CHAR joining_type)
Definition: shape.c:989
#define GSUB_E_NOGLYPH
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static INT apply_GSUB_feature_to_glyph(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WORD *glyphs, INT index, INT write_dir, INT *glyph_count, const char *feat)
Definition: shape.c:654
static const char *const contextual_features[]
Definition: shape.c:130
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
Definition: shape.c:104
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Tamil()

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

Definition at line 2613 of file shape.c.

2614 {
2615  int cCount = cChars;
2616  WCHAR *input;
2617  IndicSyllable *syllables = NULL;
2618  int syllable_count = 0;
2619  BOOL modern = get_GSUB_Indic2(psa, psc);
2620 
2621  if (*pcGlyphs != cChars)
2622  {
2623  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2624  return;
2625  }
2626 
2627  input = heap_alloc(2 * cChars * sizeof(*input));
2628  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2629 
2630  /* Step 1: Decompose Vowels and Compose Consonants */
2633  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2634 
2635  /* Step 2: Reorder within Syllables */
2636  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, tamil_lex, Reorder_Like_Bengali, modern);
2637  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2638  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2639  *pcGlyphs = cCount;
2640 
2641  /* Step 3: Base Form application to syllables */
2643 
2644  heap_free(input);
2645  heap_free(syllables);
2646 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static const ConsonantComponents Tamil_consonants[]
Definition: shape.c:2609
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1961
HDC hdc
Definition: main.c:9
static int tamil_lex(WCHAR c)
Definition: shape.c:2598
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
static const VowelComponents Tamil_vowels[]
Definition: shape.c:2603
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Telugu()

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

Definition at line 2663 of file shape.c.

2664 {
2665  int cCount = cChars;
2666  WCHAR *input;
2667  IndicSyllable *syllables = NULL;
2668  int syllable_count = 0;
2669  BOOL modern = get_GSUB_Indic2(psa, psc);
2670 
2671  if (*pcGlyphs != cChars)
2672  {
2673  ERR("Number of Glyphs and Chars need to match at the beginning\n");
2674  return;
2675  }
2676 
2677  input = heap_alloc(2 * cChars * sizeof(*input));
2678  memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2679 
2680  /* Step 1: Decompose Vowels */
2682  TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2683 
2684  /* Step 2: Reorder within Syllables */
2685  Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, telugu_lex, Reorder_Like_Bengali, modern);
2686  TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2687  GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2688  *pcGlyphs = cCount;
2689 
2690  /* Step 3: Base Form application to syllables */
2692 
2693  heap_free(input);
2694  heap_free(syllables);
2695 }
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
void Indic_ReorderCharacters(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, reorder_function reorder_f, BOOL modern)
Definition: indic.c:373
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static void SecondReorder_Like_Telugu(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1950
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static void ShapeIndicSyllables(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwChars, INT cChars, IndicSyllable *syllables, INT syllable_count, WORD *pwOutGlyphs, INT *pcGlyphs, WORD *pwLogClust, lexical_function lexical, second_reorder_function second_reorder, BOOL modern)
Definition: shape.c:2126
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define TRACE(s)
Definition: solgame.cpp:4
static int telugu_lex(WCHAR c)
Definition: shape.c:2648
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define debugstr_wn
Definition: kernel32.h:33
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 BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
GLenum GLenum GLenum input
Definition: glext.h:9031
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static const VowelComponents Telugu_vowels[]
Definition: shape.c:2659
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ContextualShape_Thaana()

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

Definition at line 1446 of file shape.c.

1447 {
1448  INT dirL;
1449 
1450  if (*pcGlyphs != cChars)
1451  {
1452  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1453  return;
1454  }
1455 
1456  if (!psa->fLogicalOrder && psa->fRTL)
1457  dirL = -1;
1458  else
1459  dirL = 1;
1460 
1462 }
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
int32_t INT
Definition: typedefs.h:57
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static int combining_lexical_Thaana(WCHAR c)
Definition: shape.c:1426
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906

◆ ContextualShape_Thai()

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

Definition at line 1589 of file shape.c.

1590 {
1591  INT dirL;
1592 
1593  if (*pcGlyphs != cChars)
1594  {
1595  ERR("Number of Glyphs and Chars need to match at the beginning\n");
1596  return;
1597  }
1598 
1599  if (!psa->fLogicalOrder && psa->fRTL)
1600  dirL = -1;
1601  else
1602  dirL = 1;
1603 
1605 }
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
int32_t INT
Definition: typedefs.h:57
static int combining_lexical_Thai(WCHAR c)
Definition: shape.c:1562
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 SCRIPT_CHARPROP WORD SCRIPT_GLYPHPROP int * pcGlyphs
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
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
#define ERR(fmt,...)
Definition: debug.h:110
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
static void mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, combining_lexical_function lex)
Definition: shape.c:906

◆ DecomposeVowels()

static void DecomposeVowels ( HDC  hdc,
WCHAR pwOutChars,
INT pcChars,
const VowelComponents  vowels[],
WORD pwLogClust,
INT  cChars 
)
static

Definition at line 1671 of file shape.c.

1672 {
1673  int i;
1674  int cWalk;
1675 
1676  for (cWalk = 0; cWalk < *pcChars; cWalk++)
1677  {
1678  for (i = 0; vowels[i].base != 0x0; i++)
1679  {
1680  if (pwOutChars[cWalk] == vowels[i].base)
1681  {
1682  int o = 0;
1683  ReplaceInsertChars(hdc, cWalk, pcChars, pwOutChars, vowels[i].parts);
1684  if (vowels[i].parts[1]) { cWalk++; o++; }
1685  if (vowels[i].parts[2]) { cWalk++; o++; }
1686  UpdateClusters(cWalk, o, 1, cChars, pwLogClust);
1687  break;
1688  }
1689  }
1690  }
1691 }
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int int WORD * pwLogClust
Definition: usp10.c:64
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
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
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
HDC hdc
Definition: main.c:9
static void ReplaceInsertChars(HDC hdc, INT cWalk, INT *pcChars, WCHAR *pwOutChars, const WCHAR *replacements)
Definition: shape.c:1651

Referenced by ContextualShape_Bengali(), ContextualShape_Kannada(), ContextualShape_Malayalam(), ContextualShape_Oriya(), ContextualShape_Sinhala(), ContextualShape_Tamil(), and ContextualShape_Telugu().

◆ devanagari_lex()

static int devanagari_lex ( WCHAR  c)
static

Definition at line 2325 of file shape.c.

2326 {
2327  switch (c)
2328  {
2329  case 0x0930: return lex_Ra;
2330  default:
2331  return unicode_lex(c);
2332  }
2333 }
static int unicode_lex(WCHAR c)
Definition: shape.c:2208
const GLubyte * c
Definition: glext.h:8905

Referenced by ContextualShape_Devanagari(), and ShapeCharGlyphProp_Devanagari().

◆ find_consonant_halant()

static INT find_consonant_halant ( WCHAR pwChars,
INT  index,
INT  end,
lexical_function  lexical 
)
inlinestatic

Definition at line 2016 of file shape.c.

2017 {
2018  int i = 0;
2019  while (i + index < end - 1 && !(is_consonant(lexical(pwChars[index+i])) && (lexical(pwChars[index+i+1]) == lex_Halant || (index + i < end - 2 && lexical(pwChars[index+i+1]) == lex_Nukta && lexical(pwChars[index+i+2] == lex_Halant)))))
2020  i++;
2021  if (index + i <= end-1)
2022  return index + i;
2023  else
2024  return -1;
2025 }
GLuint GLuint end
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
GLuint index
Definition: glext.h:6031
static BOOL is_consonant(int type)

Referenced by Apply_Indic_PreBase().

◆ find_halant_consonant()

static INT find_halant_consonant ( WCHAR pwChars,
INT  index,
INT  end,
lexical_function  lexical 
)
inlinestatic

Definition at line 2068 of file shape.c.

2069 {
2070  int i = 0;
2071  while (index + i < end-1 && !(lexical(pwChars[index+i]) == lex_Halant &&
2072  ((index + i < end-2 && lexical(pwChars[index+i]) == lex_Nukta && is_consonant(lexical(pwChars[index+i+1]))) ||
2073  is_consonant(lexical(pwChars[index+i+1])))))
2074  i++;
2075  if (index + i <= end-1)
2076  return index+i;
2077  else
2078  return -1;
2079 }
GLuint GLuint end
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
GLuint index
Definition: glext.h:6031
static BOOL is_consonant(int type)

Referenced by Apply_Indic_PostBase().

◆ get_GSUB_Indic2()

static BOOL get_GSUB_Indic2 ( SCRIPT_ANALYSIS psa,
ScriptCache psc 
)
inlinestatic

Definition at line 882 of file shape.c.

883 {
885  HRESULT hr;
886  int count = 0;
887 
889 
890  return(SUCCEEDED(hr));
891 }
OPENTYPE_TAG newOtTag
Definition: shape.c:452
HRESULT hr
Definition: shlfolder.c:183
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
Definition: opentype.c:2647
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: ecma_167.h:138
static const ScriptShapeData ShapingData[]
Definition: shape.c:458
LONG HRESULT
Definition: typedefs.h:78
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static SCRIPT_CACHE SCRIPT_ANALYSIS * psa
Definition: usp10.c:64
ULONG OPENTYPE_TAG
Definition: usp10.h:205
#define SUCCEEDED(hr)
Definition: intsafe.h:57
char * tag
Definition: main.c:59

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

◆ get_opentype_script()

static OPENTYPE_TAG get_opentype_script ( HDC  hdc,
const SCRIPT_ANALYSIS psa,
const ScriptCache script_cache,
BOOL  try_new 
)
static

Definition at line 571 of file shape.c.

573 {
574  UINT charset;
575 
576  if (script_cache->userScript)
577  {
578  if (try_new && ShapingData[psa->eScript].newOtTag
579  && script_cache->userScript == scriptInformation[psa->eScript].scriptTag)
580  return ShapingData[psa->eScript].newOtTag;
581 
582  return script_cache->userScript;
583  }
584 
585  if (try_new && ShapingData[psa->eScript].newOtTag)
586  return ShapingData[psa->eScript].newOtTag;
587 
588  if (scriptInformation[psa->eScript].scriptTag)
589  return scriptInformation[psa->eScript].scriptTag;
590 
591  /*
592  * fall back to the font charset
593  */
595  switch (charset)
596  {
597  case ANSI_CHARSET:
598  case BALTIC_CHARSET: return MS_MAKE_TAG('l','a','t','n');
599  case CHINESEBIG5_CHARSET: return MS_MAKE_TAG('h','a','n','i');
600  case EASTEUROPE_CHARSET: return MS_MAKE_TAG('l','a','t','n'); /* ?? */
601  case GB2312_CHARSET: return MS_MAKE_TAG('h','a','n','i');
602  case GREEK_CHARSET: return MS_MAKE_TAG('g','r','e','k');
603  case HANGUL_CHARSET: return MS_MAKE_TAG('h','a','n','g');
604  case RUSSIAN_CHARSET: return MS_MAKE_TAG('c','y','r','l');
605  case SHIFTJIS_CHARSET: return MS_MAKE_TAG('k','a','n','a');
606  case TURKISH_CHARSET: return MS_MAKE_TAG('l','a',