@@ -842,19 +842,23 @@ static inline WORD set_cache_glyph(SCRIPT_CACHE *psc, WCHAR c, WORD glyph)
842
842
return ((* block )[(c % 0x10000 ) & GLYPH_BLOCK_MASK ] = glyph );
843
843
}
844
844
845
- static inline BOOL get_cache_glyph_widths (SCRIPT_CACHE * psc , WORD glyph , ABC * abc )
845
+ static inline BOOL get_cache_glyph_widths (SCRIPT_CACHE * psc , WORD glyph , ABC * abc , BOOL no_glyph_index )
846
846
{
847
847
static const ABC nil ;
848
- ABC * block = ((ScriptCache * )* psc )-> widths [glyph >> GLYPH_BLOCK_SHIFT ];
848
+ ABC * block = no_glyph_index ?
849
+ ((ScriptCache * )* psc )-> widths [glyph >> GLYPH_BLOCK_SHIFT ] :
850
+ ((ScriptCache * )* psc )-> glyph_widths [glyph >> GLYPH_BLOCK_SHIFT ];
849
851
850
852
if (!block || !memcmp (& block [glyph & GLYPH_BLOCK_MASK ], & nil , sizeof (ABC ))) return FALSE;
851
853
memcpy (abc , & block [glyph & GLYPH_BLOCK_MASK ], sizeof (ABC ));
852
854
return TRUE;
853
855
}
854
856
855
- static inline BOOL set_cache_glyph_widths (SCRIPT_CACHE * psc , WORD glyph , ABC * abc )
857
+ static inline BOOL set_cache_glyph_widths (SCRIPT_CACHE * psc , WORD glyph , ABC * abc , BOOL no_glyph_index )
856
858
{
857
- ABC * * block = & ((ScriptCache * )* psc )-> widths [glyph >> GLYPH_BLOCK_SHIFT ];
859
+ ABC * * block = no_glyph_index ?
860
+ & ((ScriptCache * )* psc )-> widths [glyph >> GLYPH_BLOCK_SHIFT ] :
861
+ & ((ScriptCache * )* psc )-> glyph_widths [glyph >> GLYPH_BLOCK_SHIFT ];
858
862
859
863
if (!* block && !(* block = heap_alloc_zero (sizeof (ABC ) * GLYPH_BLOCK_SIZE ))) return FALSE;
860
864
memcpy (& (* block )[glyph & GLYPH_BLOCK_MASK ], abc , sizeof (ABC ));
@@ -3421,7 +3425,7 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
3421
3425
{
3422
3426
abc .abcA = abc .abcB = abc .abcC = 0 ;
3423
3427
}
3424
- else if (!get_cache_glyph_widths (psc , pwGlyphs [i ], & abc ))
3428
+ else if (!get_cache_glyph_widths (psc , pwGlyphs [i ], & abc , psa -> fNoGlyphIndex ))
3425
3429
{
3426
3430
BOOL ret ;
3427
3431
if (!hdc ) return E_PENDING ;
@@ -3444,7 +3448,7 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
3444
3448
abc .abcB = width ;
3445
3449
abc .abcA = abc .abcC = 0 ;
3446
3450
}
3447
- set_cache_glyph_widths (psc , pwGlyphs [i ], & abc );
3451
+ set_cache_glyph_widths (psc , pwGlyphs [i ], & abc , psa -> fNoGlyphIndex );
3448
3452
}
3449
3453
if (pABC )
3450
3454
{
@@ -3705,7 +3709,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
3705
3709
if (!abc ) return E_INVALIDARG ;
3706
3710
if ((hr = init_script_cache (hdc , psc )) != S_OK ) return hr ;
3707
3711
3708
- if (!get_cache_glyph_widths (psc , glyph , abc ))
3712
+ if (!get_cache_glyph_widths (psc , glyph , abc , FALSE ))
3709
3713
{
3710
3714
if (!hdc ) return E_PENDING ;
3711
3715
if ((get_cache_pitch_family (psc ) & TMPF_TRUETYPE ))
@@ -3719,7 +3723,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
3719
3723
abc -> abcB = width ;
3720
3724
abc -> abcA = abc -> abcC = 0 ;
3721
3725
}
3722
- set_cache_glyph_widths (psc , glyph , abc );
3726
+ set_cache_glyph_widths (psc , glyph , abc , FALSE );
3723
3727
}
3724
3728
return S_OK ;
3725
3729
}
0 commit comments