@@ -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 ));
@@ -3425,7 +3429,7 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
3425
3429
{
3426
3430
abc .abcA = abc .abcB = abc .abcC = 0 ;
3427
3431
}
3428
- else if (!get_cache_glyph_widths (psc , pwGlyphs [i ], & abc ))
3432
+ else if (!get_cache_glyph_widths (psc , pwGlyphs [i ], & abc , psa -> fNoGlyphIndex ))
3429
3433
{
3430
3434
BOOL ret ;
3431
3435
if (!hdc ) return E_PENDING ;
@@ -3448,7 +3452,7 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
3448
3452
abc .abcB = width ;
3449
3453
abc .abcA = abc .abcC = 0 ;
3450
3454
}
3451
- set_cache_glyph_widths (psc , pwGlyphs [i ], & abc );
3455
+ set_cache_glyph_widths (psc , pwGlyphs [i ], & abc , psa -> fNoGlyphIndex );
3452
3456
}
3453
3457
if (pABC )
3454
3458
{
@@ -3709,7 +3713,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
3709
3713
if (!abc ) return E_INVALIDARG ;
3710
3714
if ((hr = init_script_cache (hdc , psc )) != S_OK ) return hr ;
3711
3715
3712
- if (!get_cache_glyph_widths (psc , glyph , abc ))
3716
+ if (!get_cache_glyph_widths (psc , glyph , abc , FALSE ))
3713
3717
{
3714
3718
if (!hdc ) return E_PENDING ;
3715
3719
if ((get_cache_pitch_family (psc ) & TMPF_TRUETYPE ))
@@ -3723,7 +3727,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
3723
3727
abc -> abcB = width ;
3724
3728
abc -> abcA = abc -> abcC = 0 ;
3725
3729
}
3726
- set_cache_glyph_widths (psc , glyph , abc );
3730
+ set_cache_glyph_widths (psc , glyph , abc , FALSE );
3727
3731
}
3728
3732
return S_OK ;
3729
3733
}
0 commit comments