dwrite: Support outlines with oblique simulation.
This commit is contained in:
parent
b4e261480d
commit
bbe6655280
|
@ -149,7 +149,7 @@ extern void release_freetype(void) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
|
extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN;
|
||||||
extern void freetype_notify_cacheremove(IDWriteFontFace2*) DECLSPEC_HIDDEN;
|
extern void freetype_notify_cacheremove(IDWriteFontFace2*) DECLSPEC_HIDDEN;
|
||||||
extern BOOL freetype_is_monospaced(IDWriteFontFace2*) DECLSPEC_HIDDEN;
|
extern BOOL freetype_is_monospaced(IDWriteFontFace2*) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT freetype_get_glyph_outline(IDWriteFontFace2*,FLOAT,UINT16,struct glyph_outline**) DECLSPEC_HIDDEN;
|
extern HRESULT freetype_get_glyph_outline(IDWriteFontFace2*,FLOAT,UINT16,USHORT,struct glyph_outline**) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* Glyph shaping */
|
/* Glyph shaping */
|
||||||
enum SCRIPT_JUSTIFY
|
enum SCRIPT_JUSTIFY
|
||||||
|
|
|
@ -515,7 +515,7 @@ static HRESULT WINAPI dwritefontface_GetGlyphRunOutline(IDWriteFontFace2 *iface,
|
||||||
|
|
||||||
/* FIXME: cache outlines */
|
/* FIXME: cache outlines */
|
||||||
|
|
||||||
hr = freetype_get_glyph_outline(iface, emSize, glyphs[g], &outline);
|
hr = freetype_get_glyph_outline(iface, emSize, glyphs[g], This->simulations, &outline);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ static HRESULT get_outline_data(const FT_Outline *outline, struct glyph_outline
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, struct glyph_outline **ret)
|
HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, USHORT simulations, struct glyph_outline **ret)
|
||||||
{
|
{
|
||||||
FTC_ScalerRec scaler;
|
FTC_ScalerRec scaler;
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
@ -358,10 +358,10 @@ HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UIN
|
||||||
FT_Outline *outline = &size->face->glyph->outline;
|
FT_Outline *outline = &size->face->glyph->outline;
|
||||||
FT_Matrix m;
|
FT_Matrix m;
|
||||||
|
|
||||||
m.xx = 1.0 * 0x10000;
|
m.xx = 1 << 16;
|
||||||
m.xy = 0;
|
m.xy = simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE ? (1 << 16) / 3 : 0;
|
||||||
m.yx = 0;
|
m.yx = 0;
|
||||||
m.yy = -1.0 * 0x10000; /* flip Y axis */
|
m.yy = -(1 << 16); /* flip Y axis */
|
||||||
|
|
||||||
pFT_Outline_Transform(outline, &m);
|
pFT_Outline_Transform(outline, &m);
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ BOOL freetype_is_monospaced(IDWriteFontFace2 *fontface)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, struct glyph_outline **ret)
|
HRESULT freetype_get_glyph_outline(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, USHORT simulations, struct glyph_outline **ret)
|
||||||
{
|
{
|
||||||
*ret = NULL;
|
*ret = NULL;
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
|
Loading…
Reference in New Issue