dwrite: Respect transform when calculating glyph advances for run analysis.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9389bcdb51
commit
08a3e4f29f
|
@ -130,8 +130,8 @@ extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *refer
|
||||||
extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
|
extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2**) DECLSPEC_HIDDEN;
|
extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2**) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN;
|
extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,DWRITE_GRID_FIT_MODE,
|
extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,const DWRITE_MATRIX*,
|
||||||
DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
|
DWRITE_GRID_FIT_MODE,DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN;
|
||||||
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
|
extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN;
|
extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN;
|
extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -4378,7 +4378,8 @@ static const struct IDWriteGlyphRunAnalysisVtbl glyphrunanalysisvtbl = {
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GLYPH_RUN const *run,
|
HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GLYPH_RUN const *run,
|
||||||
FLOAT ppdip, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **ret)
|
FLOAT ppdip, const DWRITE_MATRIX *transform, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode,
|
||||||
|
FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **ret)
|
||||||
{
|
{
|
||||||
struct dwrite_glyphrunanalysis *analysis;
|
struct dwrite_glyphrunanalysis *analysis;
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
|
@ -4455,7 +4456,7 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEA
|
||||||
break;
|
break;
|
||||||
case DWRITE_MEASURING_MODE_GDI_CLASSIC:
|
case DWRITE_MEASURING_MODE_GDI_CLASSIC:
|
||||||
case DWRITE_MEASURING_MODE_GDI_NATURAL:
|
case DWRITE_MEASURING_MODE_GDI_NATURAL:
|
||||||
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, run->fontEmSize, ppdip, NULL /* FIXME */,
|
hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, run->fontEmSize, ppdip, transform,
|
||||||
measuring_mode == DWRITE_MEASURING_MODE_GDI_NATURAL, run->isSideways, 1, run->glyphIndices + i, &a);
|
measuring_mode == DWRITE_MEASURING_MODE_GDI_NATURAL, run->isSideways, 1, run->glyphIndices + i, &a);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
analysis->advances[i] = 0.0;
|
analysis->advances[i] = 0.0;
|
||||||
|
|
|
@ -1102,7 +1102,7 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *ifac
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, ppdip, DWRITE_GRID_FIT_MODE_DEFAULT,
|
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, ppdip, transform, DWRITE_GRID_FIT_MODE_DEFAULT,
|
||||||
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, originX, originY, analysis);
|
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, originX, originY, analysis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1188,7 +1188,7 @@ static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory2 *ifa
|
||||||
TRACE("(%p)->(%p %p %d %d %d %d %.2f %.2f %p)\n", This, run, transform, rendering_mode, measuring_mode,
|
TRACE("(%p)->(%p %p %d %d %d %d %.2f %.2f %p)\n", This, run, transform, rendering_mode, measuring_mode,
|
||||||
gridfit_mode, aa_mode, originX, originY, analysis);
|
gridfit_mode, aa_mode, originX, originY, analysis);
|
||||||
|
|
||||||
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, gridfit_mode, aa_mode, originX, originY, analysis);
|
return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, transform, gridfit_mode, aa_mode, originX, originY, analysis);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct IDWriteFactory2Vtbl dwritefactoryvtbl = {
|
static const struct IDWriteFactory2Vtbl dwritefactoryvtbl = {
|
||||||
|
|
Loading…
Reference in New Issue