Commit 2bd19a89 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Handle new OpenType tags for Microsoft Indic fonts.

parent c5f41f89
...@@ -376,6 +376,7 @@ typedef struct ScriptShapeDataTag { ...@@ -376,6 +376,7 @@ typedef struct ScriptShapeDataTag {
TEXTRANGE_PROPERTIES defaultTextRange; TEXTRANGE_PROPERTIES defaultTextRange;
const char** requiredFeatures; const char** requiredFeatures;
CHAR otTag[5]; CHAR otTag[5];
CHAR newOtTag[5];
ContextualShapingProc contextProc; ContextualShapingProc contextProc;
ShapeCharGlyphPropProc charGlyphPropProc; ShapeCharGlyphPropProc charGlyphPropProc;
} ScriptShapeData; } ScriptShapeData;
...@@ -383,30 +384,30 @@ typedef struct ScriptShapeDataTag { ...@@ -383,30 +384,30 @@ typedef struct ScriptShapeDataTag {
/* in order of scripts */ /* in order of scripts */
static const ScriptShapeData ShapingData[] = static const ScriptShapeData ShapingData[] =
{ {
{{ standard_features, 2}, NULL, "", NULL, NULL}, {{ standard_features, 2}, NULL, "", "", NULL, NULL},
{{ standard_features, 2}, NULL, "latn", NULL, NULL}, {{ standard_features, 2}, NULL, "latn", "", NULL, NULL},
{{ standard_features, 2}, NULL, "latn", NULL, NULL}, {{ standard_features, 2}, NULL, "latn", "", NULL, NULL},
{{ standard_features, 2}, NULL, "latn", NULL, NULL}, {{ standard_features, 2}, NULL, "latn", "", NULL, NULL},
{{ standard_features, 2}, NULL, "" , NULL, NULL}, {{ standard_features, 2}, NULL, "" , "", NULL, NULL},
{{ standard_features, 2}, NULL, "latn", NULL, NULL}, {{ standard_features, 2}, NULL, "latn", "", NULL, NULL},
{{ arabic_features, 6}, required_arabic_features, "arab", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic}, {{ arabic_features, 6}, required_arabic_features, "arab", "", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic},
{{ arabic_features, 6}, required_arabic_features, "arab", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic}, {{ arabic_features, 6}, required_arabic_features, "arab", "", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic},
{{ hebrew_features, 1}, NULL, "hebr", NULL, NULL}, {{ hebrew_features, 1}, NULL, "hebr", "", NULL, NULL},
{{ syriac_features, 4}, required_syriac_features, "syrc", ContextualShape_Syriac, ShapeCharGlyphProp_None}, {{ syriac_features, 4}, required_syriac_features, "syrc", "", ContextualShape_Syriac, ShapeCharGlyphProp_None},
{{ arabic_features, 6}, required_arabic_features, "arab", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic}, {{ arabic_features, 6}, required_arabic_features, "arab", "", ContextualShape_Arabic, ShapeCharGlyphProp_Arabic},
{{ NULL, 0}, NULL, "thaa", NULL, ShapeCharGlyphProp_None}, {{ NULL, 0}, NULL, "thaa", "", NULL, ShapeCharGlyphProp_None},
{{ standard_features, 2}, NULL, "grek", NULL, NULL}, {{ standard_features, 2}, NULL, "grek", "", NULL, NULL},
{{ standard_features, 2}, NULL, "cyrl", NULL, NULL}, {{ standard_features, 2}, NULL, "cyrl", "", NULL, NULL},
{{ standard_features, 2}, NULL, "armn", NULL, NULL}, {{ standard_features, 2}, NULL, "armn", "", NULL, NULL},
{{ standard_features, 2}, NULL, "geor", NULL, NULL}, {{ standard_features, 2}, NULL, "geor", "", NULL, NULL},
{{ sinhala_features, 7}, NULL, "sinh", NULL, NULL}, {{ sinhala_features, 7}, NULL, "sinh", "", NULL, NULL},
{{ tibetan_features, 2}, NULL, "tibt", NULL, ShapeCharGlyphProp_Tibet}, {{ tibetan_features, 2}, NULL, "tibt", "", NULL, ShapeCharGlyphProp_Tibet},
{{ tibetan_features, 2}, NULL, "tibt", NULL, ShapeCharGlyphProp_Tibet}, {{ tibetan_features, 2}, NULL, "tibt", "", NULL, ShapeCharGlyphProp_Tibet},
{{ tibetan_features, 2}, NULL, "phag", ContextualShape_Phags_pa, ShapeCharGlyphProp_Thai}, {{ tibetan_features, 2}, NULL, "phag", "", ContextualShape_Phags_pa, ShapeCharGlyphProp_Thai},
{{ thai_features, 1}, NULL, "thai", NULL, ShapeCharGlyphProp_Thai}, {{ thai_features, 1}, NULL, "thai", "", NULL, ShapeCharGlyphProp_Thai},
{{ thai_features, 1}, NULL, "thai", NULL, ShapeCharGlyphProp_Thai}, {{ thai_features, 1}, NULL, "thai", "", NULL, ShapeCharGlyphProp_Thai},
{{ thai_features, 1}, required_lao_features, "lao", NULL, ShapeCharGlyphProp_Thai}, {{ thai_features, 1}, required_lao_features, "lao", "", NULL, ShapeCharGlyphProp_Thai},
{{ thai_features, 1}, required_lao_features, "lao", NULL, ShapeCharGlyphProp_Thai}, {{ thai_features, 1}, required_lao_features, "lao", "", NULL, ShapeCharGlyphProp_Thai},
}; };
static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph)
...@@ -816,12 +817,20 @@ static INT GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature* fe ...@@ -816,12 +817,20 @@ static INT GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature* fe
return out_index; return out_index;
} }
static const char* get_opentype_script(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc) static const char* get_opentype_script(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc, BOOL tryNew)
{ {
UINT charset; UINT charset;
if (psc->userScript != 0) if (psc->userScript != 0)
return (char*)&psc->userScript; {
if (tryNew && ShapingData[psa->eScript].newOtTag[0] != 0 && strncmp((char*)&psc->userScript,ShapingData[psa->eScript].otTag,4)==0)
return ShapingData[psa->eScript].newOtTag;
else
return (char*)&psc->userScript;
}
if (tryNew && ShapingData[psa->eScript].newOtTag[0] != 0)
return ShapingData[psa->eScript].newOtTag;
if (ShapingData[psa->eScript].otTag[0] != 0) if (ShapingData[psa->eScript].otTag[0] != 0)
return ShapingData[psa->eScript].otTag; return ShapingData[psa->eScript].otTag;
...@@ -866,17 +875,22 @@ static LPCVOID load_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc ...@@ -866,17 +875,22 @@ static LPCVOID load_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache *psc
{ {
const GSUB_Script *script; const GSUB_Script *script;
const GSUB_LangSys *language; const GSUB_LangSys *language;
int attempt = 2;
script = GSUB_get_script_table(psc->GSUB_Table, get_opentype_script(hdc,psa,psc)); do
if (script)
{ {
if (psc->userLang != 0) script = GSUB_get_script_table(psc->GSUB_Table, get_opentype_script(hdc,psa,psc,(attempt==2)));
language = GSUB_get_lang_table(script,(char*)&psc->userLang); attempt--;
else if (script)
language = GSUB_get_lang_table(script, "xxxx"); /* Need to get Lang tag */ {
if (language) if (psc->userLang != 0)
feature = GSUB_get_feature(psc->GSUB_Table, language, feat); language = GSUB_get_lang_table(script,(char*)&psc->userLang);
} else
language = GSUB_get_lang_table(script, "xxxx"); /* Need to get Lang tag */
if (language)
feature = GSUB_get_feature(psc->GSUB_Table, language, feat);
}
} while(attempt && !feature);
/* try in the default (latin) table */ /* try in the default (latin) table */
if (!feature) if (!feature)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment