ReactOS 0.4.17-dev-934-g091855f
shape.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "ntgdi.h"
#include "winerror.h"
#include "winuser.h"
#include "winnls.h"
#include "usp10.h"
#include "winternl.h"
#include "usp10_internal.h"
#include "wine/debug.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 HRESULT(* 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 = 0 , jtL = 1 , jtR = 2 , jtD = 3 ,
  jtC = jtD , jgALAPH = 4 , jgDALATH_RISH = 5 , jtT = 6
}
 
enum  joined_forms {
  Xn =0 , Xr , Xl , Xm ,
  Afj , Afn , Afx
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (uniscribe)
 
static HRESULT ContextualShape_Control (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Arabic (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Hebrew (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Syriac (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Thaana (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Phags_pa (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Thai (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Lao (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Sinhala (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Devanagari (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Bengali (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Gurmukhi (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Gujarati (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Oriya (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Tamil (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Telugu (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Kannada (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Malayalam (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT ContextualShape_Khmer (HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR *pwcChars, INT cChars, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
 
static HRESULT 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 LoadedFeature * load_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 VOID * load_gsub_table (HDC hdc)
 
static VOID * load_gpos_table (HDC hdc)
 
static VOID * load_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 HRESULT insert_glyph (WORD *pwGlyphs, INT *pcGlyphs, INT cChars, INT write_dir, WORD glyph, INT index, WORD *pwLogClust, INT maxGlyphs)
 
static HRESULT mark_invalid_combinations (HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, INT maxGlyphs, 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_indices (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)
 
HRESULT 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 []
 
const unsigned short wine_shaping_table []
 
const unsigned short wine_shaping_forms [LAST_ARABIC_CHAR - FIRST_ARABIC_CHAR+1][4]
 
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 1323 of file shape.c.

◆ DALATH

#define DALATH   0x715

Definition at line 1324 of file shape.c.

◆ FIRST_ARABIC_CHAR

#define FIRST_ARABIC_CHAR   0x0600

Definition at line 44 of file shape.c.

◆ LAST_ARABIC_CHAR

#define LAST_ARABIC_CHAR   0x06ff

Definition at line 45 of file shape.c.

◆ phags_pa_CANDRABINDU

#define phags_pa_CANDRABINDU   0xA873

Definition at line 1486 of file shape.c.

◆ phags_pa_END

#define phags_pa_END   0xA87F

Definition at line 1488 of file shape.c.

◆ phags_pa_START

#define phags_pa_START   0xA840

Definition at line 1487 of file shape.c.

◆ RISH

#define RISH   0x72A

Definition at line 1325 of file shape.c.

Typedef Documentation

◆ combining_lexical_function

typedef int(* combining_lexical_function) (WCHAR c)

Definition at line 135 of file shape.c.

◆ ConsonantComponents

◆ ContextualShapingProc

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

Definition at line 47 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 132 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 71 of file shape.c.

◆ VowelComponents

Enumeration Type Documentation

◆ joined_forms

Enumerator
Xn 
Xr 
Xl 
Xm 
Afj 
Afn 
Afx 

Definition at line 109 of file shape.c.

109 {
110 Xn=0,
111 Xr,
112 Xl,
113 Xm,
114 /* Syriac Alaph */
115 Afj,
116 Afn,
117 Afx
118};
@ Xn
Definition: shape.c:110
@ Xm
Definition: shape.c:113
@ Xr
Definition: shape.c:111
@ Xl
Definition: shape.c:112
@ Afx
Definition: shape.c:117
@ Afn
Definition: shape.c:116
@ Afj
Definition: shape.c:115

◆ joining_types

Enumerator
jtU 
jtL 
jtR 
jtD 
jtC 
jgALAPH 
jgDALATH_RISH 
jtT 

Definition at line 97 of file shape.c.

98{
99 jtU = 0,
100 jtL = 1,
101 jtR = 2,
102 jtD = 3,
103 jtC = jtD,
104 jgALAPH = 4,
105 jgDALATH_RISH = 5,
106 jtT = 6,
107};
@ jtL
Definition: shape.c:100
@ jtC
Definition: shape.c:103
@ jtD
Definition: shape.c:102
@ jtT
Definition: shape.c:106
@ jgDALATH_RISH
Definition: shape.c:105
@ jgALAPH
Definition: shape.c:104
@ jtU
Definition: shape.c:99
@ jtR
Definition: shape.c:101

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

832{
833 if (psc->GSUB_Table)
834 {
836 int lookup_index;
837
838 feature = load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, feat);
839 if (!feature)
840 return GSUB_E_NOFEATURE;
841
842 TRACE("applying feature %s: %i lookups\n",debugstr_an(feat,4),feature->lookup_count);
843 for (lookup_index = 0; lookup_index < feature->lookup_count; lookup_index++)
844 {
845 int i;
846
847 if (write_dir > 0)
848 i = 0;
849 else
850 i = *pcGlyphs-1;
851 TRACE("applying lookup (%i/%i)\n",lookup_index,feature->lookup_count);
852 while(i < *pcGlyphs && i >= 0)
853 {
854 INT nextIndex;
855 INT prevCount = *pcGlyphs;
856
857 nextIndex = OpenType_apply_GSUB_lookup(psc->GSUB_Table, feature->lookups[lookup_index], pwOutGlyphs, i, write_dir, pcGlyphs);
858 if (*pcGlyphs != prevCount)
859 {
860 UpdateClusters(nextIndex, *pcGlyphs - prevCount, write_dir, cChars, pwLogClust);
861 i = nextIndex;
862 }
863 else
864 i+=write_dir;
865 }
866 }
867 return *pcGlyphs;
868 }
869 return GSUB_E_NOFEATURE;
870}
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:1807
#define TRACE(s)
Definition: solgame.cpp:4
void * GSUB_Table
int32_t INT
Definition: typedefs.h:58
#define GSUB_E_NOFEATURE
#define FEATURE_GSUB_TABLE
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:1544
static LoadedFeature * load_OT_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, char tableType, const char *feat)
Definition: shape.c:624
static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int chars, WORD *pwLogClust)
Definition: shape.c:766
_In_ INT _In_ INT cChars
Definition: winddi.h:1486

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

663{
665
666 feature = load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, feat);
667 if (!feature)
668 return GSUB_E_NOFEATURE;
669
670 TRACE("applying feature %s\n",feat);
671 return GSUB_apply_feature_all_lookups(psc->GSUB_Table, feature, glyphs, index, write_dir, glyph_count);
672}
GLuint index
Definition: glext.h:6031
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:554

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

2013{
2014 int index = glyph_index->start;
2015
2016 if (!feature)
2017 return;
2018
2019 while(index <= glyph_index->end)
2020 {
2021 INT nextIndex;
2022 INT prevCount = *pcGlyphs;
2023 nextIndex = GSUB_apply_feature_all_lookups(psc->GSUB_Table, feature, pwOutGlyphs, index, 1, pcGlyphs);
2024 if (nextIndex > GSUB_E_NOGLYPH)
2025 {
2026 UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2027 shift_syllable_glyph_indices(glyph_index,index,*pcGlyphs - prevCount);
2028 index = nextIndex;
2029 }
2030 else
2031 index++;
2032 }
2033}
GLuint GLuint end
Definition: gl.h:1545
#define GSUB_E_NOGLYPH
static void shift_syllable_glyph_indices(IndicSyllable *glyph_index, INT index, INT shift)
Definition: shape.c:1993

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

2101{
2102 INT index, nextIndex;
2103 INT count, g_offset=0;
2104 INT ralf = syllable->ralf;
2105
2106 count = syllable->end - syllable->base;
2107
2108 index = find_halant_consonant(&pwChars[syllable->base], 0, count, lexical);
2109
2110 while (index >= 0)
2111 {
2112 INT prevCount = *pcGlyphs;
2113 if (ralf >=0 && ralf < index)
2114 {
2115 g_offset--;
2116 ralf = -1;
2117 }
2118
2119 if (!modern)
2120 {
2121 WORD g = pwOutGlyphs[index+glyph_index->base+g_offset];
2122 pwOutGlyphs[index+glyph_index->base+g_offset] = pwOutGlyphs[index+glyph_index->base+g_offset+1];
2123 pwOutGlyphs[index+glyph_index->base+g_offset+1] = g;
2124 }
2125
2126 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, index+glyph_index->base+g_offset, 1, pcGlyphs, feat);
2127 if (nextIndex > GSUB_E_NOGLYPH)
2128 {
2129 UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2130 shift_syllable_glyph_indices(glyph_index,index+glyph_index->start+g_offset, (*pcGlyphs - prevCount));
2131 g_offset += (*pcGlyphs - prevCount);
2132 }
2133 else if (!modern)
2134 {
2135 WORD g = pwOutGlyphs[index+glyph_index->base+g_offset];
2136 pwOutGlyphs[index+glyph_index->base+g_offset] = pwOutGlyphs[index+glyph_index->base+g_offset+1];
2137 pwOutGlyphs[index+glyph_index->base+g_offset+1] = g;
2138 }
2139
2140 index+=2;
2141 index = find_halant_consonant(&pwChars[syllable->base], index, count, lexical);
2142 }
2143}
#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:2087
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:662

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

2047{
2048 INT index, nextIndex;
2049 INT count,g_offset;
2050
2051 count = syllable->base - syllable->start;
2052
2053 g_offset = 0;
2054 index = find_consonant_halant(&pwChars[syllable->start], 0, count, lexical);
2055 while (index >= 0 && index + g_offset < (glyph_index->base - glyph_index->start))
2056 {
2057 INT prevCount = *pcGlyphs;
2058 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, index+glyph_index->start+g_offset, 1, pcGlyphs, feature);
2059 if (nextIndex > GSUB_E_NOGLYPH)
2060 {
2061 UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2062 shift_syllable_glyph_indices(glyph_index, index + glyph_index->start + g_offset, (*pcGlyphs - prevCount));
2063 g_offset += (*pcGlyphs - prevCount);
2064 }
2065
2066 index+=2;
2067 index = find_consonant_halant(&pwChars[syllable->start], index, count, lexical);
2068 }
2069}
static INT find_consonant_halant(WCHAR *pwChars, INT index, INT end, lexical_function lexical)
Definition: shape.c:2035

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

2072{
2073 INT nextIndex;
2074 INT prevCount = *pcGlyphs;
2075
2076 if (syllable->ralf >= 0)
2077 {
2078 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index->ralf, 1, pcGlyphs, "rphf");
2079 if (nextIndex > GSUB_E_NOGLYPH)
2080 {
2081 UpdateClusters(nextIndex, *pcGlyphs - prevCount, 1, cChars, pwLogClust);
2082 shift_syllable_glyph_indices(glyph_index,glyph_index->ralf,*pcGlyphs - prevCount);
2083 }
2084 }
2085}

Referenced by ShapeIndicSyllables().

◆ bengali_lex()

static int bengali_lex ( WCHAR  c)
static

Definition at line 2406 of file shape.c.

2407{
2408 switch (c)
2409 {
2410 case 0x09B0: return lex_Ra;
2411 default:
2412 return unicode_lex(c);
2413 }
2414}
const GLubyte * c
Definition: glext.h:8905
@ lex_Ra
static int unicode_lex(WCHAR c)
Definition: shape.c:2227

Referenced by ContextualShape_Bengali(), and ShapeCharGlyphProp_Bengali().

◆ combining_lexical_Arabic()

static int combining_lexical_Arabic ( WCHAR  c)
static

Definition at line 1023 of file shape.c.

1024{
1025 enum {Arab_Norm = 0, Arab_DIAC1, Arab_DIAC2, Arab_DIAC3, Arab_DIAC4, Arab_DIAC5, Arab_DIAC6, Arab_DIAC7, Arab_DIAC8};
1026
1027 switch(c)
1028 {
1029 case 0x064B:
1030 case 0x064C:
1031 case 0x064E:
1032 case 0x064F:
1033 case 0x0652:
1034 case 0x0657:
1035 case 0x0658:
1036 case 0x06E1: return Arab_DIAC1;
1037 case 0x064D:
1038 case 0x0650:
1039 case 0x0656: return Arab_DIAC2;
1040 case 0x0651: return Arab_DIAC3;
1041 case 0x0610:
1042 case 0x0611:
1043 case 0x0612:
1044 case 0x0613:
1045 case 0x0614:
1046 case 0x0659:
1047 case 0x06D6:
1048 case 0x06DC:
1049 case 0x06DF:
1050 case 0x06E0:
1051 case 0x06E2:
1052 case 0x06E4:
1053 case 0x06E7:
1054 case 0x06E8:
1055 case 0x06EB:
1056 case 0x06EC: return Arab_DIAC4;
1057 case 0x06E3:
1058 case 0x06EA:
1059 case 0x06ED: return Arab_DIAC5;
1060 case 0x0670: return Arab_DIAC6;
1061 case 0x0653: return Arab_DIAC7;
1062 case 0x0655:
1063 case 0x0654: return Arab_DIAC8;
1064 default: return Arab_Norm;
1065 }
1066}

Referenced by ContextualShape_Arabic().

◆ combining_lexical_Hebrew()

static int combining_lexical_Hebrew ( WCHAR  c)
static

Definition at line 1196 of file shape.c.

1197{
1198 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};
1199
1200 switch(c)
1201 {
1202 case 0x05B0:
1203 case 0x05B1:
1204 case 0x05B2:
1205 case 0x05B3:
1206 case 0x05B4:
1207 case 0x05B5:
1208 case 0x05B6:
1209 case 0x05BB: return Hebr_DIAC;
1210 case 0x0599:
1211 case 0x05A1:
1212 case 0x05A9:
1213 case 0x05AE: return Hebr_CANT1;
1214 case 0x0597:
1215 case 0x05A8:
1216 case 0x05AC: return Hebr_CANT2;
1217 case 0x0592:
1218 case 0x0593:
1219 case 0x0594:
1220 case 0x0595:
1221 case 0x05A7:
1222 case 0x05AB: return Hebr_CANT3;
1223 case 0x0598:
1224 case 0x059C:
1225 case 0x059E:
1226 case 0x059F: return Hebr_CANT4;
1227 case 0x059D:
1228 case 0x05A0: return Hebr_CANT5;
1229 case 0x059B:
1230 case 0x05A5: return Hebr_CANT6;
1231 case 0x0591:
1232 case 0x05A3:
1233 case 0x05A6: return Hebr_CANT7;
1234 case 0x0596:
1235 case 0x05A4:
1236 case 0x05AA: return Hebr_CANT8;
1237 case 0x059A:
1238 case 0x05AD: return Hebr_CANT9;
1239 case 0x05AF: return Hebr_CANT10;
1240 case 0x05BC: return Hebr_DAGESH;
1241 case 0x05C4: return Hebr_DOTABV;
1242 case 0x05B9: return Hebr_HOLAM;
1243 case 0x05BD: return Hebr_METEG;
1244 case 0x05B7: return Hebr_PATAH;
1245 case 0x05B8: return Hebr_QAMATS;
1246 case 0x05BF: return Hebr_RAFE;
1247 case 0x05C1:
1248 case 0x05C2: return Hebr_SHINSIN;
1249 default: return Hebr_Norm;
1250 }
1251}

Referenced by ContextualShape_Hebrew().

◆ combining_lexical_Lao()

static int combining_lexical_Lao ( WCHAR  c)
static

Definition at line 1626 of file shape.c.

1627{
1628 enum {Lao_Norm=0, Lao_ABOVE1, Lao_ABOVE2, Lao_BELOW1, Lao_BELOW2, Lao_AM};
1629
1630 switch(c)
1631 {
1632 case 0xEB1:
1633 case 0xEB4:
1634 case 0xEB5:
1635 case 0xEB6:
1636 case 0xEB7:
1637 case 0xEBB:
1638 case 0xECD: return Lao_ABOVE1;
1639 case 0xEC8:
1640 case 0xEC9:
1641 case 0xECA:
1642 case 0xECB:
1643 case 0xECC: return Lao_ABOVE2;
1644 case 0xEBC: return Lao_BELOW1;
1645 case 0xEB8:
1646 case 0xEB9: return Lao_BELOW2;
1647 case 0xEB3: return Lao_AM;
1648 default: return Lao_Norm;
1649 }
1650}

Referenced by ContextualShape_Lao().

◆ combining_lexical_Syriac()

static int combining_lexical_Syriac ( WCHAR  c)
static

Definition at line 1275 of file shape.c.

1276{
1277 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};
1278
1279 switch(c)
1280 {
1281 case 0x730:
1282 case 0x733:
1283 case 0x736:
1284 case 0x73A:
1285 case 0x73D: return Syriac_DIAC1;
1286 case 0x731:
1287 case 0x734:
1288 case 0x737:
1289 case 0x73B:
1290 case 0x73E: return Syriac_DIAC2;
1291 case 0x740:
1292 case 0x749:
1293 case 0x74A: return Syriac_DIAC3;
1294 case 0x732:
1295 case 0x735:
1296 case 0x73F: return Syriac_DIAC4;
1297 case 0x738:
1298 case 0x739:
1299 case 0x73C: return Syriac_DIAC5;
1300 case 0x741:
1301 case 0x30A: return Syriac_DIAC6;
1302 case 0x742:
1303 case 0x325: return Syriac_DIAC7;
1304 case 0x747:
1305 case 0x303: return Syriac_DIAC8;
1306 case 0x748:
1307 case 0x32D:
1308 case 0x32E:
1309 case 0x330:
1310 case 0x331: return Syriac_DIAC9;
1311 case 0x308: return Syriac_DIAC10;
1312 case 0x304: return Syriac_DIAC11;
1313 case 0x307: return Syriac_DIAC12;
1314 case 0x323: return Syriac_DIAC13;
1315 case 0x743: return Syriac_DIAC14;
1316 case 0x744: return Syriac_DIAC15;
1317 case 0x745: return Syriac_DIAC16;
1318 case 0x746: return Syriac_DIAC17;
1319 default: return Syriac_Norm;
1320 }
1321}

Referenced by ContextualShape_Syriac().

◆ combining_lexical_Thaana()

static int combining_lexical_Thaana ( WCHAR  c)
static

Definition at line 1444 of file shape.c.

1445{
1446 enum {Thaana_Norm=0, Thaana_FILI};
1447
1448 switch(c)
1449 {
1450 case 0x7A6:
1451 case 0x7A7:
1452 case 0x7A8:
1453 case 0x7A9:
1454 case 0x7AA:
1455 case 0x7AB:
1456 case 0x7AC:
1457 case 0x7AD:
1458 case 0x7AE:
1459 case 0x7AF: return Thaana_FILI;
1460 default: return Thaana_Norm;
1461 }
1462}

Referenced by ContextualShape_Thaana().

◆ combining_lexical_Thai()

static int combining_lexical_Thai ( WCHAR  c)
static

Definition at line 1581 of file shape.c.

1582{
1583 enum {Thai_Norm=0, Thai_ABOVE1, Thai_ABOVE2, Thai_ABOVE3, Thai_ABOVE4, Thai_BELOW1, Thai_BELOW2, Thai_AM};
1584
1585 switch(c)
1586 {
1587 case 0xE31:
1588 case 0xE34:
1589 case 0xE35:
1590 case 0xE36:
1591 case 0xE37: return Thai_ABOVE1;
1592 case 0xE47:
1593 case 0xE4D: return Thai_ABOVE2;
1594 case 0xE48:
1595 case 0xE49:
1596 case 0xE4A:
1597 case 0xE4B: return Thai_ABOVE3;
1598 case 0xE4C:
1599 case 0xE4E: return Thai_ABOVE4;
1600 case 0xE38:
1601 case 0xE39: return Thai_BELOW1;
1602 case 0xE3A: return Thai_BELOW2;
1603 case 0xE33: return Thai_AM;
1604 default: return Thai_Norm;
1605 }
1606}

Referenced by ContextualShape_Thai().

◆ ComposeConsonants()

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

Definition at line 1712 of file shape.c.

1713{
1714 int i;
1715 int offset = 0;
1716 int cWalk;
1717
1718 for (cWalk = 0; cWalk < *pcChars; cWalk += 2)
1719 {
1720 for (i = 0; consonants[i].output!= 0x0; i++)
1721 {
1722 int j;
1723 for (j = 0; j + cWalk < *pcChars && consonants[i].parts[j]!=0x0; j++)
1724 if (pwOutChars[cWalk+j] != consonants[i].parts[j])
1725 break;
1726
1727 if (consonants[i].parts[j]==0x0) /* matched all */
1728 {
1729 int k;
1730 j--;
1731 pwOutChars[cWalk] = consonants[i].output;
1732 for(k = cWalk+1; k < *pcChars - j; k++)
1733 pwOutChars[k] = pwOutChars[k+j];
1734 *pcChars = *pcChars - j;
1735 for (k = j ; k > 0; k--)
1736 pwLogClust[cWalk + k + offset] = pwLogClust[cWalk + offset];
1737 offset += j;
1738 for (k = cWalk + j + offset; k < *pcChars + offset; k++)
1739 pwLogClust[k]--;
1740 break;
1741 }
1742 }
1743 }
1744}
std::map< E_STRING, PART_TEST > parts
Definition: LocaleTests.cpp:69
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
int k
Definition: mpi.c:3369

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

◆ ContextualShape_Arabic()

static HRESULT 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 1071 of file shape.c.

1072{
1073 CHAR *context_type;
1074 INT *context_shape;
1075 INT dirR, dirL;
1076 int i;
1077 int char_index;
1078 int glyph_index;
1079
1080 if (*pcGlyphs != cChars)
1081 {
1082 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1083 return E_INVALIDARG;
1084 }
1085
1086 if (psa->fLogicalOrder && psa->fRTL)
1087 {
1088 dirR = -1;
1089 dirL = 1;
1090 }
1091 else
1092 {
1093 dirR = 1;
1094 dirL = -1;
1095 }
1096
1097 load_ot_tables(hdc, psc);
1098
1099 context_type = malloc(cChars);
1100 context_shape = malloc(cChars * sizeof(*context_shape));
1101
1102 for (i = 0; i < cChars; i++)
1103 context_type[i] = get_table_entry_16( wine_shaping_table, pwcChars[i] );
1104
1105 for (i = 0; i < cChars; i++)
1106 {
1107 if (context_type[i] == jtR && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1108 context_shape[i] = Xr;
1109 else if (context_type[i] == jtL && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1110 context_shape[i] = Xl;
1111 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)))
1112 context_shape[i] = Xm;
1113 else if (context_type[i] == jtD && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1114 context_shape[i] = Xr;
1115 else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1116 context_shape[i] = Xl;
1117 else
1118 context_shape[i] = Xn;
1119 }
1120
1121 /* Contextual Shaping */
1122 if (dirL > 0)
1123 char_index = glyph_index = 0;
1124 else
1125 char_index = glyph_index = cChars-1;
1126
1127 while(char_index < cChars && char_index >= 0)
1128 {
1129 BOOL shaped = FALSE;
1130
1131 if (psc->GSUB_Table)
1132 {
1133 INT nextIndex, offset = 0;
1134 INT prevCount = *pcGlyphs;
1135
1136 /* Apply CCMP first */
1137 apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, "ccmp");
1138
1139 if (prevCount != *pcGlyphs)
1140 {
1141 offset = *pcGlyphs - prevCount;
1142 if (dirL < 0)
1143 glyph_index -= offset * dirL;
1144 }
1145
1146 /* Apply the contextual feature */
1147 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1148
1149 if (nextIndex > GSUB_E_NOGLYPH)
1150 {
1151 UpdateClusters(glyph_index, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1152 char_index += dirL;
1153 if (!offset)
1154 glyph_index = nextIndex;
1155 else
1156 {
1157 offset = *pcGlyphs - prevCount;
1158 glyph_index += dirL * (offset + 1);
1159 }
1160 shaped = TRUE;
1161 }
1162 else if (nextIndex == GSUB_E_NOGLYPH)
1163 {
1164 char_index += dirL;
1165 glyph_index += dirL;
1166 shaped = TRUE;
1167 }
1168 }
1169
1170 if (!shaped)
1171 {
1172 if (context_shape[char_index] == Xn)
1173 {
1174 WORD newGlyph = pwOutGlyphs[glyph_index];
1175 if (pwcChars[char_index] >= FIRST_ARABIC_CHAR && pwcChars[char_index] <= LAST_ARABIC_CHAR)
1176 {
1177 /* fall back to presentation form B */
1178 WCHAR context_char = wine_shaping_forms[pwcChars[char_index] - FIRST_ARABIC_CHAR][context_shape[char_index]];
1179 if (context_char != pwcChars[char_index] &&
1180 NtGdiGetGlyphIndicesW(hdc, &context_char, 1, &newGlyph, 0) != GDI_ERROR &&
1181 newGlyph != 0x0000)
1182 pwOutGlyphs[glyph_index] = newGlyph;
1183 }
1184 }
1185 char_index += dirL;
1186 glyph_index += dirL;
1187 }
1188 }
1189
1190 free(context_shape);
1191 free(context_type);
1192
1193 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Arabic);
1194}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static unsigned short get_table_entry_16(const unsigned short *table, WCHAR ch)
unsigned int BOOL
Definition: ntddk_ex.h:94
short WCHAR
Definition: pedump.c:58
char CHAR
Definition: pedump.c:57
WORD fLogicalOrder
Definition: usp10.h:144
#define LAST_ARABIC_CHAR
Definition: shape.c:45
const unsigned short wine_shaping_forms[LAST_ARABIC_CHAR - FIRST_ARABIC_CHAR+1][4]
Definition: shaping.c:279
static int combining_lexical_Arabic(WCHAR c)
Definition: shape.c:1023
static const char *const contextual_features[]
Definition: shape.c:138
static CHAR neighbour_joining_type(int i, int delta, const CHAR *context_type, INT cchLen, SCRIPT_ANALYSIS *psa)
Definition: shape.c:980
static BOOL right_join_causing(CHAR joining_type)
Definition: shape.c:1005
const unsigned short wine_shaping_table[]
Definition: shaping.c:7
static HRESULT mark_invalid_combinations(HDC hdc, const WCHAR *pwcChars, INT cChars, WORD *pwGlyphs, INT *pcGlyphs, INT write_dir, WORD *pwLogClust, INT maxGlyphs, combining_lexical_function lex)
Definition: shape.c:917
#define FIRST_ARABIC_CHAR
Definition: shape.c:44
static VOID load_ot_tables(HDC hdc, ScriptCache *psc)
Definition: shape.c:713
static BOOL left_join_causing(CHAR joining_type)
Definition: shape.c:1010
#define NtGdiGetGlyphIndicesW(A, B, C, D, E)
Definition: wine-compat.h:3
#define GDI_ERROR
Definition: wingdi.h:1309

◆ ContextualShape_Bengali()

static HRESULT 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 2428 of file shape.c.

2429{
2430 int cCount = cChars;
2431 WCHAR *input;
2432 IndicSyllable *syllables = NULL;
2433 int syllable_count = 0;
2434 BOOL modern = get_GSUB_Indic2(psa, psc);
2435
2436 if (*pcGlyphs != cChars)
2437 {
2438 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2439 return E_INVALIDARG;
2440 }
2441
2442 input = malloc(2 * cChars * sizeof(*input));
2443 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2444
2445 /* Step 1: Decompose Vowels and Compose Consonants */
2446 DecomposeVowels(hdc, input, &cCount, Bengali_vowels, pwLogClust, cChars);
2447 ComposeConsonants(hdc, input, &cCount, Bengali_consonants, pwLogClust);
2448 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2449
2450 /* Step 2: Reorder within Syllables */
2451 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, bengali_lex, Reorder_Like_Bengali, modern);
2452 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2453 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2454 *pcGlyphs = cCount;
2455
2456 /* Step 3: Initial form is only applied to the beginning of words */
2457 for (cCount = cCount - 1 ; cCount >= 0; cCount --)
2458 {
2459 if (cCount == 0 || input[cCount] == 0x0020) /* space */
2460 {
2461 int index = cCount;
2462 int gCount = 1;
2463 if (index > 0) index++;
2464
2465 apply_GSUB_feature_to_glyph(hdc, psa, psc, &pwOutGlyphs[index], 0, 1, &gCount, "init");
2466 }
2467 }
2468
2469 /* Step 4: Base Form application to syllables */
2470 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, bengali_lex, NULL, modern);
2471
2472 free(input);
2473 free(syllables);
2474 return S_OK;
2475}
#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:369
#define S_OK
Definition: intsafe.h:52
#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:1949
static BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc)
Definition: shape.c:890
static const VowelComponents Bengali_vowels[]
Definition: shape.c:2416
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:2145
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD *pwLogClust, INT cChars)
Definition: shape.c:1690
static void ComposeConsonants(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const ConsonantComponents consonants[], WORD *pwLogClust)
Definition: shape.c:1712
static const ConsonantComponents Bengali_consonants[]
Definition: shape.c:2421
static int bengali_lex(WCHAR c)
Definition: shape.c:2406

◆ ContextualShape_Control()

static HRESULT 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 947 of file shape.c.

948{
949 int i;
950 for (i=0; i < cChars; i++)
951 {
952 switch (pwcChars[i])
953 {
954 case 0x000A:
955 case 0x000D:
956 pwOutGlyphs[i] = psc->sfp.wgBlank;
957 break;
958 default:
959 if (pwcChars[i] < 0x1C)
960 pwOutGlyphs[i] = psc->sfp.wgDefault;
961 else
962 pwOutGlyphs[i] = psc->sfp.wgBlank;
963 }
964 }
965 return S_OK;
966}
SCRIPT_FONTPROPERTIES sfp

◆ ContextualShape_Devanagari()

static HRESULT 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 2371 of file shape.c.

2372{
2373 int cCount = cChars;
2374 WCHAR *input;
2375 IndicSyllable *syllables = NULL;
2376 int syllable_count = 0;
2377 BOOL modern = get_GSUB_Indic2(psa, psc);
2378
2379 if (*pcGlyphs != cChars)
2380 {
2381 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2382 return E_INVALIDARG;
2383 }
2384
2385 input = malloc(cChars * sizeof(*input));
2386 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2387
2388 /* Step 1: Compose Consonant and Nukta */
2389 ComposeConsonants(hdc, input, &cCount, Devanagari_consonants, pwLogClust);
2390 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2391
2392 /* Step 2: Reorder within Syllables */
2393 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, devanagari_lex, Reorder_Like_Devanagari, modern);
2394 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2395 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2396 *pcGlyphs = cCount;
2397
2398 /* Step 3: Base Form application to syllables */
2399 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, devanagari_lex, NULL, modern);
2400
2401 free(input);
2402 free(syllables);
2403 return S_OK;
2404}
static int devanagari_lex(WCHAR c)
Definition: shape.c:2347
static void Reorder_Like_Devanagari(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1939
static const ConsonantComponents Devanagari_consonants[]
Definition: shape.c:2357

◆ ContextualShape_Gujarati()

static HRESULT 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 2538 of file shape.c.

2539{
2540 int cCount = cChars;
2541 WCHAR *input;
2542 IndicSyllable *syllables = NULL;
2543 int syllable_count = 0;
2544 BOOL modern = get_GSUB_Indic2(psa, psc);
2545
2546 if (*pcGlyphs != cChars)
2547 {
2548 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2549 return E_INVALIDARG;
2550 }
2551
2552 input = malloc(cChars * sizeof(*input));
2553 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2554
2555 /* Step 1: Reorder within Syllables */
2556 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, gujarati_lex, Reorder_Like_Devanagari, modern);
2557 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2558 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2559 *pcGlyphs = cCount;
2560
2561 /* Step 2: Base Form application to syllables */
2562 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gujarati_lex, NULL, modern);
2563
2564 free(input);
2565 free(syllables);
2566 return S_OK;
2567}
static int gujarati_lex(WCHAR c)
Definition: shape.c:2528

◆ ContextualShape_Gurmukhi()

static HRESULT 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 2493 of file shape.c.

2494{
2495 int cCount = cChars;
2496 WCHAR *input;
2497 IndicSyllable *syllables = NULL;
2498 int syllable_count = 0;
2499 BOOL modern = get_GSUB_Indic2(psa, psc);
2500
2501 if (*pcGlyphs != cChars)
2502 {
2503 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2504 return E_INVALIDARG;
2505 }
2506
2507 input = malloc(cChars * sizeof(*input));
2508 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2509
2510 /* Step 1: Compose Consonants */
2511 ComposeConsonants(hdc, input, &cCount, Gurmukhi_consonants, pwLogClust);
2512 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2513
2514 /* Step 2: Reorder within Syllables */
2515 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, gurmukhi_lex, Reorder_Like_Bengali, modern);
2516 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2517 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2518 *pcGlyphs = cCount;
2519
2520 /* Step 3: Base Form application to syllables */
2521 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, gurmukhi_lex, NULL, modern);
2522
2523 free(input);
2524 free(syllables);
2525 return S_OK;
2526}
static int gurmukhi_lex(WCHAR c)
Definition: shape.c:2477
static const ConsonantComponents Gurmukhi_consonants[]
Definition: shape.c:2485

◆ ContextualShape_Hebrew()

static HRESULT 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 1253 of file shape.c.

1254{
1255 INT dirL;
1256
1257 if (*pcGlyphs != cChars)
1258 {
1259 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1260 return E_INVALIDARG;
1261 }
1262
1263 if (!psa->fLogicalOrder && psa->fRTL)
1264 dirL = -1;
1265 else
1266 dirL = 1;
1267
1268 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Hebrew);
1269}
static int combining_lexical_Hebrew(WCHAR c)
Definition: shape.c:1196

◆ ContextualShape_Kannada()

static HRESULT 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 2745 of file shape.c.

2746{
2747 int cCount = cChars;
2748 WCHAR *input;
2749 IndicSyllable *syllables = NULL;
2750 int syllable_count = 0;
2751 BOOL modern = get_GSUB_Indic2(psa, psc);
2752
2753 if (*pcGlyphs != cChars)
2754 {
2755 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2756 return E_INVALIDARG;
2757 }
2758
2759 input = malloc(3 * cChars * sizeof(*input));
2760 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2761
2762 /* Step 1: Decompose Vowels */
2763 DecomposeVowels(hdc, input, &cCount, Kannada_vowels, pwLogClust, cChars);
2764 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2765
2766 /* Step 2: Reorder within Syllables */
2767 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, kannada_lex, Reorder_Like_Kannada, modern);
2768 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2769 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2770 *pcGlyphs = cCount;
2771
2772 /* Step 3: Base Form application to syllables */
2773 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, kannada_lex, SecondReorder_Like_Telugu, modern);
2774
2775 free(input);
2776 free(syllables);
2777 return S_OK;
2778}
static void Reorder_Like_Kannada(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1959
static void SecondReorder_Like_Telugu(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1969
static const VowelComponents Kannada_vowels[]
Definition: shape.c:2737
static int kannada_lex(WCHAR c)
Definition: shape.c:2727

◆ ContextualShape_Khmer()

static HRESULT 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 2831 of file shape.c.

2832{
2833 int cCount = cChars;
2834 WCHAR *input;
2835 IndicSyllable *syllables = NULL;
2836 int syllable_count = 0;
2837
2838 if (*pcGlyphs != cChars)
2839 {
2840 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2841 return E_INVALIDARG;
2842 }
2843
2844 input = malloc(cChars * sizeof(*input));
2845 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2846
2847 /* Step 1: Reorder within Syllables */
2848 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, khmer_lex, Reorder_Like_Devanagari, FALSE);
2849 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2850 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2851 *pcGlyphs = cCount;
2852
2853 /* Step 2: Base Form application to syllables */
2854 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, khmer_lex, NULL, FALSE);
2855
2856 free(input);
2857 free(syllables);
2858 return S_OK;
2859}
static int khmer_lex(WCHAR c)
Definition: shape.c:2826

◆ ContextualShape_Lao()

static HRESULT 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 1652 of file shape.c.

1653{
1654 INT dirL;
1655
1656 if (*pcGlyphs != cChars)
1657 {
1658 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1659 return E_INVALIDARG;
1660 }
1661
1662 if (!psa->fLogicalOrder && psa->fRTL)
1663 dirL = -1;
1664 else
1665 dirL = 1;
1666
1667 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Lao);
1668}
static int combining_lexical_Lao(WCHAR c)
Definition: shape.c:1626

◆ ContextualShape_Malayalam()

static HRESULT 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 2791 of file shape.c.

2792{
2793 int cCount = cChars;
2794 WCHAR *input;
2795 IndicSyllable *syllables = NULL;
2796 int syllable_count = 0;
2797 BOOL modern = get_GSUB_Indic2(psa, psc);
2798
2799 if (*pcGlyphs != cChars)
2800 {
2801 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2802 return E_INVALIDARG;
2803 }
2804
2805 input = malloc(2 * cChars * sizeof(*input));
2806 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2807
2808 /* Step 1: Decompose Vowels */
2809 DecomposeVowels(hdc, input, &cCount, Malayalam_vowels, pwLogClust, cChars);
2810 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2811
2812 /* Step 2: Reorder within Syllables */
2813 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, malayalam_lex, Reorder_Like_Devanagari, modern);
2814 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2815 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2816 *pcGlyphs = cCount;
2817
2818 /* Step 3: Base Form application to syllables */
2819 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, malayalam_lex, SecondReorder_Like_Tamil, modern);
2820
2821 free(input);
2822 free(syllables);
2823 return S_OK;
2824}
static const VowelComponents Malayalam_vowels[]
Definition: shape.c:2785
static int malayalam_lex(WCHAR c)
Definition: shape.c:2780
static void SecondReorder_Like_Tamil(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1980

◆ ContextualShape_Mongolian()

static HRESULT 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 2866 of file shape.c.

2867{
2868 INT *context_shape;
2869 INT dirL;
2870 int i;
2871 int char_index;
2872 int glyph_index;
2873
2874 if (*pcGlyphs != cChars)
2875 {
2876 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2877 return E_INVALIDARG;
2878 }
2879
2880 if (!psa->fLogicalOrder && psa->fRTL)
2881 dirL = -1;
2882 else
2883 dirL = 1;
2884
2885 if (!psc->GSUB_Table)
2886 return E_INVALIDARG;
2887
2888 context_shape = malloc(cChars * sizeof(*context_shape));
2889
2890 for (i = 0; i < cChars; i++)
2891 {
2892 if (i == 0 || mongolian_wordbreak(pwcChars[i-1]))
2893 {
2894 if ((i == cChars-1) || mongolian_wordbreak(pwcChars[i+1]))
2895 context_shape[i] = Xn;
2896 else
2897 context_shape[i] = Xl;
2898 }
2899 else
2900 {
2901 if ((i == cChars-1) || mongolian_wordbreak(pwcChars[i+1]))
2902 context_shape[i] = Xr;
2903 else
2904 context_shape[i] = Xm;
2905 }
2906 }
2907
2908 /* Contextual Shaping */
2909 if (dirL > 0)
2910 char_index = glyph_index = 0;
2911 else
2912 char_index = glyph_index = cChars-1;
2913
2914 while(char_index < cChars && char_index >= 0)
2915 {
2916 INT nextIndex;
2917 INT prevCount = *pcGlyphs;
2918 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
2919
2920 if (nextIndex > GSUB_E_NOGLYPH)
2921 {
2922 UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
2923 glyph_index = nextIndex;
2924 char_index += dirL;
2925 }
2926 else
2927 {
2928 char_index += dirL;
2929 glyph_index += dirL;
2930 }
2931 }
2932
2933 free(context_shape);
2934 return S_OK;
2935}
static BOOL mongolian_wordbreak(WCHAR chr)
Definition: shape.c:2861

◆ ContextualShape_Oriya()

static HRESULT 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 2590 of file shape.c.

2591{
2592 int cCount = cChars;
2593 WCHAR *input;
2594 IndicSyllable *syllables = NULL;
2595 int syllable_count = 0;
2596 BOOL modern = get_GSUB_Indic2(psa, psc);
2597
2598 if (*pcGlyphs != cChars)
2599 {
2600 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2601 return E_INVALIDARG;
2602 }
2603
2604 input = malloc(2 * cChars * sizeof(*input));
2605 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2606
2607 /* Step 1: Decompose Vowels and Compose Consonants */
2608 DecomposeVowels(hdc, input, &cCount, Oriya_vowels, pwLogClust, cChars);
2609 ComposeConsonants(hdc, input, &cCount, Oriya_consonants, pwLogClust);
2610 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2611
2612 /* Step 2: Reorder within Syllables */
2613 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, oriya_lex, Reorder_Like_Bengali, modern);
2614 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2615 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2616 *pcGlyphs = cCount;
2617
2618 /* Step 3: Base Form application to syllables */
2619 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, oriya_lex, NULL, modern);
2620
2621 free(input);
2622 free(syllables);
2623 return S_OK;
2624}
static int oriya_lex(WCHAR c)
Definition: shape.c:2569
static const VowelComponents Oriya_vowels[]
Definition: shape.c:2579
static const ConsonantComponents Oriya_consonants[]
Definition: shape.c:2585

◆ ContextualShape_Phags_pa()

static HRESULT 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 1490 of file shape.c.

1491{
1492 INT *context_shape;
1493 INT dirR, dirL;
1494 int i;
1495 int char_index;
1496 int glyph_index;
1497
1498 if (*pcGlyphs != cChars)
1499 {
1500 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1501 return E_INVALIDARG;
1502 }
1503
1504 if (!psa->fLogicalOrder && psa->fRTL)
1505 {
1506 dirR = 1;
1507 dirL = -1;
1508 }
1509 else
1510 {
1511 dirR = -1;
1512 dirL = 1;
1513 }
1514
1515 load_ot_tables(hdc, psc);
1516
1517 if (!psc->GSUB_Table)
1518 return E_INVALIDARG;
1519
1520 context_shape = malloc(cChars * sizeof(*context_shape));
1521
1522 for (i = 0; i < cChars; i++)
1523 {
1524 if (pwcChars[i] >= phags_pa_START && pwcChars[i] <= phags_pa_END)
1525 {
1526 WCHAR rchar = neighbour_char(i,dirR,pwcChars,cChars);
1527 WCHAR lchar = neighbour_char(i,dirL,pwcChars,cChars);
1528 BOOL jrchar = (rchar != phags_pa_CANDRABINDU && rchar >= phags_pa_START && rchar <= phags_pa_END);
1529 BOOL jlchar = (lchar != phags_pa_CANDRABINDU && lchar >= phags_pa_START && lchar <= phags_pa_END);
1530
1531 if (jrchar && jlchar)
1532 context_shape[i] = Xm;
1533 else if (jrchar)
1534 context_shape[i] = Xr;
1535 else if (jlchar)
1536 context_shape[i] = Xl;
1537 else
1538 context_shape[i] = Xn;
1539 }
1540 else
1541 context_shape[i] = -1;
1542 }
1543
1544 /* Contextual Shaping */
1545 if (dirL > 0)
1546 char_index = glyph_index = 0;
1547 else
1548 char_index = glyph_index = cChars-1;
1549
1550 while(char_index < cChars && char_index >= 0)
1551 {
1552 if (context_shape[char_index] >= 0)
1553 {
1554 INT nextIndex;
1555 INT prevCount = *pcGlyphs;
1556 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1557
1558 if (nextIndex > GSUB_E_NOGLYPH)
1559 {
1560 UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1561 glyph_index = nextIndex;
1562 char_index += dirL;
1563 }
1564 else
1565 {
1566 char_index += dirL;
1567 glyph_index += dirL;
1568 }
1569 }
1570 else
1571 {
1572 char_index += dirL;
1573 glyph_index += dirL;
1574 }
1575 }
1576
1577 free(context_shape);
1578 return S_OK;
1579}
#define phags_pa_START
Definition: shape.c:1487
#define phags_pa_END
Definition: shape.c:1488
static WCHAR neighbour_char(int i, int delta, const WCHAR *chars, INT cchLen)
Definition: shape.c:968
#define phags_pa_CANDRABINDU
Definition: shape.c:1486

◆ ContextualShape_Sinhala()

static HRESULT 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 2302 of file shape.c.

2303{
2304 int cCount = cChars;
2305 int i;
2306 WCHAR *input;
2307 IndicSyllable *syllables = NULL;
2308 int syllable_count = 0;
2309
2310 if (*pcGlyphs != cChars)
2311 {
2312 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2313 return E_INVALIDARG;
2314 }
2315
2316 input = malloc(3 * cChars * sizeof(*input));
2317
2318 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2319
2320 /* Step 1: Decompose multi part vowels */
2321 DecomposeVowels(hdc, input, &cCount, Sinhala_vowels, pwLogClust, cChars);
2322
2323 TRACE("New double vowel expanded string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2324
2325 /* Step 2: Reorder within Syllables */
2326 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, sinhala_lex, Reorder_Like_Sinhala, TRUE);
2327 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2328
2329 /* Step 3: Strip dangling joiners */
2330 for (i = 0; i < cCount; i++)
2331 {
2332 if ((input[i] == 0x200D || input[i] == 0x200C) &&
2333 (i == 0 || input[i-1] == 0x0020 || i == cCount-1 || input[i+1] == 0x0020))
2334 input[i] = 0x0020;
2335 }
2336
2337 /* Step 4: Base Form application to syllables */
2338 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2339 *pcGlyphs = cCount;
2340 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, sinhala_lex, NULL, TRUE);
2341
2342 free(input);
2343 free(syllables);
2344 return S_OK;
2345}
static const VowelComponents Sinhala_vowels[]
Definition: shape.c:2295
static void Reorder_Like_Sinhala(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1929
static int sinhala_lex(WCHAR c)
Definition: shape.c:2282

◆ ContextualShape_Syriac()

static HRESULT 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 1327 of file shape.c.

1328{
1329 CHAR *context_type;
1330 INT *context_shape;
1331 INT dirR, dirL;
1332 int i;
1333 int char_index;
1334 int glyph_index;
1335
1336 if (*pcGlyphs != cChars)
1337 {
1338 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1339 return E_INVALIDARG;
1340 }
1341
1342 if (!psa->fLogicalOrder && psa->fRTL)
1343 {
1344 dirR = 1;
1345 dirL = -1;
1346 }
1347 else
1348 {
1349 dirR = -1;
1350 dirL = 1;
1351 }
1352
1353 load_ot_tables(hdc, psc);
1354
1355 if (!psc->GSUB_Table)
1356 return E_INVALIDARG;
1357
1358 context_type = malloc(cChars);
1359 context_shape = malloc(cChars * sizeof(*context_shape));
1360
1361 for (i = 0; i < cChars; i++)
1362 context_type[i] = get_table_entry_16( wine_shaping_table, pwcChars[i] );
1363
1364 for (i = 0; i < cChars; i++)
1365 {
1366 if (pwcChars[i] == ALAPH)
1367 {
1368 WCHAR rchar = neighbour_char(i,dirR,pwcChars,cChars);
1369
1370 if (left_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)) && word_break_causing(neighbour_char(i,dirL,pwcChars,cChars)))
1371 context_shape[i] = Afj;
1372 else if ( rchar != DALATH && rchar != RISH &&
1373!left_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)) &&
1375 context_shape[i] = Afn;
1376 else if ( (rchar == DALATH || rchar == RISH) && word_break_causing(neighbour_char(i,dirL,pwcChars,cChars)))
1377 context_shape[i] = Afx;
1378 else
1379 context_shape[i] = Xn;
1380 }
1381 else if (context_type[i] == jtR &&
1382right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1383 context_shape[i] = Xr;
1384 else if (context_type[i] == jtL && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1385 context_shape[i] = Xl;
1386 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)))
1387 context_shape[i] = Xm;
1388 else if (context_type[i] == jtD && right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa)))
1389 context_shape[i] = Xr;
1390 else if (context_type[i] == jtD && left_join_causing(neighbour_joining_type(i,dirL,context_type,cChars,psa)))
1391 context_shape[i] = Xl;
1392 else
1393 context_shape[i] = Xn;
1394 }
1395
1396 /* Contextual Shaping */
1397 if (dirL > 0)
1398 char_index = glyph_index = 0;
1399 else
1400 char_index = glyph_index = cChars-1;
1401
1402 while(char_index < cChars && char_index >= 0)
1403 {
1404 INT nextIndex, offset = 0;
1405 INT prevCount = *pcGlyphs;
1406
1407 /* Apply CCMP first */
1408 apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, "ccmp");
1409
1410 if (prevCount != *pcGlyphs)
1411 {
1412 offset = *pcGlyphs - prevCount;
1413 if (dirL < 0)
1414 glyph_index -= offset * dirL;
1415 }
1416
1417 /* Apply the contextual feature */
1418 nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]);
1419 if (nextIndex > GSUB_E_NOGLYPH)
1420 {
1421 UpdateClusters(nextIndex, *pcGlyphs - prevCount, dirL, cChars, pwLogClust);
1422 char_index += dirL;
1423 if (!offset)
1424 glyph_index = nextIndex;
1425 else
1426 {
1427 offset = *pcGlyphs - prevCount;
1428 glyph_index += dirL * (offset + 1);
1429 }
1430 }
1431 else
1432 {
1433 char_index += dirL;
1434 glyph_index += dirL;
1435 }
1436 }
1437
1438 free(context_shape);
1439 free(context_type);
1440
1441 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Syriac);
1442}
static BOOL word_break_causing(WCHAR chr)
Definition: shape.c:1015
#define DALATH
Definition: shape.c:1324
#define RISH
Definition: shape.c:1325
static int combining_lexical_Syriac(WCHAR c)
Definition: shape.c:1275
#define ALAPH
Definition: shape.c:1323

◆ ContextualShape_Tamil()

static HRESULT 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 2641 of file shape.c.

2642{
2643 int cCount = cChars;
2644 WCHAR *input;
2645 IndicSyllable *syllables = NULL;
2646 int syllable_count = 0;
2647 BOOL modern = get_GSUB_Indic2(psa, psc);
2648
2649 if (*pcGlyphs != cChars)
2650 {
2651 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2652 return E_INVALIDARG;
2653 }
2654
2655 input = malloc(2 * cChars * sizeof(*input));
2656 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2657
2658 /* Step 1: Decompose Vowels and Compose Consonants */
2659 DecomposeVowels(hdc, input, &cCount, Tamil_vowels, pwLogClust, cChars);
2660 ComposeConsonants(hdc, input, &cCount, Tamil_consonants, pwLogClust);
2661 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2662
2663 /* Step 2: Reorder within Syllables */
2664 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, tamil_lex, Reorder_Like_Bengali, modern);
2665 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2666 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2667 *pcGlyphs = cCount;
2668
2669 /* Step 3: Base Form application to syllables */
2670 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, tamil_lex, SecondReorder_Like_Tamil, modern);
2671
2672 free(input);
2673 free(syllables);
2674 return S_OK;
2675}
static const VowelComponents Tamil_vowels[]
Definition: shape.c:2631
static int tamil_lex(WCHAR c)
Definition: shape.c:2626
static const ConsonantComponents Tamil_consonants[]
Definition: shape.c:2637

◆ ContextualShape_Telugu()

static HRESULT 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 2692 of file shape.c.

2693{
2694 int cCount = cChars;
2695 WCHAR *input;
2696 IndicSyllable *syllables = NULL;
2697 int syllable_count = 0;
2698 BOOL modern = get_GSUB_Indic2(psa, psc);
2699
2700 if (*pcGlyphs != cChars)
2701 {
2702 ERR("Number of Glyphs and Chars need to match at the beginning\n");
2703 return E_INVALIDARG;
2704 }
2705
2706 input = malloc(2 * cChars * sizeof(*input));
2707 memcpy(input, pwcChars, cChars * sizeof(WCHAR));
2708
2709 /* Step 1: Decompose Vowels */
2710 DecomposeVowels(hdc, input, &cCount, Telugu_vowels, pwLogClust, cChars);
2711 TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
2712
2713 /* Step 2: Reorder within Syllables */
2714 Indic_ReorderCharacters( hdc, psa, psc, input, cCount, &syllables, &syllable_count, telugu_lex, Reorder_Like_Bengali, modern);
2715 TRACE("reordered string %s\n",debugstr_wn(input,cCount));
2716 NtGdiGetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
2717 *pcGlyphs = cCount;
2718
2719 /* Step 3: Base Form application to syllables */
2720 ShapeIndicSyllables(hdc, psc, psa, input, cChars, syllables, syllable_count, pwOutGlyphs, pcGlyphs, pwLogClust, telugu_lex, SecondReorder_Like_Telugu, modern);
2721
2722 free(input);
2723 free(syllables);
2724 return S_OK;
2725}
static const VowelComponents Telugu_vowels[]
Definition: shape.c:2688
static int telugu_lex(WCHAR c)
Definition: shape.c:2677

◆ ContextualShape_Thaana()

static HRESULT 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 1464 of file shape.c.

1465{
1466 INT dirL;
1467
1468 if (*pcGlyphs != cChars)
1469 {
1470 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1471 return E_INVALIDARG;
1472 }
1473
1474 if (!psa->fLogicalOrder && psa->fRTL)
1475 dirL = -1;
1476 else
1477 dirL = 1;
1478
1479 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Thaana);
1480}
static int combining_lexical_Thaana(WCHAR c)
Definition: shape.c:1444

◆ ContextualShape_Thai()

static HRESULT 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 1608 of file shape.c.

1609{
1610 INT dirL;
1611
1612 if (*pcGlyphs != cChars)
1613 {
1614 ERR("Number of Glyphs and Chars need to match at the beginning\n");
1615 return E_INVALIDARG;
1616 }
1617
1618 if (!psa->fLogicalOrder && psa->fRTL)
1619 dirL = -1;
1620 else
1621 dirL = 1;
1622
1623 return mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, cMaxGlyphs, combining_lexical_Thai);
1624}
static int combining_lexical_Thai(WCHAR c)
Definition: shape.c:1581

◆ DecomposeVowels()

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

Definition at line 1690 of file shape.c.

1691{
1692 int i;
1693 int cWalk;
1694
1695 for (cWalk = 0; cWalk < *pcChars; cWalk++)
1696 {
1697 for (i = 0; vowels[i].base != 0x0; i++)
1698 {
1699 if (pwOutChars[cWalk] == vowels[i].base)
1700 {
1701 int o = 0;
1702 ReplaceInsertChars(hdc, cWalk, pcChars, pwOutChars, vowels[i].parts);
1703 if (vowels[i].parts[1]) { cWalk++; o++; }
1704 if (vowels[i].parts[2]) { cWalk++; o++; }
1705 UpdateClusters(cWalk, o, 1, cChars, pwLogClust);
1706 break;
1707 }
1708 }
1709 }
1710}
static void ReplaceInsertChars(HDC hdc, INT cWalk, INT *pcChars, WCHAR *pwOutChars, const WCHAR *replacements)
Definition: shape.c:1670

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

2348{
2349 switch (c)
2350 {
2351 case 0x0930: return lex_Ra;
2352 default:
2353 return unicode_lex(c);
2354 }
2355}

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

2036{
2037 int i = 0;
2038 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)))))
2039 i++;
2040 if (index + i <= end-1)
2041 return index + i;
2042 else
2043 return -1;
2044}
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 2087 of file shape.c.

2088{
2089 int i = 0;
2090 while (index + i < end-1 && !(lexical(pwChars[index+i]) == lex_Halant &&
2091 ((index + i < end-2 && lexical(pwChars[index+i]) == lex_Nukta && is_consonant(lexical(pwChars[index+i+1]))) ||
2092 is_consonant(lexical(pwChars[index+i+1])))))
2093 i++;
2094 if (index + i <= end-1)
2095 return index+i;
2096 else
2097 return -1;
2098}

Referenced by Apply_Indic_PostBase().

◆ get_GSUB_Indic2()

static BOOL get_GSUB_Indic2 ( SCRIPT_ANALYSIS *  psa,
ScriptCache *  psc 
)
inlinestatic

Definition at line 890 of file shape.c.

891{
893 HRESULT hr;
894 int count = 0;
895
897
898 return(SUCCEEDED(hr));
899}
HRESULT hr
Definition: delayimp.cpp:582
#define SUCCEEDED(hr)
Definition: intsafe.h:50
OPENTYPE_TAG newOtTag
Definition: shape.c:460
Definition: ecma_167.h:138
ULONG OPENTYPE_TAG
Definition: usp10.h:205
HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags)
Definition: opentype.c:2689
static const ScriptShapeData ShapingData[]
Definition: shape.c:466

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

581{
583
584 if (script_cache->userScript)
585 {
586 if (try_new && ShapingData[psa->eScript].newOtTag
587 && script_cache->userScript == scriptInformation[psa->eScript].scriptTag)
588 return ShapingData[psa->eScript].newOtTag;
589
590 return script_cache->userScript;
591 }
592
593 if (try_new && ShapingData[psa->eScript].newOtTag)
594 return ShapingData[psa->eScript].newOtTag;
595
598
599 /*
600 * fall back to the font charset
601 */
603 switch (charset)
604 {
605 case ANSI_CHARSET:
606 case BALTIC_CHARSET: return MS_MAKE_TAG('l','a','t','n');
607 case CHINESEBIG5_CHARSET: return MS_MAKE_TAG('h','a','n','i');
608 case EASTEUROPE_CHARSET: return MS_MAKE_TAG('l','a','t','n'); /* ?? */
609 case GB2312_CHARSET: return MS_MAKE_TAG('h','a','n','i');
610 case GREEK_CHARSET: return MS_MAKE_TAG('g','r','e','k');
611 case HANGUL_CHARSET: return MS_MAKE_TAG('h','a','n','g');
612 case RUSSIAN_CHARSET: return MS_MAKE_TAG('c','y','r','l');
613 case SHIFTJIS_CHARSET: return MS_MAKE_TAG('k','a','n','a');
614 case TURKISH_CHARSET: return MS_MAKE_TAG('l','a','t','n'); /* ?? */
615 case VIETNAMESE_CHARSET: return MS_MAKE_TAG('l','a','t','n');
616 case JOHAB_CHARSET: return MS_MAKE_TAG('l','a','t','n'); /* ?? */
617 case ARABIC_CHARSET: return MS_MAKE_TAG('a','r','a','b');
618 case HEBREW_CHARSET: return MS_MAKE_TAG('h','e','b','r');
619 case THAI_CHARSET: return MS_MAKE_TAG('t','h','a','i');
620 default: return MS_MAKE_TAG('l','a','t','n');
621 }
622}
CFF_Charset charset
Definition: cffcmap.c:137
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
Definition: font.c:112
unsigned int UINT
Definition: sysinfo.c:13
OPENTYPE_TAG userScript
OPENTYPE_TAG scriptTag
scriptData scriptInformation[]
Definition: usp10.c:312
#define NtGdiGetTextCharsetInfo(A, B, C)
Definition: wine-compat.h:6
#define HANGUL_CHARSET
Definition: wingdi.h:388
#define RUSSIAN_CHARSET
Definition: wingdi.h:396
#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 872 of file shape.c.

875{
876 int dir = analysis->fLogicalOrder && analysis->fRTL ? -1 : 1;
877 unsigned int start_idx, i, j;
878
879 TRACE("%i lookups\n", feature->lookup_count);
880
881 start_idx = dir < 0 ? glyph_count - 1 : 0;
882 for (i = 0; i < feature->lookup_count; i++)
883 {
884 for (j = 0; j < glyph_count; )
885 j += OpenType_apply_GPOS_lookup(psc, otm, logfont, analysis, advance,
886 feature->lookups[i], glyphs, start_idx + dir * j, glyph_count, goffset);
887 }
888}
_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:2599

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

556{
557 int i;
558 int out_index = GSUB_E_NOGLYPH;
559
560 TRACE("%i lookups\n", feature->lookup_count);
561 for (i = 0; i < feature->lookup_count; i++)
562 {
563 out_index = OpenType_apply_GSUB_lookup(header, feature->lookups[i], glyphs, glyph_index, write_dir, glyph_count);
564 if (out_index != GSUB_E_NOGLYPH)
565 break;
566 }
567 if (out_index == GSUB_E_NOGLYPH)
568 TRACE("lookups found no glyphs\n");
569 else
570 {
571 int out2;
572 out2 = GSUB_apply_feature_all_lookups(header, feature, glyphs, glyph_index, write_dir, glyph_count);
573 if (out2!=GSUB_E_NOGLYPH)
574 out_index = out2;
575 }
576 return out_index;
577}

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

2529{
2530 switch (c)
2531 {
2532 case 0x0AB0: return lex_Ra;
2533 default:
2534 return unicode_lex(c);
2535 }
2536}

Referenced by ContextualShape_Gujarati(), and ShapeCharGlyphProp_Gujarati().

◆ gurmukhi_lex()

static int gurmukhi_lex ( WCHAR  c)
static

Definition at line 2477 of file shape.c.

2478{
2479 if (c == 0x0A71)
2480 return lex_Modifier;
2481 else
2482 return unicode_lex(c);
2483}
@ lex_Modifier

Referenced by ContextualShape_Gurmukhi(), and ShapeCharGlyphProp_Gurmukhi().

◆ insert_glyph()

static HRESULT insert_glyph ( WORD *  pwGlyphs,
INT *  pcGlyphs,
INT  cChars,
INT  write_dir,
WORD  glyph,
INT  index,
WORD *  pwLogClust,
INT  maxGlyphs 
)
static

Definition at line 901 of file shape.c.

902{
903 int i;
904 if (*pcGlyphs >= maxGlyphs)
905 return E_OUTOFMEMORY;
906 for (i = *pcGlyphs-1; i>=index; i--)
907 pwGlyphs[i+1] = pwGlyphs[i];
908 pwGlyphs[index] = glyph;
909 *pcGlyphs = *pcGlyphs+1;
910 if (write_dir < 0)
911 UpdateClusters(index-3, 1, write_dir, cChars, pwLogClust);
912 else
913 UpdateClusters(index, 1, write_dir, cChars, pwLogClust);
914 return S_OK;
915}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100

Referenced by mark_invalid_combinations().

◆ kannada_lex()

static int kannada_lex ( WCHAR  c)
static

Definition at line 2727 of file shape.c.

2728{
2729 switch (c)
2730 {
2731 case 0x0CB0: return lex_Ra;
2732 default:
2733 return unicode_lex(c);
2734 }
2735}

Referenced by ContextualShape_Kannada(), and ShapeCharGlyphProp_Kannada().

◆ khmer_lex()

static int khmer_lex ( WCHAR  c)
static

Definition at line 2826 of file shape.c.

2827{
2828 return unicode_lex(c);
2829}

Referenced by ContextualShape_Khmer(), and ShapeCharGlyphProp_Khmer().

◆ left_join_causing()

static BOOL left_join_causing ( CHAR  joining_type)
inlinestatic

Definition at line 1010 of file shape.c.

1011{
1012 return joining_type == jtR || joining_type == jtD;
1013}

Referenced by ContextualShape_Arabic(), and ContextualShape_Syriac().

◆ load_gdef_table()

static VOID * load_gdef_table ( HDC  hdc)
static

Definition at line 700 of file shape.c.

701{
702 VOID* GDEF_Table = NULL;
703 int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, NULL, 0);
704 if (length != GDI_ERROR)
705 {
706 GDEF_Table = malloc(length);
707 NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'D', 'E', 'F'), 0, GDEF_Table, length);
708 TRACE("Loaded GDEF table of %i bytes\n",length);
709 }
710 return GDEF_Table;
711}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define NtGdiGetFontData(A, B, C, D, E)
Definition: wine-compat.h:4

Referenced by load_ot_tables().

◆ load_gpos_table()

static VOID * load_gpos_table ( HDC  hdc)
static

Definition at line 687 of file shape.c.

688{
689 VOID* GPOS_Table = NULL;
690 int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0);
691 if (length != GDI_ERROR)
692 {
693 GPOS_Table = malloc(length);
694 NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length);
695 TRACE("Loaded GPOS table of %i bytes\n",length);
696 }
697 return GPOS_Table;
698}

Referenced by load_ot_tables().

◆ load_gsub_table()

static VOID * load_gsub_table ( HDC  hdc)
static

Definition at line 674 of file shape.c.

675{
676 VOID* GSUB_Table = NULL;
677 int length = NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, 0);
678 if (length != GDI_ERROR)
679 {
680 GSUB_Table = malloc(length);
681 NtGdiGetFontData(hdc, MS_MAKE_TAG('G', 'S', 'U', 'B'), 0, GSUB_Table, length);
682 TRACE("Loaded GSUB table of %i bytes\n",length);
683 }
684 return GSUB_Table;
685}

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

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

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

714{
715 if (!psc->GSUB_Table)
717 if (!psc->GPOS_Table)
719 if (!psc->GDEF_Table)
721}
void * GDEF_Table
static VOID * load_gdef_table(HDC hdc)
Definition: shape.c:700
static VOID * load_gpos_table(HDC hdc)
Definition: shape.c:687
static VOID * load_gsub_table(HDC hdc)
Definition: shape.c:674

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

2781{
2782 return unicode_lex(c);
2783}

Referenced by ContextualShape_Malayalam(), and ShapeCharGlyphProp_Malayalam().

◆ mark_invalid_combinations()

static HRESULT mark_invalid_combinations ( HDC  hdc,
const WCHAR *  pwcChars,
INT  cChars,
WORD *  pwGlyphs,
INT *  pcGlyphs,
INT  write_dir,
WORD *  pwLogClust,
INT  maxGlyphs,
combining_lexical_function  lex 
)
static

Definition at line 917 of file shape.c.

918{
919 CHAR *context_type;
920 int i,g;
921 WCHAR invalid = 0x25cc;
922 WORD invalid_glyph;
923 HRESULT hr = S_OK;
924
925 context_type = malloc(cChars);
926
927 /* Mark invalid combinations */
928 for (i = 0; i < cChars; i++)
929 context_type[i] = lex(pwcChars[i]);
930
931 NtGdiGetGlyphIndicesW(hdc, &invalid, 1, &invalid_glyph, 0);
932 for (i = 1, g=1; i < cChars - 1; i++, g++)
933 {
934 if (context_type[i] != 0 && context_type[i+write_dir]==context_type[i])
935 {
936 hr = insert_glyph(pwGlyphs, pcGlyphs, cChars, write_dir, invalid_glyph, g, pwLogClust, maxGlyphs);
937 if (FAILED(hr))
938 break;
939 g++;
940 }
941 }
942
943 free(context_type);
944 return hr;
945}
#define FAILED(hr)
Definition: intsafe.h:51
static HRESULT insert_glyph(WORD *pwGlyphs, INT *pcGlyphs, INT cChars, INT write_dir, WORD glyph, INT index, WORD *pwLogClust, INT maxGlyphs)
Definition: shape.c:901

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

2862{
2863 return ((chr == 0x0020) || (chr == 0x200C) || (chr == 0x202F) || (chr == 0x180E) || (chr == 0x1800) || (chr == 0x1802) || (chr == 0x1803) || (chr == 0x1805) || (chr == 0x1808) || (chr == 0x1809) || (chr == 0x1807));
2864}

Referenced by ContextualShape_Mongolian().

◆ neighbour_char()

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

Definition at line 968 of file shape.c.

969{
970 if (i + delta < 0)
971 return 0;
972 if ( i+ delta >= cchLen)
973 return 0;
974
975 i += delta;
976
977 return chars[i];
978}

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

981{
982 if (i + delta < 0)
983 {
984 if (psa->fLinkBefore)
985 return jtR;
986 else
987 return jtU;
988 }
989 if ( i+ delta >= cchLen)
990 {
991 if (psa->fLinkAfter)
992 return jtL;
993 else
994 return jtU;
995 }
996
997 i += delta;
998
999 if (context_type[i] == jtT)
1000 return neighbour_joining_type(i,delta,context_type,cchLen,psa);
1001 else
1002 return context_type[i];
1003}

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

◆ oriya_lex()

static int oriya_lex ( WCHAR  c)
static

Definition at line 2569 of file shape.c.

2570{
2571 switch (c)
2572 {
2573 case 0x0B30: return lex_Ra;
2574 default:
2575 return unicode_lex(c);
2576 }
2577}

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

1950{
1951 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1952 if (s->start == s->base && s->base == s->end) return;
1953 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1954
1955 Reorder_Ra_follows_base(pwChar, s, lexical);
1956 Reorder_Matra_precede_syllable(pwChar, s, lexical);
1957}
GLdouble s
Definition: gl.h:2039
@ lex_Vowel
static void Reorder_Ra_follows_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1746
static void Reorder_Matra_precede_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1838

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

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

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

1960{
1961 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1962 if (s->start == s->base && s->base == s->end) return;
1963 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1964
1965 Reorder_Ra_follows_syllable(pwChar, s, lexical);
1966 Reorder_Matra_precede_syllable(pwChar, s, lexical);
1967}
static void Reorder_Ra_follows_syllable(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1790

Referenced by ContextualShape_Kannada().

◆ Reorder_Like_Sinhala()

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

Definition at line 1929 of file shape.c.

1930{
1931 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1932 if (s->start == s->base && s->base == s->end) return;
1933 if (lexical(pwChar[s->base]) == lex_Vowel) return;
1934
1935 Reorder_Ra_follows_base(pwChar, s, lexical);
1936 Reorder_Matra_precede_base(pwChar, s, lexical);
1937}
static void Reorder_Matra_precede_base(WCHAR *pwChar, IndicSyllable *s, lexical_function lexical)
Definition: shape.c:1811

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

1812{
1813 int i;
1814
1815 /* reorder Matras */
1816 if (s->end > s->base)
1817 {
1818 for (i = 1; i <= s->end-s->base; i++)
1819 {
1820 if (lexical(pwChar[s->base+i]) == lex_Matra_pre)
1821 {
1822 int j;
1823 WCHAR c = pwChar[s->base+i];
1824 TRACE("Doing reorder of %x %x\n",c,pwChar[s->base]);
1825 for (j = s->base+i; j > s->base; j--)
1826 pwChar[j] = pwChar[j-1];
1827 pwChar[s->base] = c;
1828
1829 if (s->ralf >= s->base) s->ralf++;
1830 if (s->blwf >= s->base) s->blwf++;
1831 if (s->pref >= s->base) s->pref++;
1832 s->base ++;
1833 }
1834 }
1835 }
1836}
#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 1838 of file shape.c.

1839{
1840 int i;
1841
1842 /* reorder Matras */
1843 if (s->end > s->base)
1844 {
1845 for (i = 1; i <= s->end-s->base; i++)
1846 {
1847 if (lexical(pwChar[s->base+i]) == lex_Matra_pre)
1848 {
1849 int j;
1850 WCHAR c = pwChar[s->base+i];
1851 TRACE("Doing reorder of %x to %i\n",c,s->start);
1852 for (j = s->base+i; j > s->start; j--)
1853 pwChar[j] = pwChar[j-1];
1854 pwChar[s->start] = c;
1855
1856 if (s->ralf >= 0) s->ralf++;
1857 if (s->blwf >= 0) s->blwf++;
1858 if (s->pref >= 0) s->pref++;
1859 s->base ++;
1860 }
1861 }
1862 }
1863}

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

1747{
1748 if (s->ralf >= 0)
1749 {
1750 int j;
1751 WORD Ra = pwChar[s->start];
1752 WORD H = pwChar[s->start+1];
1753
1754 TRACE("Doing reorder of Ra to %i\n",s->base);
1755 for (j = s->start; j < s->base-1; j++)
1756 pwChar[j] = pwChar[j+2];
1757 pwChar[s->base-1] = Ra;
1758 pwChar[s->base] = H;
1759
1760 s->ralf = s->base-1;
1761 s->base -= 2;
1762 }
1763}
#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 1765 of file shape.c.

1766{
1767 if (s->ralf >= 0)
1768 {
1769 int j,loc;
1770 int stop = (s->blwf >=0)? s->blwf+1 : s->base;
1771 WORD Ra = pwChar[s->start];
1772 WORD H = pwChar[s->start+1];
1773 for (loc = s->end; loc > stop; loc--)
1774 if (lexical(pwChar[loc]) == lex_Matra_post || lexical(pwChar[loc]) == lex_Matra_below)
1775 break;
1776
1777 TRACE("Doing reorder of Ra to %i\n",loc);
1778 for (j = s->start; j < loc-1; j++)
1779 pwChar[j] = pwChar[j+2];
1780 pwChar[loc-1] = Ra;
1781 pwChar[loc] = H;
1782
1783 s->ralf = loc-1;
1784 s->base -= 2;
1785 if (s->blwf >= 0) s->blwf -= 2;
1786 if (s->pref >= 0) s->pref -= 2;
1787 }
1788}
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
@ 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 1790 of file shape.c.

1791{
1792 if (s->ralf >= 0)
1793 {
1794 int j;
1795 WORD Ra = pwChar[s->start];
1796 WORD H = pwChar[s->start+1];
1797
1798 TRACE("Doing reorder of Ra to %i\n",s->end-1);
1799 for (j = s->start; j < s->end-1; j++)
1800 pwChar[j] = pwChar[j+2];
1801 pwChar[s->end-1] = Ra;
1802 pwChar[s->end] = H;
1803
1804 s->ralf = s->end-1;
1805 s->base -= 2;
1806 if (s->blwf >= 0) s->blwf -= 2;
1807 if (s->pref >= 0) s->pref -= 2;
1808 }
1809}

Referenced by Reorder_Like_Kannada().

◆ ReplaceInsertChars()

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

Definition at line 1670 of file shape.c.

1671{
1672 int i;
1673
1674 /* Replace */
1675 pwOutChars[cWalk] = replacements[0];
1676 cWalk=cWalk+1;
1677
1678 /* Insert */
1679 for (i = 1; i < 3 && replacements[i] != 0x0000; i++)
1680 {
1681 int j;
1682 for (j = *pcChars; j > cWalk; j--)
1683 pwOutChars[j] = pwOutChars[j-1];
1684 *pcChars= *pcChars+1;
1685 pwOutChars[cWalk] = replacements[i];
1686 cWalk = cWalk+1;
1687 }
1688}

Referenced by DecomposeVowels().

◆ right_join_causing()

static BOOL right_join_causing ( CHAR  joining_type)
inlinestatic

Definition at line 1005 of file shape.c.

1006{
1007 return joining_type == jtL || joining_type == jtD;
1008}

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

1867{
1868 if (s->blwf >= 0 && g->blwf > g->base)
1869 {
1870 int j,loc;
1871 int g_offset;
1872 for (loc = s->end; loc > s->blwf; loc--)
1873 if (lexical(chars[loc]) == lex_Matra_below || lexical(chars[loc]) == lex_Matra_above
1874 || lexical(chars[loc]) == lex_Matra_post)
1875 break;
1876
1877 g_offset = (loc - s->blwf) - 1;
1878
1879 if (loc != s->blwf)
1880 {
1881 WORD blwf = glyphs[g->blwf];
1882 TRACE("Doing reorder of Below-base to %i (glyph offset %i)\n",loc,g_offset);
1883 /* do not care about the pwChar array anymore, just the glyphs */
1884 for (j = 0; j < g_offset; j++)
1885 glyphs[g->blwf + j] = glyphs[g->blwf + j + 1];
1886 glyphs[g->blwf + g_offset] = blwf;
1887 }
1888 }
1889}
@ 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 1980 of file shape.c.

1982{
1983 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1984 TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
1985 if (s->start == s->base && s->base == s->end) return;
1986 if (lexical(chars[s->base]) == lex_Vowel) return;
1987
1988 SecondReorder_Matra_precede_base(chars, s, glyphs, g, lexical);
1989 SecondReorder_Pref_precede_base(s, glyphs, g, lexical);
1990}
static void SecondReorder_Pref_precede_base(const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1915
static void SecondReorder_Matra_precede_base(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1891

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

1971{
1972 TRACE("Syllable (%i..%i..%i)\n",s->start,s->base,s->end);
1973 TRACE("Glyphs (%i..%i..%i)\n",g->start,g->base,g->end);
1974 if (s->start == s->base && s->base == s->end) return;
1975 if (lexical(chars[s->base]) == lex_Vowel) return;
1976
1977 SecondReorder_Blwf_follows_matra(chars, s, glyphs, g, lexical);
1978}
static void SecondReorder_Blwf_follows_matra(const WCHAR *chars, const IndicSyllable *s, WORD *glyphs, const IndicSyllable *g, lexical_function lexical)
Definition: shape.c:1865

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

1893{
1894 int i;
1895
1896 /* reorder previously moved Matras to correct position*/
1897 for (i = s->start; i < s->base; i++)
1898 {
1899 if (lexical(chars[i]) == lex_Matra_pre)
1900 {
1901 int j;
1902 int g_start = g->start + i - s->start;
1903 if (g_start < g->base -1 )
1904 {
1905 WCHAR og = glyphs[g_start];
1906 TRACE("Doing reorder of matra from %i to %i\n",g_start,g->base);
1907 for (j = g_start; j < g->base-1; j++)
1908 glyphs[j] = glyphs[j+1];
1909 glyphs[g->base-1] = og;
1910 }
1911 }
1912 }
1913}

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

1917{
1918 if (s->pref >= 0 && g->pref > g->base)
1919 {
1920 int j;
1921 WCHAR og = glyphs[g->pref];
1922 TRACE("Doing reorder of pref from %i to %i\n",g->pref,g->base);
1923 for (j = g->pref; j > g->base; j--)
1924 glyphs[j] = glyphs[j-1];
1925 glyphs[g->base] = og;
1926 }
1927}

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

3456{
3457const TEXTRANGE_PROPERTIES *rpRangeProperties;
3458rpRangeProperties = &ShapingData[psa->eScript].defaultTextRange;
3459
3460 SHAPE_ApplyOpenTypeFeatures(hdc, psc, psa, pwOutGlyphs, pcGlyphs, cMaxGlyphs, cChars, rpRangeProperties, pwLogClust);
3461}
TEXTRANGE_PROPERTIES defaultTextRange
Definition: shape.c:457
static void SHAPE_ApplyOpenTypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, INT *pcGlyphs, INT cMaxGlyphs, INT cChars, const TEXTRANGE_PROPERTIES *rpRangeProperties, WORD *pwLogClust)
Definition: shape.c:3430

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

3431{
3432 int i;
3433 INT dirL;
3434
3435 if (!rpRangeProperties)
3436 return;
3437
3438 load_ot_tables(hdc, psc);
3439
3440 if (!psc->GSUB_Table)
3441 return;
3442
3443 if (scriptInformation[psa->eScript].a.fRTL && (!psa->fLogicalOrder || !psa->fRTL))
3444 dirL = -1;
3445 else
3446 dirL = 1;
3447
3448 for (i = 0; i < rpRangeProperties->cotfRecords; i++)
3449 {
3450 if (rpRangeProperties->potfRecords[i].lParameter > 0)
3451 apply_GSUB_feature(hdc, psa, psc, pwOutGlyphs, dirL, pcGlyphs, cChars, (const char*)&rpRangeProperties->potfRecords[i].tagFeature, pwLogClust);
3452 }
3453}
SCRIPT_ANALYSIS a
OPENTYPE_TAG tagFeature
Definition: usp10.h:209
OPENTYPE_FEATURE_RECORD * potfRecords
Definition: usp10.h:227
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:831

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

3464{
3465 const TEXTRANGE_PROPERTIES *rpRangeProperties = &ShapingData[psa->eScript].defaultGPOSTextRange;
3466 int i;
3467
3468 load_ot_tables(hdc, psc);
3469
3470 if (!psc->GPOS_Table || !psc->otm)
3471 return;
3472
3473 for (i = 0; i < rpRangeProperties->cotfRecords; i++)
3474 {
3475 if (rpRangeProperties->potfRecords[i].lParameter > 0)
3476 {
3478
3479 feature = load_OT_feature(hdc, psa, psc, FEATURE_GPOS_TABLE, (const char*)&rpRangeProperties->potfRecords[i].tagFeature);
3480 if (!feature)
3481 continue;
3482
3483 GPOS_apply_feature(psc, psc->otm, &psc->lf, psa, piAdvance, feature, pwGlyphs, cGlyphs, pGoffset);
3484 }
3485 }
3486}
OUTLINETEXTMETRICW * otm
TEXTRANGE_PROPERTIES defaultGPOSTextRange
Definition: shape.c:458
#define FEATURE_GPOS_TABLE
static void GPOS_apply_feature(const ScriptCache *psc, const OUTLINETEXTMETRICW *otm, const LOGFONTW *logfont, const SCRIPT_ANALYSIS *analysis, int *advance, const LoadedFeature *feature, const WORD *glyphs, int glyph_count, GOFFSET *goffset)
Definition: shape.c:872
_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 3411 of file shape.c.

3412{
3413 load_ot_tables(hdc, psc);
3414
3416 ShapingData[psa->eScript].charGlyphPropProc(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3417 else
3418 ShapeCharGlyphProp_Default(psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
3419}
ShapeCharGlyphPropProc charGlyphPropProc
Definition: shape.c:462
static void ShapeCharGlyphProp_Default(ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR *pwcChars, const INT cChars, const WORD *pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp)
Definition: shape.c:2937

Referenced by ScriptShapeOpenType().

◆ SHAPE_CheckFontForRequiredFeatures()

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

Definition at line 3488 of file shape.c.

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

Referenced by requires_fallback(), and ScriptShapeOpenType().

◆ SHAPE_ContextualShaping()

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

Definition at line 3421 of file shape.c.

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

Referenced by ScriptShapeOpenType().

◆ SHAPE_does_GSUB_feature_apply_to_chars()

int SHAPE_does_GSUB_feature_apply_to_chars ( HDC  hdc,
SCRIPT_ANALYSIS *  psa,
ScriptCache *  psc,
const WCHAR *  chars,
int  write_dir,
int  count,
const char *  feature 
)

Definition at line 723 of file shape.c.

725{
726 WORD *glyphs;
727 INT glyph_count = count;
728 INT rc;
729
730 glyphs = calloc(count, 2 * sizeof(*glyphs));
731 NtGdiGetGlyphIndicesW(hdc, chars, count, glyphs, 0);
732 rc = apply_GSUB_feature_to_glyph(hdc, psa, psc, glyphs, 0, write_dir, &glyph_count, feature);
733 if (rc > GSUB_E_NOGLYPH)
734 rc = count - glyph_count;
735 else
736 rc = 0;
737
738 free(glyphs);
739 return rc;
740}
#define calloc
Definition: rosglue.h:14

Referenced by Consonant_is_below_base_form(), Consonant_is_post_base_form(), Consonant_is_pre_base_form(), and Consonant_is_ralf().

◆ SHAPE_GetFontFeatureTags()

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

Definition at line 3557 of file shape.c.

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

Referenced by ScriptGetFontFeatureTags().

◆ SHAPE_GetFontLanguageTags()

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

Definition at line 3529 of file shape.c.

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

Referenced by ScriptGetFontLanguageTags().

◆ SHAPE_GetFontScriptTags()

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

Definition at line 3511 of file shape.c.

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

Referenced by ScriptGetFontScriptTags().

◆ ShapeCharGlyphProp_Arabic()

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

Definition at line 2996 of file shape.c.

2997{
2998 int i,k;
2999 int initGlyph, finaGlyph;
3000 INT dirR, dirL;
3001 BYTE *spaces;
3002
3003 spaces = calloc(cGlyphs, sizeof(*spaces));
3004
3005 if (psa->fLogicalOrder && psa->fRTL)
3006 {
3007 initGlyph = 0;
3008 finaGlyph = cGlyphs-1;
3009 dirR = -1;
3010 dirL = 1;
3011 }
3012 else
3013 {
3014 initGlyph = cGlyphs-1;
3015 finaGlyph = 0;
3016 dirR = 1;
3017 dirL = -1;
3018 }
3019
3020 for (i = 0; i < cGlyphs; i++)
3021 {
3022 for (k = 0; k < cChars; k++)
3023 if (pwLogClust[k] == i)
3024 {
3025 if (pwcChars[k] == 0x0020)
3026 spaces[i] = 1;
3027 }
3028 }
3029
3030 for (i = 0; i < cGlyphs; i++)
3031 {
3032 int char_index[20];
3033 int char_count = 0;
3034 BOOL isInit, isFinal;
3035
3036 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3037 if (k>=0)
3038 {
3039 for (; k < cChars && pwLogClust[k] == i; k++)
3040 char_index[char_count++] = k;
3041 }
3042
3043 isInit = (i == initGlyph || (i+dirR > 0 && i+dirR < cGlyphs && spaces[i+dirR]));
3044 isFinal = (i == finaGlyph || (i+dirL > 0 && i+dirL < cGlyphs && spaces[i+dirL]));
3045
3046 if (char_count == 0)
3047 continue;
3048
3049 if (char_count == 1)
3050 {
3051 if (pwcChars[char_index[0]] == 0x0020) /* space */
3052 {
3054 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3055 }
3056 else if (pwcChars[char_index[0]] == 0x0640) /* kashida */
3058 else if (pwcChars[char_index[0]] == 0x0633) /* SEEN */
3059 {
3060 if (!isInit && !isFinal)
3062 else if (isInit)
3064 else
3066 }
3067 else if (!isInit)
3068 {
3069 if (pwcChars[char_index[0]] == 0x0628 ) /* BA */
3071 else if (pwcChars[char_index[0]] == 0x0631 ) /* RA */
3073 else if (pwcChars[char_index[0]] == 0x0647 ) /* HA */
3075 else if ((pwcChars[char_index[0]] == 0x0627 || pwcChars[char_index[0]] == 0x0625 || pwcChars[char_index[0]] == 0x0623 || pwcChars[char_index[0]] == 0x0622) ) /* alef-like */
3076 pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_ARABIC_ALEF;
3077 else
3078 pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_NONE;
3079 }
3080 else if (!isInit && !isFinal)
3082 else
3084 }
3085 else if (char_count == 2)
3086 {
3087 if ((pwcChars[char_index[0]] == 0x0628 && pwcChars[char_index[1]]== 0x0631) || (pwcChars[char_index[0]] == 0x0631 && pwcChars[char_index[1]]== 0x0628)) /* BA+RA */
3089 else if (!isInit)
3091 else
3093 }
3094 else if (!isInit && !isFinal)
3096 else
3098 }
3099
3100 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3101 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3102 free(spaces);
3103}
int USP10_FindGlyphInLogClust(const WORD *pwLogClust, int cChars, WORD target)
Definition: usp10.c:967
@ SCRIPT_JUSTIFY_ARABIC_RA
@ SCRIPT_JUSTIFY_ARABIC_HA
@ SCRIPT_JUSTIFY_ARABIC_SEEN
@ SCRIPT_JUSTIFY_ARABIC_BLANK
@ SCRIPT_JUSTIFY_ARABIC_NORMAL
@ SCRIPT_JUSTIFY_ARABIC_BA
@ SCRIPT_JUSTIFY_ARABIC_SEEN_M
@ SCRIPT_JUSTIFY_NONE
@ SCRIPT_JUSTIFY_ARABIC_BARA
@ SCRIPT_JUSTIFY_ARABIC_ALEF
@ SCRIPT_JUSTIFY_ARABIC_KASHIDA
WORD fCanGlyphAlone
Definition: usp10.h:221
SCRIPT_VISATTR sva
Definition: usp10.h:215
WORD uJustification
Definition: usp10.h:178
void OpenType_GDEF_UpdateGlyphProps(ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD *pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp)
Definition: opentype.c:755
static void UpdateClustersFromGlyphProp(const int cGlyphs, const int cChars, WORD *pwLogClust, SCRIPT_GLYPHPROP *pGlyphProp)
Definition: shape.c:742
unsigned char BYTE
Definition: xxhash.c:193

◆ ShapeCharGlyphProp_BaseIndic()

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

Definition at line 3265 of file shape.c.

3266{
3267 int i,k;
3268
3269 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3270 for (i = 0; i < cGlyphs; i++)
3271 {
3272 int char_index[20];
3273 int char_count = 0;
3274
3275 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3276 if (k>=0)
3277 {
3278 for (; k < cChars && pwLogClust[k] == i; k++)
3279 char_index[char_count++] = k;
3280 }
3281
3282 if (override_gsub)
3283 {
3284 /* Most indic scripts do not set fDiacritic or fZeroWidth */
3285 pGlyphProp[i].sva.fDiacritic = FALSE;
3286 pGlyphProp[i].sva.fZeroWidth = FALSE;
3287 }
3288
3289 if (char_count == 0)
3290 {
3292 continue;
3293 }
3294
3295 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
3296 {
3298 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3299 }
3300 else
3302
3303 pGlyphProp[i].sva.fClusterStart = 0;
3304 for (k = 0; k < char_count && !pGlyphProp[i].sva.fClusterStart; k++)
3305 switch (lexical(pwcChars[char_index[k]]))
3306 {
3307 case lex_Matra_pre:
3308 case lex_Matra_post:
3309 case lex_Matra_above:
3310 case lex_Matra_below:
3311 case lex_Modifier:
3312 case lex_Halant:
3313 break;
3314 case lex_ZWJ:
3315 case lex_ZWNJ:
3316 /* check for dangling joiners */
3317 if (pwcChars[char_index[k]-1] == 0x0020 || pwcChars[char_index[k]+1] == 0x0020)
3318 pGlyphProp[i].sva.fClusterStart = 1;
3319 else
3320 k = char_count;
3321 break;
3322 default:
3323 pGlyphProp[i].sva.fClusterStart = 1;
3324 break;
3325 }
3326 }
3327
3328 if (use_syllables)
3329 {
3330 IndicSyllable *syllables = NULL;
3331 int syllable_count = 0;
3332 BOOL modern = get_GSUB_Indic2(psa, psc);
3333
3334 Indic_ParseSyllables( hdc, psa, psc, pwcChars, cChars, &syllables, &syllable_count, lexical, modern);
3335
3336 for (i = 0; i < syllable_count; i++)
3337 {
3338 int j;
3339 WORD g = pwLogClust[syllables[i].start];
3340 for (j = syllables[i].start+1; j <= syllables[i].end; j++)
3341 {
3342 if (pwLogClust[j] != g)
3343 {
3344 pGlyphProp[pwLogClust[j]].sva.fClusterStart = 0;
3345 pwLogClust[j] = g;
3346 }
3347 }
3348 }
3349
3350 free(syllables);
3351 }
3352
3353 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3354}
@ SCRIPT_JUSTIFY_BLANK
GLuint start
Definition: gl.h:1545
void Indic_ParseSyllables(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, const WCHAR *input, unsigned int cChar, IndicSyllable **syllables, int *syllable_count, lexical_function lex, BOOL modern)
Definition: indic.c:323
WORD fClusterStart
Definition: usp10.h:179
@ lex_ZWJ
@ lex_ZWNJ

Referenced by ShapeCharGlyphProp_Bengali(), ShapeCharGlyphProp_Devanagari(), ShapeCharGlyphProp_Gujarati(), ShapeCharGlyphProp_Gurmukhi(), ShapeCharGlyphProp_Kannada(), ShapeCharGlyphProp_Khmer(), ShapeCharGlyphProp_Malayalam(), ShapeCharGlyphProp_Oriya(), ShapeCharGlyphProp_Sinhala(), ShapeCharGlyphProp_Tamil(), and ShapeCharGlyphProp_Telugu().

◆ ShapeCharGlyphProp_Bengali()

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

Definition at line 3366 of file shape.c.

3367{
3368 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, bengali_lex, TRUE, TRUE);
3369}
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)
Definition: shape.c:3265

◆ ShapeCharGlyphProp_Control()

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

Definition at line 2980 of file shape.c.

2981{
2982 int i;
2983 for (i = 0; i < cGlyphs; i++)
2984 {
2985 pGlyphProp[i].sva.fClusterStart = 1;
2986 pGlyphProp[i].sva.fDiacritic = 0;
2988
2989 if (pwGlyphs[i] == psc->sfp.wgDefault)
2990 pGlyphProp[i].sva.fZeroWidth = 0;
2991 else
2992 pGlyphProp[i].sva.fZeroWidth = 1;
2993 }
2994}

◆ ShapeCharGlyphProp_Default()

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

Definition at line 2937 of file shape.c.

2938{
2939 int i,k;
2940
2941 for (i = 0; i < cGlyphs; i++)
2942 {
2943 int char_index[20];
2944 int char_count = 0;
2945
2946 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
2947 if (k>=0)
2948 {
2949 for (; k < cChars && pwLogClust[k] == i; k++)
2950 char_index[char_count++] = k;
2951 }
2952
2953 if (char_count == 0)
2954 continue;
2955
2956 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
2957 {
2959 pCharProp[char_index[0]].fCanGlyphAlone = 1;
2960 }
2961 else
2963 }
2964
2965 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
2966 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
2967}
@ SCRIPT_JUSTIFY_CHARACTER

Referenced by SHAPE_CharGlyphProp(), and ShapeCharGlyphProp_Latin().

◆ ShapeCharGlyphProp_Devanagari()

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

Definition at line 3361 of file shape.c.

3362{
3363 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, devanagari_lex, TRUE, TRUE);
3364}

◆ ShapeCharGlyphProp_Gujarati()

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

Definition at line 3376 of file shape.c.

3377{
3378 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, gujarati_lex, TRUE, TRUE);
3379}

◆ ShapeCharGlyphProp_Gurmukhi()

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

Definition at line 3371 of file shape.c.

3372{
3373 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, gurmukhi_lex, TRUE, TRUE);
3374}

◆ ShapeCharGlyphProp_Hebrew()

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

Definition at line 3105 of file shape.c.

3106{
3107 int i,k;
3108
3109 for (i = 0; i < cGlyphs; i++)
3110 {
3111 int char_index[20];
3112 int char_count = 0;
3113
3114 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3115 if (k>=0)
3116 {
3117 for (; k < cChars && pwLogClust[k] == i; k++)
3118 char_index[char_count++] = k;
3119 }
3120
3121 if (char_count == 0)
3123 else
3124 {
3126 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
3127 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3128 }
3129 }
3130
3131 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3132 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3133}

◆ ShapeCharGlyphProp_Kannada()

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

Definition at line 3396 of file shape.c.

3397{
3398 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, kannada_lex, TRUE, TRUE);
3399}

◆ ShapeCharGlyphProp_Khmer()

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

Definition at line 3406 of file shape.c.

3407{
3408 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, khmer_lex, TRUE, TRUE);
3409}

◆ ShapeCharGlyphProp_Latin()

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

Definition at line 2969 of file shape.c.

2970{
2971 int i;
2972
2973 ShapeCharGlyphProp_Default( psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp);
2974
2975 for (i = 0; i < cGlyphs; i++)
2976 if (pGlyphProp[i].sva.fZeroWidth)
2978}

◆ ShapeCharGlyphProp_Malayalam()

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

Definition at line 3401 of file shape.c.

3402{
3403 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, malayalam_lex, TRUE, TRUE);
3404}

◆ ShapeCharGlyphProp_None()

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

Definition at line 3193 of file shape.c.

3194{
3195 int i,k;
3196
3197 for (i = 0; i < cGlyphs; i++)
3198 {
3199 int char_index[20];
3200 int char_count = 0;
3201
3202 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3203 if (k>=0)
3204 {
3205 for (; k < cChars && pwLogClust[k] == i; k++)
3206 char_index[char_count++] = k;
3207 }
3208
3209 if (char_count == 0)
3210 continue;
3211
3212 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
3213 {
3215 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3216 }
3217 else
3219 }
3220 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3221 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3222}

◆ ShapeCharGlyphProp_Oriya()

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

Definition at line 3381 of file shape.c.

3382{
3383 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, oriya_lex, TRUE, TRUE);
3384}

◆ ShapeCharGlyphProp_Sinhala()

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

Definition at line 3356 of file shape.c.

3357{
3358 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, sinhala_lex, FALSE, FALSE);
3359}

◆ ShapeCharGlyphProp_Tamil()

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

Definition at line 3386 of file shape.c.

3387{
3388 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, tamil_lex, TRUE, TRUE);
3389}

◆ ShapeCharGlyphProp_Telugu()

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

Definition at line 3391 of file shape.c.

3392{
3393 ShapeCharGlyphProp_BaseIndic(hdc, psc, psa, pwcChars, cChars, pwGlyphs, cGlyphs, pwLogClust, pCharProp, pGlyphProp, telugu_lex, TRUE, TRUE);
3394}

◆ ShapeCharGlyphProp_Thai()

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

Definition at line 3135 of file shape.c.

3136{
3137 int i;
3138 int finaGlyph;
3139 INT dirL;
3140
3141 if (!psa->fLogicalOrder && psa->fRTL)
3142 {
3143 finaGlyph = 0;
3144 dirL = -1;
3145 }
3146 else
3147 {
3148 finaGlyph = cGlyphs-1;
3149 dirL = 1;
3150 }
3151
3152 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3153
3154 for (i = 0; i < cGlyphs; i++)
3155 {
3156 int k;
3157 int char_index[20];
3158 int char_count = 0;
3159
3160 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3161 if (k>=0)
3162 {
3163 for (; k < cChars && pwLogClust[k] == i; k++)
3164 char_index[char_count++] = k;
3165 }
3166
3167 if (i == finaGlyph)
3169 else
3171
3172 if (char_count == 0)
3173 continue;
3174
3175 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
3176 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3177
3178 /* handle Thai SARA AM (U+0E33) differently than GDEF */
3179 if (char_count == 1 && pwcChars[char_index[0]] == 0x0e33)
3180 pGlyphProp[i].sva.fClusterStart = 0;
3181 }
3182
3183 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3184
3185 /* Do not allow justification between marks and their base */
3186 for (i = 0; i < cGlyphs; i++)
3187 {
3188 if (!pGlyphProp[i].sva.fClusterStart)
3189 pGlyphProp[i-dirL].sva.uJustification = SCRIPT_JUSTIFY_NONE;
3190 }
3191}

◆ ShapeCharGlyphProp_Tibet()

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

Definition at line 3224 of file shape.c.

3225{
3226 int i,k;
3227
3228 for (i = 0; i < cGlyphs; i++)
3229 {
3230 int char_index[20];
3231 int char_count = 0;
3232
3233 k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
3234 if (k>=0)
3235 {
3236 for (; k < cChars && pwLogClust[k] == i; k++)
3237 char_index[char_count++] = k;
3238 }
3239
3240 if (char_count == 0)
3241 continue;
3242
3243 if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
3244 {
3246 pCharProp[char_index[0]].fCanGlyphAlone = 1;
3247 }
3248 else
3250 }
3251 OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
3252 UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
3253
3254 /* Tibeten script does not set sva.fDiacritic or sva.fZeroWidth */
3255 for (i = 0; i < cGlyphs; i++)
3256 {
3257 if (!pGlyphProp[i].sva.fClusterStart)
3258 {
3259 pGlyphProp[i].sva.fDiacritic = 0;
3260 pGlyphProp[i].sva.fZeroWidth = 0;
3261 }
3262 }
3263}

◆ ShapeIndicSyllables()

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

Definition at line 2145 of file shape.c.

2146{
2147 int c;
2148 int overall_shift = 0;
2149 LoadedFeature *locl = (modern)?load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "locl"):NULL;
2150 LoadedFeature *nukt = load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "nukt");
2151 LoadedFeature *akhn = load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "akhn");
2152 LoadedFeature *rkrf = (modern)?load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "rkrf"):NULL;
2153 LoadedFeature *pstf = load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "pstf");
2154 LoadedFeature *vatu = (!rkrf)?load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "vatu"):NULL;
2155 LoadedFeature *cjct = (modern)?load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "cjct"):NULL;
2156 BOOL rphf = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "rphf") != NULL);
2157 BOOL pref = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "pref") != NULL);
2158 BOOL blwf = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "blwf") != NULL);
2159 BOOL half = (load_OT_feature(hdc, psa, psc, FEATURE_GSUB_TABLE, "half") != NULL);
2160 IndicSyllable glyph_indices;
2161
2162 for (c = 0; c < syllable_count; c++)
2163 {
2164 int old_end;
2165 memcpy(&glyph_indices, &syllables[c], sizeof(IndicSyllable));
2166 shift_syllable_glyph_indices(&glyph_indices, -1, overall_shift);
2167 old_end = glyph_indices.end;
2168
2169 if (locl)
2170 {
2171 TRACE("applying feature locl\n");
2172 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, locl);
2173 }
2174 if (nukt)
2175 {
2176 TRACE("applying feature nukt\n");
2177 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, nukt);
2178 }
2179 if (akhn)
2180 {
2181 TRACE("applying feature akhn\n");
2182 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, akhn);
2183 }
2184
2185 if (rphf)
2186 Apply_Indic_Rphf(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices);
2187 if (rkrf)
2188 {
2189 TRACE("applying feature rkrf\n");
2190 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, rkrf);
2191 }
2192 if (pref)
2193 Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "pref");
2194 if (blwf)
2195 {
2196 if (!modern)
2197 Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "blwf");
2198
2199 Apply_Indic_PostBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, modern, "blwf");
2200
2201 }
2202 if (half)
2203 Apply_Indic_PreBase(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, "half");
2204 if (pstf)
2205 {
2206 TRACE("applying feature pstf\n");
2207 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, pstf);
2208 }
2209 if (vatu)
2210 {
2211 TRACE("applying feature vatu\n");
2212 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, vatu);
2213 }
2214 if (cjct)
2215 {
2216 TRACE("applying feature cjct\n");
2217 Apply_Indic_BasicForm(hdc, psc, psa, pwChars, cChars, &syllables[c], pwOutGlyphs, pcGlyphs, pwLogClust, lexical, &glyph_indices, cjct);
2218 }
2219
2220 if (second_reorder)
2221 second_reorder(pwChars, &syllables[c], pwOutGlyphs, &glyph_indices, lexical);
2222
2223 overall_shift += glyph_indices.end - old_end;
2224 }
2225}
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)
Definition: shape.c:2046
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)
Definition: shape.c:2100
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)
Definition: shape.c:2012
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)
Definition: shape.c:2071

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

◆ shift_syllable_glyph_indices()

static void shift_syllable_glyph_indices ( IndicSyllable *  glyph_index,
INT  index,
INT  shift 
)
inlinestatic

Definition at line 1993 of file shape.c.

1994{
1995 if (shift == 0)
1996 return;
1997
1998 if (glyph_index->start > index)
1999 glyph_index->start += shift;
2000 if (glyph_index->base > index)
2001 glyph_index->base+= shift;
2002 if (glyph_index->end > index)
2003 glyph_index->end+= shift;
2004 if (glyph_index->ralf > index)
2005 glyph_index->ralf+= shift;
2006 if (glyph_index->blwf > index)
2007 glyph_index->blwf+= shift;
2008 if (glyph_index->pref > index)
2009 glyph_index->pref+= shift;
2010}
#define shift
Definition: input.c:3280

Referenced by Apply_Indic_BasicForm(), Apply_Indic_PostBase(), Apply_Indic_PreBase(), Apply_Indic_Rphf(), and ShapeIndicSyllables().

◆ sinhala_lex()

static int sinhala_lex ( WCHAR  c)
static

Definition at line 2282 of file shape.c.

2283{
2284 switch (c)
2285 {
2286 case 0x0DDA:
2287 case 0x0DDD:
2288 case 0x0DDC:
2289 case 0x0DDE: return lex_Matra_post;
2290 default:
2291 return unicode_lex(c);
2292 }
2293}

Referenced by ContextualShape_Sinhala(), and ShapeCharGlyphProp_Sinhala().

◆ tamil_lex()

static int tamil_lex ( WCHAR  c)
static

Definition at line 2626 of file shape.c.

2627{
2628 return unicode_lex(c);
2629}

Referenced by ContextualShape_Tamil(), and ShapeCharGlyphProp_Tamil().

◆ telugu_lex()

static int telugu_lex ( WCHAR  c)
static

Definition at line 2677 of file shape.c.

2678{
2679 switch (c)
2680 {
2681 case 0x0C43:
2682 case 0x0C44: return lex_Modifier;
2683 default:
2684 return unicode_lex(c);
2685 }
2686}

Referenced by ContextualShape_Telugu(), and ShapeCharGlyphProp_Telugu().

◆ unicode_lex()

static int unicode_lex ( WCHAR  c)
inlinestatic

Definition at line 2227 of file shape.c.

2228{
2229 int type;
2230
2231 if (!c) return lex_Generic;
2232 if (c == 0x200D) return lex_ZWJ;
2233 if (c == 0x200C) return lex_ZWNJ;
2234 if (c == 0x00A0) return lex_NBSP;
2235
2237
2238 if ((type & 0x00ff) != 0x0007) type = type & 0x00ff;
2239
2240 switch( type )
2241 {
2242 case 0x0d07: /* Unknown */
2243 case 0x0e07: /* Unknown */
2244 default: return lex_Generic;
2245 case 0x0001:
2246 case 0x0002:
2247 case 0x0011:
2248 case 0x0012:
2249 case 0x0013:
2250 case 0x0014: return lex_Modifier;
2251 case 0x0003:
2252 case 0x0009:
2253 case 0x000a:
2254 case 0x000b:
2255 case 0x000d:
2256 case 0x000e:
2257 case 0x000f:
2258 case 0x0010: return lex_Consonant;
2259 case 0x0004: return lex_Nukta;
2260 case 0x0005: return lex_Halant;
2261 case 0x0006:
2262 case 0x0008: return lex_Vowel;
2263 case 0x0007:
2264 case 0x0107: return lex_Matra_post;
2265 case 0x0207:
2266 case 0x0307: return lex_Matra_pre;
2267 case 0x0807:
2268 case 0x0907:
2269 case 0x0a07:
2270 case 0x0b07:
2271 case 0x0c07:
2272 case 0x0f07:
2273 case 0x1007:
2274 case 0x0407: return lex_Composed_Vowel;
2275 case 0x0507: return lex_Matra_above;
2276 case 0x0607: return lex_Matra_below;
2277 case 0x000c:
2278 case 0x0015: return lex_Ra;
2279 };
2280}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
@ lex_Consonant
@ lex_Generic
@ lex_NBSP
@ lex_Composed_Vowel
const unsigned short indic_syllabic_table[]
Definition: indicsyllable.c:8

Referenced by bengali_lex(), devanagari_lex(), gujarati_lex(), gurmukhi_lex(), kannada_lex(), khmer_lex(), malayalam_lex(), oriya_lex(), sinhala_lex(), tamil_lex(), and telugu_lex().

◆ UpdateClusters()

static void UpdateClusters ( int  nextIndex,
int  changeCount,
int  write_dir,
int  chars,
WORD *  pwLogClust 
)
static

Definition at line 766 of file shape.c.

767{
768 if (changeCount == 0)
769 return;
770 else
771 {
772 int cluster_dir = pwLogClust[0] < pwLogClust[chars-1] ? 1 : -1;
773 int i;
774 int target_glyph = nextIndex - write_dir;
775 int target_index = -1;
776 int replacing_glyph = -1;
777 int changed = 0;
778
779 if (changeCount > 0)
780 {
781 if (write_dir > 0)
782 target_glyph = nextIndex - changeCount;
783 else
784 target_glyph = nextIndex + (changeCount + 1);
785 }
786
787 target_index = USP10_FindGlyphInLogClust(pwLogClust, chars, target_glyph);
788 if (target_index == -1)
789 {
790 ERR("Unable to find target glyph\n");
791 return;
792 }
793
794 if (changeCount < 0)
795 {
796 /* merge glyphs */
797 for (i = target_index; i < chars && i >= 0; i += cluster_dir)
798 {
799 if (pwLogClust[i] == target_glyph)
800 continue;
801 if(pwLogClust[i] == replacing_glyph)
802 pwLogClust[i] = target_glyph;
803 else
804 {
805 changed--;
806 if (changed >= changeCount)
807 {
808 replacing_glyph = pwLogClust[i];
809 pwLogClust[i] = target_glyph;
810 }
811 else
812 break;
813 }
814 }
815
816 /* renumber trailing indices */
817 for (i = target_index; i < chars && i >= 0; i += cluster_dir)
818 {
819 if (pwLogClust[i] != target_glyph)
820 pwLogClust[i] += changeCount;
821 }
822 }
823 else
824 {
825 for (i = target_index; i < chars && i >= 0; i += cluster_dir)
826 pwLogClust[i] += changeCount;
827 }
828 }
829}

Referenced by apply_GSUB_feature(), Apply_Indic_BasicForm(), Apply_Indic_PostBase(), Apply_Indic_PreBase(), Apply_Indic_Rphf(), ContextualShape_Arabic(), ContextualShape_Mongolian(), ContextualShape_Phags_pa(), ContextualShape_Syriac(), DecomposeVowels(), and insert_glyph().

◆ UpdateClustersFromGlyphProp()

static void UpdateClustersFromGlyphProp ( const int  cGlyphs,
const int  cChars,
WORD *  pwLogClust,
SCRIPT_GLYPHPROP *  pGlyphProp 
)
static

Definition at line 742 of file shape.c.

743{
744 int i;
745
746 for (i = 0; i < cGlyphs; i++)
747 {
748 if (!pGlyphProp[i].sva.fClusterStart)
749 {
750 int j;
751 for (j = 0; j < cChars; j++)
752 {
753 if (pwLogClust[j] == i)
754 {
755 int k = j;
756 while (k >= 0 && k <cChars && !pGlyphProp[pwLogClust[k]].sva.fClusterStart)
757 k-=1;
758 if (k >= 0 && k <cChars && pGlyphProp[pwLogClust[k]].sva.fClusterStart)
759 pwLogClust[j] = pwLogClust[k];
760 }
761 }
762 }
763 }
764}

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( uniscribe  )

◆ word_break_causing()

static BOOL word_break_causing ( WCHAR  chr)
inlinestatic

Definition at line 1015 of file shape.c.

1016{
1017 /* we are working within a string of characters already guaranteed to
1018 be within one script, Syriac, so we do not worry about any character
1019 other than the space character outside of that range */
1020 return (chr == 0 || chr == 0x20 );
1021}

Referenced by ContextualShape_Syriac().

Variable Documentation

◆ arabic_features

OPENTYPE_FEATURE_RECORD arabic_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('r','l','i','g'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
{ MS_MAKE_TAG('l','i','g','a'), 1},
{ MS_MAKE_TAG('d','l','i','g'), 1},
{ MS_MAKE_TAG('c','s','w','h'), 1},
{ MS_MAKE_TAG('m','s','e','t'), 1},
}

Definition at line 171 of file shape.c.

◆ arabic_gpos_features

OPENTYPE_FEATURE_RECORD arabic_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','u','r','s'), 1},
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('m','a','r','k'), 1},
{ MS_MAKE_TAG('m','k','m','k'), 1},
}

Definition at line 190 of file shape.c.

◆ Bengali_consonants

const ConsonantComponents Bengali_consonants[]
static
Initial value:
= {
{{0x09A4,0x09CD,0x200D}, 0x09CE},
{{0x09A1,0x09BC,0x0000}, 0x09DC},
{{0x09A2,0x09BC,0x0000}, 0x09DD},
{{0x09AF,0x09BC,0x0000}, 0x09DF},
{{0x0000,0x0000,0x0000}, 0x0000}}

Definition at line 2421 of file shape.c.

Referenced by ContextualShape_Bengali().

◆ Bengali_vowels

const VowelComponents Bengali_vowels[]
static
Initial value:
= {
{0x09CB, {0x09C7,0x09BE,0x0000}},
{0x09CC, {0x09C7,0x09D7,0x0000}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2416 of file shape.c.

Referenced by ContextualShape_Bengali().

◆ contextual_features

const char* const contextual_features[]
static
Initial value:
=
{
"isol",
"fina",
"init",
"medi",
"med2",
"fin2",
"fin3"
}

Definition at line 138 of file shape.c.

Referenced by ContextualShape_Arabic(), ContextualShape_Mongolian(), ContextualShape_Phags_pa(), and ContextualShape_Syriac().

◆ Devanagari_consonants

const ConsonantComponents Devanagari_consonants[]
static
Initial value:
={
{{0x0928, 0x093C, 0x00000}, 0x0929},
{{0x0930, 0x093C, 0x00000}, 0x0931},
{{0x0933, 0x093C, 0x00000}, 0x0934},
{{0x0915, 0x093C, 0x00000}, 0x0958},
{{0x0916, 0x093C, 0x00000}, 0x0959},
{{0x0917, 0x093C, 0x00000}, 0x095A},
{{0x091C, 0x093C, 0x00000}, 0x095B},
{{0x0921, 0x093C, 0x00000}, 0x095C},
{{0x0922, 0x093C, 0x00000}, 0x095D},
{{0x092B, 0x093C, 0x00000}, 0x095E},
{{0x092F, 0x093C, 0x00000}, 0x095F},
{{0x0000, 0x0000, 0x00000}, 0x0000}}

Definition at line 2357 of file shape.c.

Referenced by ContextualShape_Devanagari().

◆ devanagari_features

OPENTYPE_FEATURE_RECORD devanagari_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('p','r','e','s'), 1},
{ MS_MAKE_TAG('a','b','v','s'), 1},
{ MS_MAKE_TAG('b','l','w','s'), 1},
{ MS_MAKE_TAG('p','s','t','s'), 1},
{ MS_MAKE_TAG('h','a','l','n'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
}

Definition at line 298 of file shape.c.

◆ devanagari_gpos_features

OPENTYPE_FEATURE_RECORD devanagari_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('d','i','s','t'), 1},
{ MS_MAKE_TAG('a','b','v','m'), 1},
{ MS_MAKE_TAG('b','l','w','m'), 1},
}

Definition at line 308 of file shape.c.

◆ ethiopic_features

OPENTYPE_FEATURE_RECORD ethiopic_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','c','m','p'), 1},
{ MS_MAKE_TAG('l','o','c','l'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
{ MS_MAKE_TAG('l','i','g','a'), 1},
}

Definition at line 440 of file shape.c.

◆ Gurmukhi_consonants

const ConsonantComponents Gurmukhi_consonants[]
static
Initial value:
= {
{{0x0A32,0x0A3C,0x0000}, 0x0A33},
{{0x0A16,0x0A3C,0x0000}, 0x0A59},
{{0x0A17,0x0A3C,0x0000}, 0x0A5A},
{{0x0A1C,0x0A3C,0x0000}, 0x0A5B},
{{0x0A2B,0x0A3C,0x0000}, 0x0A5E},
{{0x0000,0x0000,0x0000}, 0x0000}}

Definition at line 2485 of file shape.c.

Referenced by ContextualShape_Gurmukhi().

◆ hebrew_features

OPENTYPE_FEATURE_RECORD hebrew_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','c','m','p'), 1},
{ MS_MAKE_TAG('d','l','i','g'), 0},
}

Definition at line 198 of file shape.c.

◆ hebrew_gpos_features

OPENTYPE_FEATURE_RECORD hebrew_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('m','a','r','k'), 1},
}

Definition at line 204 of file shape.c.

◆ indic_syllabic_table

const unsigned short indic_syllabic_table[]
extern

Definition at line 8 of file indicsyllable.c.

Referenced by unicode_lex().

◆ Kannada_vowels

const VowelComponents Kannada_vowels[]
static
Initial value:
= {
{0x0CC0, {0x0CBF,0x0CD5,0x0000}},
{0x0CC7, {0x0CC6,0x0CD5,0x0000}},
{0x0CC8, {0x0CC6,0x0CD6,0x0000}},
{0x0CCA, {0x0CC6,0x0CC2,0x0000}},
{0x0CCB, {0x0CC6,0x0CC2,0x0CD5}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2737 of file shape.c.

Referenced by ContextualShape_Kannada().

◆ khmer_features

OPENTYPE_FEATURE_RECORD khmer_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('p','r','e','s'), 1},
{ MS_MAKE_TAG('b','l','w','s'), 1},
{ MS_MAKE_TAG('a','b','v','s'), 1},
{ MS_MAKE_TAG('p','s','t','s'), 1},
{ MS_MAKE_TAG('c','l','i','g'), 1},
}

Definition at line 409 of file shape.c.

◆ khmer_gpos_features

OPENTYPE_FEATURE_RECORD khmer_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('d','i','s','t'), 1},
{ MS_MAKE_TAG('b','l','w','m'), 1},
{ MS_MAKE_TAG('a','b','v','m'), 1},
{ MS_MAKE_TAG('m','k','m','k'), 1},
}

Definition at line 432 of file shape.c.

◆ latin_features

OPENTYPE_FEATURE_RECORD latin_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('l','o','c','l'), 1},
{ MS_MAKE_TAG('c','c','m','p'), 1},
{ MS_MAKE_TAG('l','i','g','a'), 1},
{ MS_MAKE_TAG('c','l','i','g'), 1},
}

Definition at line 156 of file shape.c.

◆ latin_gpos_features

OPENTYPE_FEATURE_RECORD latin_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('m','a','r','k'), 1},
{ MS_MAKE_TAG('m','k','m','k'), 1},
}

Definition at line 164 of file shape.c.

◆ Malayalam_vowels

const VowelComponents Malayalam_vowels[]
static
Initial value:
= {
{0x0D4A, {0x0D46,0x0D3E,0x0000}},
{0x0D4B, {0x0D47,0x0D3E,0x0000}},
{0x0D4C, {0x0D46,0x0D57,0x0000}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2785 of file shape.c.

Referenced by ContextualShape_Malayalam().

◆ mongolian_features

OPENTYPE_FEATURE_RECORD mongolian_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','c','m','p'), 1},
{ MS_MAKE_TAG('l','o','c','l'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
{ MS_MAKE_TAG('r','l','i','g'), 1},
}

Definition at line 448 of file shape.c.

◆ myanmar_features

OPENTYPE_FEATURE_RECORD myanmar_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('l','i','g','a'), 1},
{ MS_MAKE_TAG('c','l','i','g'), 1},
}

Definition at line 316 of file shape.c.

◆ Oriya_consonants

const ConsonantComponents Oriya_consonants[]
static
Initial value:
= {
{{0x0B21,0x0B3C,0x0000}, 0x0B5C},
{{0x0B22,0x0B3C,0x0000}, 0x0B5D},
{{0x0000,0x0000,0x0000}, 0x0000}}

Definition at line 2585 of file shape.c.

Referenced by ContextualShape_Oriya().

◆ Oriya_vowels

const VowelComponents Oriya_vowels[]
static
Initial value:
= {
{0x0B48, {0x0B47,0x0B56,0x0000}},
{0x0B4B, {0x0B47,0x0B3E,0x0000}},
{0x0B4C, {0x0B47,0x0B57,0x0000}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2579 of file shape.c.

Referenced by ContextualShape_Oriya().

◆ phags_features

OPENTYPE_FEATURE_RECORD phags_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('a','b','v','s'), 1},
{ MS_MAKE_TAG('b','l','w','s'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
}

Definition at line 257 of file shape.c.

◆ required_arabic_features

const char* const required_arabic_features[]
static
Initial value:
=
{
"fina",
"init",
"medi",
"rlig",
}

Definition at line 181 of file shape.c.

◆ required_bengali_features

const char* const required_bengali_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"blwf",
"half",
"vatu",
"pstf",
"init",
"abvs",
"blws",
"psts",
"haln",
}

Definition at line 322 of file shape.c.

◆ required_devanagari_features

const char* const required_devanagari_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"blwf",
"half",
"vatu",
"pres",
"abvs",
"blws",
"psts",
"haln",
}

Definition at line 282 of file shape.c.

◆ required_gurmukhi_features

const char* const required_gurmukhi_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"blwf",
"half",
"pstf",
"vatu",
"cjct",
"pres",
"abvs",
"blws",
"psts",
"haln",
"calt",
}

Definition at line 339 of file shape.c.

◆ required_khmer_features

const char* const required_khmer_features[]
static
Initial value:
=
{
"pref",
"blwf",
"abvf",
"pstf",
"pres",
"blws",
"abvs",
"psts",
"clig",
}

Definition at line 418 of file shape.c.

◆ required_lao_features

const char* const required_lao_features[]
static
Initial value:
=
{
"ccmp",
}

Definition at line 276 of file shape.c.

◆ required_oriya_features

const char* const required_oriya_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"blwf",
"pstf",
"cjct",
"pres",
"abvs",
"blws",
"psts",
"haln",
"calt",
}

Definition at line 358 of file shape.c.

◆ required_syriac_features

const char* const required_syriac_features[]
static
Initial value:
=
{
"fina",
"fin2",
"fin3",
"init",
"medi",
"med2",
"rlig",
}

Definition at line 218 of file shape.c.

◆ required_tamil_features

const char* const required_tamil_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"pref",
"half",
"pres",
"abvs",
"blws",
"psts",
"haln",
"calt",
}

Definition at line 375 of file shape.c.

◆ required_telugu_features

const char* const required_telugu_features[]
static
Initial value:
=
{
"nukt",
"akhn",
"rphf",
"pref",
"half",
"pstf",
"cjct",
"pres",
"abvs",
"blws",
"psts",
"haln",
"calt",
}

Definition at line 391 of file shape.c.

◆ scriptInformation

◆ ShapingData

◆ sinhala_features

OPENTYPE_FEATURE_RECORD sinhala_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('b','l','w','s'), 1},
{ MS_MAKE_TAG('a','b','v','s'), 1},
{ MS_MAKE_TAG('p','s','t','s'), 1},
}

Definition at line 237 of file shape.c.

◆ Sinhala_vowels

const VowelComponents Sinhala_vowels[]
static
Initial value:
= {
{0x0DDA, {0x0DD9,0x0DDA,0x0}},
{0x0DDC, {0x0DD9,0x0DDC,0x0}},
{0x0DDD, {0x0DD9,0x0DDD,0x0}},
{0x0DDE, {0x0DD9,0x0DDE,0x0}},
{0x0000, {0x0000,0x0000,0x0}}}

Definition at line 2295 of file shape.c.

Referenced by ContextualShape_Sinhala().

◆ standard_features

OPENTYPE_FEATURE_RECORD standard_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','c','m','p'), 1},
{ MS_MAKE_TAG('l','o','c','l'), 1},
}

Definition at line 150 of file shape.c.

◆ syriac_features

OPENTYPE_FEATURE_RECORD syriac_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('r','l','i','g'), 1},
{ MS_MAKE_TAG('c','a','l','t'), 1},
{ MS_MAKE_TAG('l','i','g','a'), 1},
{ MS_MAKE_TAG('d','l','i','g'), 1},
}

Definition at line 210 of file shape.c.

◆ syriac_gpos_features

OPENTYPE_FEATURE_RECORD syriac_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('m','a','r','k'), 1},
{ MS_MAKE_TAG('m','k','m','k'), 1},
}

Definition at line 230 of file shape.c.

◆ Tamil_consonants

const ConsonantComponents Tamil_consonants[]
static
Initial value:
= {
{{0x0B92,0x0BD7,0x0000}, 0x0B94},
{{0x0000,0x0000,0x0000}, 0x0000}}

Definition at line 2637 of file shape.c.

Referenced by ContextualShape_Tamil().

◆ Tamil_vowels

const VowelComponents Tamil_vowels[]
static
Initial value:
= {
{0x0BCA, {0x0BC6,0x0BBE,0x0000}},
{0x0BCB, {0x0BC7,0x0BBE,0x0000}},
{0x0BCB, {0x0BC6,0x0BD7,0x0000}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2631 of file shape.c.

Referenced by ContextualShape_Tamil().

◆ Telugu_vowels

const VowelComponents Telugu_vowels[]
static
Initial value:
= {
{0x0C48, {0x0C46,0x0C56,0x0000}},
{0x0000, {0x0000,0x0000,0x0000}}}

Definition at line 2688 of file shape.c.

Referenced by ContextualShape_Telugu().

◆ thai_features

OPENTYPE_FEATURE_RECORD thai_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('c','c','m','p'), 1},
}

Definition at line 264 of file shape.c.

◆ thai_gpos_features

OPENTYPE_FEATURE_RECORD thai_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('k','e','r','n'), 1},
{ MS_MAKE_TAG('m','a','r','k'), 1},
{ MS_MAKE_TAG('m','k','m','k'), 1},
}

Definition at line 269 of file shape.c.

◆ tibetan_features

OPENTYPE_FEATURE_RECORD tibetan_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('a','b','v','s'), 1},
{ MS_MAKE_TAG('b','l','w','s'), 1},
}

Definition at line 245 of file shape.c.

◆ tibetan_gpos_features

OPENTYPE_FEATURE_RECORD tibetan_gpos_features[]
static
Initial value:
=
{
{ MS_MAKE_TAG('a','b','v','m'), 1},
{ MS_MAKE_TAG('b','l','w','m'), 1},
}

Definition at line 251 of file shape.c.

◆ wine_shaping_forms

const unsigned short wine_shaping_forms[LAST_ARABIC_CHAR - FIRST_ARABIC_CHAR+1][4]
extern

Definition at line 279 of file shaping.c.

Referenced by ContextualShape_Arabic().

◆ wine_shaping_table

const unsigned short wine_shaping_table[]
extern

Definition at line 7 of file shaping.c.

Referenced by ContextualShape_Arabic(), and ContextualShape_Syriac().