1 --- harfbuzz-0.9.16/src/hb-uniscribe.cc 2013-04-19 03:36:12.000000000 +0200
2 +++ harfbuzz-0.9.16/src/hb-uniscribe.cc 2013-05-08 17:13:37.874217344 +0200
7 +typedef HRESULT WINAPI (*SIOT)(const WCHAR*,int,int,const SCRIPT_CONTROL*,const SCRIPT_STATE*,SCRIPT_ITEM*,OPENTYPE_TAG*,int*);
8 +typedef HRESULT WINAPI (*SSOT)(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,int,int,WORD*,SCRIPT_CHARPROP*,WORD*,SCRIPT_GLYPHPROP*,int*);
9 +typedef HRESULT WINAPI (*SPOT)(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,const WORD*,const SCRIPT_CHARPROP*,int,const WORD*,const SCRIPT_GLYPHPROP*,int,int*,GOFFSET*,ABC*);
15 hb_face_t *face = font->face;
16 hb_uniscribe_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
17 hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
21 + HMODULE hinstLib = GetModuleHandle("usp10.dll");
32 + siot = (SIOT)GetProcAddress(hinstLib, "ScriptItemizeOpenType");
34 + ssot = (SSOT)GetProcAddress(hinstLib, "ScriptShapeOpenType");
36 + spot = (SPOT)GetProcAddress(hinstLib, "ScriptPlaceOpenType");
41 unsigned int scratch_size;
44 ALLOCATE_ARRAY (WORD, glyphs, glyphs_size);
45 ALLOCATE_ARRAY (SCRIPT_GLYPHPROP, glyph_props, glyphs_size);
46 + ALLOCATE_ARRAY (SCRIPT_VISATTR, vis_attr, glyphs_size);
47 ALLOCATE_ARRAY (int, advances, glyphs_size);
48 ALLOCATE_ARRAY (GOFFSET, offsets, glyphs_size);
49 ALLOCATE_ARRAY (uint32_t, vis_clusters, glyphs_size);
51 bidi_state.uBidiLevel = HB_DIRECTION_IS_FORWARD (buffer->props.direction) ? 0 : 1;
52 bidi_state.fOverrideDirection = 1;
54 - hr = ScriptItemizeOpenType (wchars,
55 + if (siot && ssot && spot) {
66 + hr = ScriptItemize(wchars,
74 if (unlikely (FAILED (hr)))
75 FAIL ("ScriptItemizeOpenType() failed: 0x%08xL", hr);
78 unsigned int item_chars_len = items[i + 1].iCharPos - chars_offset;
81 - hr = ScriptShapeOpenType (font_data->hdc,
82 + if (siot && ssot && spot) {
83 + hr = ssot (font_data->hdc,
84 &font_data->script_cache,
88 glyphs + glyphs_offset,
89 glyph_props + glyphs_offset,
93 + hr = ScriptShape (font_data->hdc,
94 + &font_data->script_cache,
95 + wchars + chars_offset,
97 + glyphs_size - glyphs_offset,
100 + glyphs + glyphs_offset,
101 + log_clusters + chars_offset,
102 + vis_attr + glyphs_offset,
103 + (int *) &glyphs_len);
106 if (unlikely (items[i].a.fNoGlyphIndex))
107 FAIL ("ScriptShapeOpenType() set fNoGlyphIndex");
109 for (unsigned int j = chars_offset; j < chars_offset + item_chars_len; j++)
110 log_clusters[j] += glyphs_offset;
112 - hr = ScriptPlaceOpenType (font_data->hdc,
113 + if (siot && ssot && spot) {
114 + hr = spot (font_data->hdc,
115 &font_data->script_cache,
119 advances + glyphs_offset,
120 offsets + glyphs_offset,
124 + hr = ScriptPlace (font_data->hdc,
125 + &font_data->script_cache,
126 + glyphs + glyphs_offset,
128 + vis_attr + glyphs_offset,
131 + advances + glyphs_offset,
132 + offsets + glyphs_offset,
135 if (unlikely (FAILED (hr)))
136 FAIL ("ScriptPlaceOpenType() failed: 0x%08xL", hr);