ReactOS 0.4.15-dev-6068-g8061a6f
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};
@ Xn
Definition: shape.c:102
@ Xm
Definition: shape.c:105
@ Xr
Definition: shape.c:103
@ Xl
Definition: shape.c:104
@ Afx
Definition: shape.c:109
@ Afn
Definition: shape.c:108
@ Afj
Definition: shape.c:107

◆ 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};
@ jtL
Definition: shape.c:96
@ jtC
Definition: shape.c:98
@ jtD
Definition: shape.c:97
@ jtT
Definition: shape.c:94
@ jtU
Definition: shape.c:93
@ jtR
Definition: shape.c:95

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}
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
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
HDC hdc
Definition: main.c:9
INTERNETFEATURELIST feature
Definition: misc.c:1719
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 * psa
Definition: usp10.c:64
static SCRIPT_CACHE * psc
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 * pwLogClust
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
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
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:616
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:758
#define TRACE(s)
Definition: solgame.cpp:4
int32_t INT
Definition: typedefs.h:58
#define GSUB_E_NOFEATURE
#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}
GLuint index
Definition: glext.h:6031
static UINT UINT LPWORD glyphs
Definition: font.c:44
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 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
2000 while(index <= glyph_index->end)
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}
GLuint GLuint end
Definition: gl.h:1545
static void shift_syllable_glyph_indexs(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1974
#define GSUB_E_NOGLYPH

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}
#define index(s, c)
Definition: various.h:29
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLboolean GLboolean g
Definition: glext.h:6204
static INT find_halant_consonant(WCHAR *pwChars, INT index, INT end, lexical_function lexical)
Definition: shape.c:2068
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

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}
static INT find_consonant_halant(WCHAR *pwChars, INT index, INT end, lexical_function lexical)
Definition: shape.c:2016

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}

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}
const GLubyte * c
Definition: glext.h:8905
static int unicode_lex(WCHAR c)
Definition: shape.c:2208
@ lex_Ra

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}

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}

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}

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}

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}

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}

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}
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 GLint GLint j
Definition: glfuncs.h:250
static const D3D_BLOB_PART parts[]
Definition: blob.c:76
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 unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
Definition: IdnToAscii.c:32
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERR(fmt,...)
Definition: debug.h:110
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR * pwcChars
Definition: usp10.c:64
#define LAST_ARABIC_CHAR
Definition: shape.c:40
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 int combining_lexical_Arabic(WCHAR c)
Definition: shape.c:1007
static const char *const contextual_features[]
Definition: shape.c:130
static CHAR neighbour_joining_type(int i, int delta, const CHAR *context_type, INT cchLen, SCRIPT_ANALYSIS *psa)
Definition: shape.c:964
static BOOL right_join_causing(CHAR joining_type)
Definition: shape.c:989
#define FIRST_ARABIC_CHAR
Definition: shape.c:39
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:705
static BOOL left_join_causing(CHAR joining_type)
Definition: shape.c:994
const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944]
Definition: shaping.c:7
const unsigned short DECLSPEC_HIDDEN wine_shaping_forms[256][4]
Definition: shaping.c:382
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
#define GDI_ERROR
Definition: wingdi.h:1309
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175

◆ 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
2449 heap_free(syllables);
2450}
#define NULL
Definition: types.h:112
GLenum GLenum GLenum input
Definition: glext.h:9031
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
#define debugstr_wn
Definition: kernel32.h:33
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void Reorder_Like_Bengali(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1930
static BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:882
static const VowelComponents Bengali_vowels[]
Definition: shape.c:2392
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 DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1671
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1693
static const ConsonantComponents Bengali_consonants[]
Definition: shape.c:2397
static int bengali_lex(WCHAR c)
Definition: shape.c:2382

◆ 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}

◆ 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
2379 heap_free(syllables);
2380}
static int devanagari_lex(WCHAR c)
Definition: shape.c:2325
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1920
static const ConsonantComponents Devanagari_consonants[]
Definition: shape.c:2335

◆ 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
2539 heap_free(syllables);
2540}
static int gujarati_lex(WCHAR c)
Definition: shape.c:2502

◆ 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
2499 heap_free(syllables);
2500}
static int gurmukhi_lex(WCHAR c)
Definition: shape.c:2452
static const ConsonantComponents Gurmukhi_consonants[]
Definition: shape.c:2460

◆ 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 int combining_lexical_Hebrew(WCHAR c)
Definition: shape.c:1178

◆ 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
2746 heap_free(syllables);
2747}
static void Reorder_Like_Kannada(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1940
static void SecondReorder_Like_Telugu(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1950
static const VowelComponents Kannada_vowels[]
Definition: shape.c:2707
static int kannada_lex(WCHAR c)
Definition: shape.c:2697

◆ 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 */
2823
2825 heap_free(syllables);
2826}
static int khmer_lex(WCHAR c)
Definition: shape.c:2794

◆ 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 int combining_lexical_Lao(WCHAR c)
Definition: shape.c:1607

◆ 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
2791 heap_free(syllables);
2792}
static const VowelComponents Malayalam_vowels[]
Definition: shape.c:2754
static int malayalam_lex(WCHAR c)
Definition: shape.c:2749
static void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1961

◆ 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}
static BOOL mongolian_wordbreak(WCHAR chr)
Definition: shape.c:2828

◆ 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
2595 heap_free(syllables);
2596}
static int oriya_lex(WCHAR c)
Definition: shape.c:2542
static const VowelComponents Oriya_vowels[]
Definition: shape.c:2552
static const ConsonantComponents Oriya_consonants[]
Definition: shape.c:2558

◆ 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_START
Definition: shape.c:1469
#define phags_pa_END
Definition: shape.c:1470
static WCHAR neighbour_char(int i, int delta, const WCHAR *chars, INT cchLen)
Definition: shape.c:952
#define phags_pa_CANDRABINDU
Definition: shape.c:1468

◆ 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;
2320
2322 heap_free(syllables);
2323}
static const VowelComponents Sinhala_vowels[]
Definition: shape.c:2274
static void Reorder_Like_Sinhala(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1910
static int sinhala_lex(WCHAR c)
Definition: shape.c:2261

◆ 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 BOOL word_break_causing(WCHAR chr)
Definition: shape.c:999
#define DALATH
Definition: shape.c:1306
#define RISH
Definition: shape.c:1307
static int combining_lexical_Syriac(WCHAR c)
Definition: shape.c:1257
#define ALAPH
Definition: shape.c:1305

◆ 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
2645 heap_free(syllables);
2646}
static const VowelComponents Tamil_vowels[]
Definition: shape.c:2603
static int tamil_lex(WCHAR c)
Definition: shape.c:2598
static const ConsonantComponents Tamil_consonants[]
Definition: shape.c:2609

◆ 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
2694 heap_free(syllables);
2695}
static const VowelComponents Telugu_vowels[]
Definition: shape.c:2659
static int telugu_lex(WCHAR c)
Definition: shape.c:2648

◆ 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 int combining_lexical_Thaana(WCHAR c)
Definition: shape.c:1426

◆ 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 int combining_lexical_Thai(WCHAR c)
Definition: shape.c:1562

◆ 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 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}

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}
static BOOL is_consonant(int type)
@ lex_Nukta
@ lex_Halant

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}

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}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
Definition: opentype.c:2647
static const ScriptShapeData ShapingData[]
Definition: shape.c:458
HRESULT hr
Definition: shlfolder.c:183
OPENTYPE_TAG newOtTag
Definition: shape.c:452
Definition: ecma_167.h:138
ULONG OPENTYPE_TAG
Definition: usp10.h:205

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{
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','t','n'); /* ?? */
607 case VIETNAMESE_CHARSET: return MS_MAKE_TAG('l','a','t','n');
608 case JOHAB_CHARSET: return MS_MAKE_TAG('l','a','t','n'); /* ?? */
609 case ARABIC_CHARSET: return MS_MAKE_TAG('a','r','a','b');
610 case HEBREW_CHARSET: return MS_MAKE_TAG('h','e','b','r');
611 case THAI_CHARSET: return MS_MAKE_TAG('t','h','a','i');
612 default: return MS_MAKE_TAG('l','a','t','n');
613 }
614}
CFF_Charset charset
Definition: cffcmap.c:138
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
Definition: font.c:113
unsigned int UINT
Definition: ndis.h:50
scriptData scriptInformation[]
Definition: usp10.c:305
OPENTYPE_TAG userScript
OPENTYPE_TAG scriptTag
#define HANGUL_CHARSET
Definition: wingdi.h:388
#define RUSSIAN_CHARSET
Definition: wingdi.h:396
int WINAPI GetTextCharsetInfo(_In_ HDC, _Out_opt_ LPFONTSIGNATURE, _In_ DWORD)
#define ARABIC_CHARSET
Definition: wingdi.h:394
#define THAI_CHARSET
Definition: wingdi.h:397
#define GREEK_CHARSET
Definition: wingdi.h:391
#define JOHAB_CHARSET
Definition: wingdi.h:401
#define CHINESEBIG5_CHARSET
Definition: wingdi.h:390
#define ANSI_CHARSET
Definition: wingdi.h:383
#define VIETNAMESE_CHARSET
Definition: wingdi.h:402
#define HEBREW_CHARSET
Definition: wingdi.h:393
#define SHIFTJIS_CHARSET
Definition: wingdi.h:386
#define EASTEUROPE_CHARSET
Definition: wingdi.h:399
#define GB2312_CHARSET
Definition: wingdi.h:389
#define BALTIC_CHARSET
Definition: wingdi.h:395
#define TURKISH_CHARSET
Definition: wingdi.h:392

Referenced by load_OT_feature().

◆ GPOS_apply_feature()

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

Definition at line 864 of file shape.c.

867{
868 int dir = analysis->fLogicalOrder && analysis->fRTL ? -1 : 1;
869 unsigned int start_idx, i, j;
870
871 TRACE("%i lookups\n", feature->lookup_count);
872
873 start_idx = dir < 0 ? glyph_count - 1 : 0;
874 for (i = 0; i < feature->lookup_count; i++)
875 {
876 for (j = 0; j < glyph_count; )
877 j += OpenType_apply_GPOS_lookup(psc, otm, logfont, analysis, advance,
878 feature->lookups[i], glyphs, start_idx + dir * j, glyph_count, goffset);
879 }
880}
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
unsigned int dir
Definition: maze.c:112
unsigned int OpenType_apply_GPOS_lookup(const ScriptCache *script_cache, const OUTLINETEXTMETRICW *otm, const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, unsigned int lookup_index, const WORD *glyphs, unsigned int glyph_index, unsigned int glyph_count, GOFFSET *goffset)
Definition: opentype.c:2557
WORD fLogicalOrder
Definition: usp10.h:144

Referenced by SHAPE_ApplyOpenTypePositions().

◆ GSUB_apply_feature_all_lookups()

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

Definition at line 546 of file shape.c.

548{
549 int i;
550 int out_index = GSUB_E_NOGLYPH;
551
552 TRACE("%i lookups\n", feature->lookup_count);
553 for (i = 0; i < feature->lookup_count; i++)
554 {
555 out_index = OpenType_apply_GSUB_lookup(header, feature->lookups[i], glyphs, glyph_index, write_dir, glyph_count);
556 if (out_index != GSUB_E_NOGLYPH)
557 break;
558 }
559 if (out_index == GSUB_E_NOGLYPH)
560 TRACE("lookups found no glyphs\n");
561 else
562 {
563 int out2;
564 out2 = GSUB_apply_feature_all_lookups(header, feature, glyphs, glyph_index, write_dir, glyph_count);
565 if (out2!=GSUB_E_NOGLYPH)
566 out_index = out2;
567 }
568 return out_index;
569}

Referenced by apply_GSUB_feature_to_glyph(), Apply_Indic_BasicForm(), and GSUB_apply_feature_all_lookups().

◆ gujarati_lex()

static int gujarati_lex ( WCHAR  c)
static

Definition at line 2502 of file shape.c.

2503{
2504 switch (c)
2505 {
2506 case 0x0AB0: return lex_Ra;
2507 default:
2508 return unicode_lex(c);
2509 }
2510}

Referenced by ContextualShape_Gujarati(), and ShapeCharGlyphProp_Gujarati().

◆ gurmukhi_lex()

static int gurmukhi_lex ( WCHAR  c)
static

Definition at line 2452 of file shape.c.

2453{
2454 if (c == 0x0A71)
2455 return lex_Modifier;
2456 else
2457 return unicode_lex(c);
2458}
@ lex_Modifier

Referenced by ContextualShape_Gurmukhi(), and ShapeCharGlyphProp_Gurmukhi().

◆ insert_glyph()

static void insert_glyph ( WORD pwGlyphs,
INT pcGlyphs,
INT  cChars,
INT  write_dir,
WORD  glyph,
INT  index,
WORD pwLogClust 
)
static

Definition at line 893 of file shape.c.

894{
895 int i;
896 for (i = *pcGlyphs; i>=index; i--)
897 pwGlyphs[i+1] = pwGlyphs[i];
898 pwGlyphs[index] = glyph;
899 *pcGlyphs = *pcGlyphs+1;
900 if (write_dir < 0)
901 UpdateClusters(index-3, 1, write_dir, cChars, pwLogClust);
902 else
903 UpdateClusters(index, 1, write_dir, cChars, pwLogClust);
904}

Referenced by mark_invalid_combinations().

◆ kannada_lex()

static int kannada_lex ( WCHAR  c)
static

Definition at line 2697 of file shape.c.

2698{
2699 switch (c)
2700 {
2701 case 0x0CB0: return lex_Ra;
2702 default:
2703 return unicode_lex(c);
2704 }
2705}

Referenced by ContextualShape_Kannada(), and ShapeCharGlyphProp_Kannada().

◆ khmer_lex()

static int khmer_lex ( WCHAR  c)
static

Definition at line 2794 of file shape.c.

2795{
2796 return unicode_lex(c);
2797}

Referenced by ContextualShape_Khmer(), and ShapeCharGlyphProp_Khmer().

◆ left_join_causing()

static BOOL left_join_causing ( CHAR  joining_type)
inlinestatic

Definition at line 994 of file shape.c.

995{
996 return (joining_type == jtR || joining_type == jtD || joining_type == jtC);
997}

Referenced by ContextualShape_Arabic(), and ContextualShape_Syriac().

◆ load_gdef_table()

static VOID * load_gdef_table ( HDC  hdc)
static

Definition at line 692 of file shape.c.

693{
694 VOID* GDEF_Table = NULL;
695 int length = GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, NULL, 0);
696 if (length != GDI_ERROR)
697 {
698 GDEF_Table = heap_alloc(length);
699 GetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, GDEF_Table, length);
700 TRACE("Loaded GDEF table of %i bytes\n",length);
701 }
702 return GDEF_Table;
703}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
DWORD WINAPI GetFontData(HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer, DWORD cbData)
Definition: font.c:2654

Referenced by load_ot_tables().

◆ load_gpos_table()

static VOID * load_gpos_table ( HDC  hdc)
static

Definition at line 679 of file shape.c.

680{
681 VOID* GPOS_Table = NULL;
682 int length = GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0);
683 if (length != GDI_ERROR)
684 {
685 GPOS_Table = heap_alloc(length);
686 GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length);
687 TRACE("Loaded GPOS table of %i bytes\n",length);
688 }
689 return GPOS_Table;
690}

Referenced by load_ot_tables().

◆ load_gsub_table()

static VOID * load_gsub_table ( HDC  hdc)
static

Definition at line 666 of file shape.c.

667{
668 VOID* GSUB_Table = NULL;
669 int length = GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, 0);
670 if (length != GDI_ERROR)
671 {
672 GSUB_Table = heap_alloc(length);
673 GetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, GSUB_Table, length);
674 TRACE("Loaded GSUB table of %i bytes\n",length);
675 }
676 return GSUB_Table;
677}

Referenced by load_ot_tables().

◆ load_OT_feature()

static LoadedFeature * load_OT_feature ( HDC  hdc,
SCRIPT_ANALYSIS psa,
ScriptCache psc,
char  tableType,
const char feat 
)
static

Definition at line 616 of file shape.c.

617{
619
620 if (psc->GSUB_Table || psc->GPOS_Table)
621 {
622 int attempt = 2;
624 OPENTYPE_TAG language;
625 OPENTYPE_TAG script = 0x00000000;
626 int cTags;
627
628 do
629 {
630 script = get_opentype_script(hdc,psa,psc,(attempt==2));
631 if (psc->userLang != 0)
632 language = psc->userLang;
633 else
634 language = MS_MAKE_TAG('d','f','l','t');
635 attempt--;
636
637 OpenType_GetFontFeatureTags(psc, script, language, FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), tableType, 1, &tags, &cTags, &feature);
638
639 } while(attempt && !feature);
640
641 /* try in the default (latin) table */
642 if (!feature)
643 {
644 if (!script)
645 script = MS_MAKE_TAG('l','a','t','n');
646 OpenType_GetFontFeatureTags(psc, script, MS_MAKE_TAG('d','f','l','t'), FALSE, MS_MAKE_TAG(feat[0],feat[1],feat[2],feat[3]), tableType, 1, &tags, &cTags, &feature);
647 }
648 }
649
650 TRACE("Feature %s located at %p\n",debugstr_an(feat,4),feature);
651 return feature;
652}
const char * tags[7 *8]
Definition: apphelp.c:216
script
Definition: msipriv.h:383
HRESULT OpenType_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, char tableType, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature **feature)
Definition: opentype.c:2872
static OPENTYPE_TAG get_opentype_script(HDC hdc, const SCRIPT_ANALYSIS *psa, const ScriptCache *script_cache, BOOL try_new)
Definition: shape.c:571

Referenced by apply_GSUB_feature(), apply_GSUB_feature_to_glyph(), SHAPE_ApplyOpenTypePositions(), SHAPE_CheckFontForRequiredFeatures(), and ShapeIndicSyllables().

◆ load_ot_tables()

static VOID load_ot_tables ( HDC  hdc,
ScriptCache psc 
)
static

Definition at line 705 of file shape.c.

706{
707 if (!psc->GSUB_Table)
708 psc->GSUB_Table = load_gsub_table(hdc);
709 if (!psc->GPOS_Table)
710 psc->GPOS_Table = load_gpos_table(hdc);
711 if (!psc->GDEF_Table)
712 psc->GDEF_Table = load_gdef_table(hdc);
713}
static VOID * load_gdef_table(HDC hdc)
Definition: shape.c:692
static VOID * load_gpos_table(HDC hdc)
Definition: shape.c:679
static VOID * load_gsub_table(HDC hdc)
Definition: shape.c:666

Referenced by ContextualShape_Arabic(), ContextualShape_Phags_pa(), ContextualShape_Syriac(), SHAPE_ApplyOpenTypeFeatures(), SHAPE_ApplyOpenTypePositions(), SHAPE_CharGlyphProp(), SHAPE_CheckFontForRequiredFeatures(), SHAPE_ContextualShaping(), SHAPE_GetFontFeatureTags(), SHAPE_GetFontLanguageTags(), and SHAPE_GetFontScriptTags().

◆ malayalam_lex()

static int malayalam_lex ( WCHAR  c)
static

Definition at line 2749 of file shape.c.

2750{
2751 return unicode_lex(c);
2752}

Referenced by ContextualShape_Malayalam(), and ShapeCharGlyphProp_Malayalam().

◆ mark_invalid_combinations()

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

Definition at line 906 of file shape.c.

907{
908 CHAR *context_type;
909 int i,g;
910 WCHAR invalid = 0x25cc;
911 WORD invalid_glyph;
912
913 context_type = heap_alloc(cChars);
914
915 /* Mark invalid combinations */
916 for (i = 0; i < cChars; i++)
917 context_type[i] = lex(pwcChars[i]);
918
919 GetGlyphIndicesW(hdc, &invalid, 1, &invalid_glyph, 0);
920 for (i = 1, g=1; i < cChars - 1; i++, g++)
921 {
922 if (context_type[i] != 0 && context_type[i+write_dir]==context_type[i])
923 {
924 insert_glyph(pwGlyphs, pcGlyphs, cChars, write_dir, invalid_glyph, g, pwLogClust);
925 g++;
926 }
927 }
928
929 heap_free(context_type);
930}
static const WCHAR invalid[]
Definition: assoc.c:39
static void insert_glyph(WORD *pwGlyphs, INT *pcGlyphs, INT cChars, INT write_dir, WORD glyph, INT index, WORD *pwLogClust)
Definition: shape.c:893

Referenced by ContextualShape_Arabic(), ContextualShape_Hebrew(), ContextualShape_Lao(), ContextualShape_Syriac(), ContextualShape_Thaana(), and ContextualShape_Thai().

◆ mongolian_wordbreak()

static BOOL mongolian_wordbreak ( WCHAR  chr)
inlinestatic

Definition at line 2828 of file shape.c.

2829{
2830 return ((chr == 0x0020) || (chr == 0x200C) || (chr == 0x202F) || (chr == 0x180E) || (chr == 0x1800) || (chr == 0x1802) || (chr == 0x1803) || (chr == 0x1805) || (chr == 0x1808) || (chr == 0x1809) || (chr == 0x1807));
2831}

Referenced by ContextualShape_Mongolian().

◆ neighbour_char()

static WCHAR neighbour_char ( int  i,
int  delta,
const WCHAR chars,
INT  cchLen 
)
static

Definition at line 952 of file shape.c.

953{
954 if (i + delta < 0)
955 return 0;
956 if ( i+ delta >= cchLen)
957 return 0;
958
959 i += delta;
960
961 return chars[i];
962}

Referenced by ContextualShape_Phags_pa(), and ContextualShape_Syriac().

◆ neighbour_joining_type()

static CHAR neighbour_joining_type ( int  i,
int  delta,
const CHAR context_type,
INT  cchLen,
SCRIPT_ANALYSIS psa 
)
static

Definition at line 964 of file shape.c.

965{
966 if (i + delta < 0)
967 {
968 if (psa->fLinkBefore)
969 return jtR;
970 else
971 return jtU;
972 }
973 if ( i+ delta >= cchLen)
974 {
975 if (psa->fLinkAfter)
976 return jtL;
977 else
978 return jtU;
979 }
980
981 i += delta;
982
983 if (context_type[i] == jtT)
984 return neighbour_joining_type(i,delta,context_type,cchLen,psa);
985 else
986 return context_type[i];
987}

Referenced by ContextualShape_Arabic(), ContextualShape_Syriac(), and neighbour_joining_type().

◆ oriya_lex()

static int oriya_lex ( WCHAR  c)
static

Definition at line 2542 of file shape.c.

2543{
2544 switch (c)
2545 {
2546 case 0x0B30: return lex_Ra;
2547 default:
2548 return unicode_lex(c);
2549 }
2550}

Referenced by ContextualShape_Oriya(), and ShapeCharGlyphProp_Oriya().

◆ Reorder_Like_Bengali()

static void Reorder_Like_Bengali ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1930 of file shape.c.

1931{
1932 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1933 if (s->start == s->base && s->base == s->end) return;
1934 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1935
1936 Reorder_Ra_follows_base(pwChar, s, lexical);
1937 Reorder_Matra_precede_syllable(pwChar, s, lexical);
1938}
GLdouble s
Definition: gl.h:2039
static void Reorder_Ra_follows_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1727
static void Reorder_Matra_precede_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1819
@ lex_Vowel

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

◆ Reorder_Like_Devanagari()

static void Reorder_Like_Devanagari ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1920 of file shape.c.

1921{
1922 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1923 if (s->start == s->base && s->base == s->end) return;
1924 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1925
1926 Reorder_Ra_follows_matra(pwChar, s, lexical);
1927 Reorder_Matra_precede_syllable(pwChar, s, lexical);
1928}
static void Reorder_Ra_follows_matra(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1746

Referenced by ContextualShape_Devanagari(), ContextualShape_Gujarati(), ContextualShape_Khmer(), and ContextualShape_Malayalam().

◆ Reorder_Like_Kannada()

static void Reorder_Like_Kannada ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1940 of file shape.c.

1941{
1942 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1943 if (s->start == s->base && s->base == s->end) return;
1944 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1945
1946 Reorder_Ra_follows_syllable(pwChar, s, lexical);
1947 Reorder_Matra_precede_syllable(pwChar, s, lexical);
1948}
static void Reorder_Ra_follows_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1771

Referenced by ContextualShape_Kannada().

◆ Reorder_Like_Sinhala()

static void Reorder_Like_Sinhala ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1910 of file shape.c.

1911{
1912 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1913 if (s->start == s->base && s->base == s->end) return;
1914 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1915
1916 Reorder_Ra_follows_base(pwChar, s, lexical);
1917 Reorder_Matra_precede_base(pwChar, s, lexical);
1918}
static void Reorder_Matra_precede_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1792

Referenced by ContextualShape_Sinhala().

◆ Reorder_Matra_precede_base()

static void Reorder_Matra_precede_base ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1792 of file shape.c.

1793{
1794 int i;
1795
1796 /* reorder Matras */
1797 if (s->end > s->base)
1798 {
1799 for (i = 1; i <= s->end-s->base; i++)
1800 {
1801 if (lexical(pwChar[s->base+i]) == lex_Matra_pre)
1802 {
1803 int j;
1804 WCHAR c = pwChar[s->base+i];
1805 TRACE("Doing reorder of %x %x\n",c,pwChar[s->base]);
1806 for (j = s->base+i; j > s->base; j--)
1807 pwChar[j] = pwChar[j-1];
1808 pwChar[s->base] = c;
1809
1810 if (s->ralf >= s->base) s->ralf++;
1811 if (s->blwf >= s->base) s->blwf++;
1812 if (s->pref >= s->base) s->pref++;
1813 s->base ++;
1814 }
1815 }
1816 }
1817}
#define c
Definition: ke_i.h:80
@ lex_Matra_pre

Referenced by Reorder_Like_Sinhala().

◆ Reorder_Matra_precede_syllable()

static void Reorder_Matra_precede_syllable ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1819 of file shape.c.

1820{
1821 int i;
1822
1823 /* reorder Matras */
1824 if (s->end > s->base)
1825 {
1826 for (i = 1; i <= s->end-s->base; i++)
1827 {
1828 if (lexical(pwChar[s->base+i]) == lex_Matra_pre)
1829 {
1830 int j;
1831 WCHAR c = pwChar[s->base+i];
1832 TRACE("Doing reorder of %x to %i\n",c,s->start);
1833 for (j = s->base+i; j > s->start; j--)
1834 pwChar[j] = pwChar[j-1];
1835 pwChar[s->start] = c;
1836
1837 if (s->ralf >= 0) s->ralf++;
1838 if (s->blwf >= 0) s->blwf++;
1839 if (s->pref >= 0) s->pref++;
1840 s->base ++;
1841 }
1842 }
1843 }
1844}

Referenced by Reorder_Like_Bengali(), Reorder_Like_Devanagari(), and Reorder_Like_Kannada().

◆ Reorder_Ra_follows_base()

static void Reorder_Ra_follows_base ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1727 of file shape.c.

1728{
1729 if (s->ralf >= 0)
1730 {
1731 int j;
1732 WORD Ra = pwChar[s->start];
1733 WORD H = pwChar[s->start+1];
1734
1735 TRACE("Doing reorder of Ra to %i\n",s->base);
1736 for (j = s->start; j < s->base-1; j++)
1737 pwChar[j] = pwChar[j+2];
1738 pwChar[s->base-1] = Ra;
1739 pwChar[s->base] = H;
1740
1741 s->ralf = s->base-1;
1742 s->base -= 2;
1743 }
1744}
#define H

Referenced by Reorder_Like_Bengali(), and Reorder_Like_Sinhala().

◆ Reorder_Ra_follows_matra()

static void Reorder_Ra_follows_matra ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1746 of file shape.c.

1747{
1748 if (s->ralf >= 0)
1749 {
1750 int j,loc;
1751 int stop = (s->blwf >=0)? s->blwf+1 : s->base;
1752 WORD Ra = pwChar[s->start];
1753 WORD H = pwChar[s->start+1];
1754 for (loc = s->end; loc > stop; loc--)
1755 if (lexical(pwChar[loc]) == lex_Matra_post || lexical(pwChar[loc]) == lex_Matra_below)
1756 break;
1757
1758 TRACE("Doing reorder of Ra to %i\n",loc);
1759 for (j = s->start; j < loc-1; j++)
1760 pwChar[j] = pwChar[j+2];
1761 pwChar[loc-1] = Ra;
1762 pwChar[loc] = H;
1763
1764 s->ralf = loc-1;
1765 s->base -= 2;
1766 if (s->blwf >= 0) s->blwf -= 2;
1767 if (s->pref >= 0) s->pref -= 2;
1768 }
1769}
#define for
Definition: utility.h:88
@ lex_Matra_below
@ lex_Matra_post

Referenced by Reorder_Like_Devanagari().

◆ Reorder_Ra_follows_syllable()

static void Reorder_Ra_follows_syllable ( WCHAR pwChar,
IndicSyllable s,
lexical_function  lexical 
)
static

Definition at line 1771 of file shape.c.

1772{
1773 if (s->ralf >= 0)
1774 {
1775 int j;
1776 WORD Ra = pwChar[s->start];
1777 WORD H = pwChar[s->start+1];
1778
1779 TRACE("Doing reorder of Ra to %i\n",s->end-1);
1780 for (j = s->start; j < s->end-1; j++)
1781 pwChar[j] = pwChar[j+2];
1782 pwChar[s->end-1] = Ra;
1783 pwChar[s->end] = H;
1784
1785 s->ralf = s->end-1;
1786 s->base -= 2;
1787 if (s->blwf >= 0) s->blwf -= 2;
1788 if (s->pref >= 0) s->pref -= 2;
1789 }
1790}

Referenced by Reorder_Like_Kannada().

◆ ReplaceInsertChars()

static void ReplaceInsertChars ( HDC  hdc,
INT  cWalk,
INT pcChars,
WCHAR pwOutChars,
const WCHAR replacements 
)
static

Definition at line 1651 of file shape.c.

1652{
1653 int i;
1654
1655 /* Replace */
1656 pwOutChars[cWalk] = replacements[0];
1657 cWalk=cWalk+1;
1658
1659 /* Insert */
1660 for (i = 1; i < 3 && replacements[i] != 0x0000; i++)
1661 {
1662 int j;
1663 for (j = *pcChars; j > cWalk; j--)
1664 pwOutChars[j] = pwOutChars[j-1];
1665 *pcChars= *pcChars+1;
1666 pwOutChars[cWalk] = replacements[i];
1667 cWalk = cWalk+1;
1668 }
1669}

Referenced by DecomposeVowels().

◆ right_join_causing()

static BOOL right_join_causing ( CHAR  joining_type)
inlinestatic

Definition at line 989 of file shape.c.

990{
991 return (joining_type == jtL || joining_type == jtD || joining_type == jtC);
992}

Referenced by ContextualShape_Arabic(), and ContextualShape_Syriac().

◆ SecondReorder_Blwf_follows_matra()

static void SecondReorder_Blwf_follows_matra ( const WCHAR chars,
const IndicSyllable s,
WORD glyphs,
const IndicSyllable g,
lexical_function  lexical 
)
static

Definition at line 1846 of file shape.c.

1848{
1849 if (s->blwf >= 0 && g->blwf > g->base)
1850 {
1851 int j,loc;
1852 int g_offset;
1853 for (loc = s->end; loc > s->blwf; loc--)
1854 if (lexical(chars[loc]) == lex_Matra_below || lexical(chars[loc]) == lex_Matra_above
1855 || lexical(chars[loc]) == lex_Matra_post)
1856 break;
1857
1858 g_offset = (loc - s->blwf) - 1;
1859
1860 if (loc != s->blwf)
1861 {
1862 WORD blwf = glyphs[g->blwf];
1863 TRACE("Doing reorder of Below-base to %i (glyph offset %i)\n",loc,g_offset);
1864 /* do not care about the pwChar array anymore, just the glyphs */
1865 for (j = 0; j < g_offset; j++)
1866 glyphs[g->blwf + j] = glyphs[g->blwf + j + 1];
1867 glyphs[g->blwf + g_offset] = blwf;
1868 }
1869 }
1870}
@ lex_Matra_above

Referenced by SecondReorder_Like_Telugu().

◆ SecondReorder_Like_Tamil()

static void SecondReorder_Like_Tamil ( const WCHAR chars,
const IndicSyllable s,
WORD glyphs,
const IndicSyllable g,
lexical_function  lexical 
)
static

Definition at line 1961 of file shape.c.

1963{
1964 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1965 TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
1966 if (s->start == s->base && s->base == s->end) return;
1967 if (lexical(chars[s->base]) == lex_Vowel) return;
1968
1969 SecondReorder_Matra_precede_base(chars, s, glyphs, g, lexical);
1971}
static void SecondReorder_Pref_precede_base(const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1896
static void SecondReorder_Matra_precede_base(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1872

Referenced by ContextualShape_Malayalam(), and ContextualShape_Tamil().

◆ SecondReorder_Like_Telugu()

static void SecondReorder_Like_Telugu ( const WCHAR chars,
const IndicSyllable s,
WORD glyphs,
const IndicSyllable g,
lexical_function  lexical 
)
static

Definition at line 1950 of file shape.c.

1952{
1953 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1954 TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
1955 if (s->start == s->base && s->base == s->end) return;
1956 if (lexical(chars[s->base]) == lex_Vowel) return;
1957
1958 SecondReorder_Blwf_follows_matra(chars, s, glyphs, g, lexical);
1959}
static void SecondReorder_Blwf_follows_matra(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1846

Referenced by ContextualShape_Kannada(), and ContextualShape_Telugu().

◆ SecondReorder_Matra_precede_base()

static void SecondReorder_Matra_precede_base ( const WCHAR chars,
const IndicSyllable s,
WORD glyphs,
const IndicSyllable g,
lexical_function  lexical 
)
static

Definition at line 1872 of file shape.c.

1874{
1875 int i;
1876
1877 /* reorder previously moved Matras to correct position*/
1878 for (i = s->start; i < s->base; i++)
1879 {
1880 if (lexical(chars[i]) == lex_Matra_pre)
1881 {
1882 int j;
1883 int g_start = g->start + i - s->start;
1884 if (g_start < g->base -1 )
1885 {
1886 WCHAR og = glyphs[g_start];
1887 TRACE("Doing reorder of matra from %i to %i\n",g_start,g->base);
1888 for (j = g_start; j < g->base-1; j++)
1889 glyphs[j] = glyphs[j+1];
1890 glyphs[g->base-1] = og;
1891 }
1892 }
1893 }
1894}

Referenced by SecondReorder_Like_Tamil().

◆ SecondReorder_Pref_precede_base()

static void SecondReorder_Pref_precede_base ( const IndicSyllable s,
WORD glyphs,
const IndicSyllable g,
lexical_function  lexical 
)
static

Definition at line 1896 of file shape.c.

1898{
1899 if (s->pref >= 0 && g->pref > g->base)
1900 {
1901 int j;
1902 WCHAR og = glyphs[g->pref];
1903 TRACE("Doing reorder of pref from %i to %i\n",g->pref,g->base);
1904 for (j = g->pref; j > g->base; j--)
1905 glyphs[j] = glyphs[j-1];
1906 glyphs[g->base] = og;
1907 }
1908}

Referenced by SecondReorder_Like_Tamil().

◆ SHAPE_ApplyDefaultOpentypeFeatures()

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

Definition at line 3421 of file shape.c.

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

Referenced by ScriptShapeOpenType().

◆ SHAPE_ApplyOpenTypeFeatures()

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 
)
static

Definition at line 3396 of file shape.c.

3397{
3398 int i;
3399 INT dirL;
3400
3401 if (!rpRangeProperties)
3402 return;
3403
3405
3406 if (!psc->GSUB_Table)
3407 return;
3408
3409 if (scriptInformation[psa->eScript].a.fRTL && (!psa->fLogicalOrder || !psa->fRTL))
3410 dirL = -1;
3411 else
3412 dirL = 1;
3413
3414 for (i = 0; i < rpRangeProperties->cotfRecords; i++)
3415 {
3416 if (rpRangeProperties->potfRecords[i].lParameter > 0)
3417 apply_GSUB_feature(hdc, psa, psc, pwOutGlyphs, dirL, pcGlyphs, cChars, (const char*)&rpRangeProperties->potfRecords[i].tagFeature, pwLogClust);
3418 }
3419}
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)
Definition: shape.c:823
SCRIPT_ANALYSIS a

Referenced by SHAPE_ApplyDefaultOpentypeFeatures().

◆ SHAPE_ApplyOpenTypePositions()

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

Definition at line 3429 of file shape.c.

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

Referenced by ScriptPlaceOpenType().

◆ SHAPE_CharGlyphProp()

void SHAPE_CharGlyphProp ( HDC  hdc,
ScriptCache psc,
SCRIPT_ANALYSIS psa,
const WCHAR pwcChars,
const INT  cChars,
const WORD pwGlyphs,
const INT  cGlyphs,
WORD pwLogClust,
SCRIPT_CHARPROP pCharProp,
SCRIPT_GLYPHPROP pGlyphProp 
)

Definition at line 3378 of file shape.c.

3379{
3381
3382 if (ShapingData[psa->eScript].charGlyphPropProc)
3383 ShapingData[psa->eScript].charGlyphPropProc(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3384 else
3385 ShapeCharGlyphProp_Default(psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3386}
static void ShapeCharGlyphProp_Default(ScriptCache *p