gdiplus: Support GdipSetTextRenderingHint in metafiles.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-07-11 10:58:58 +02:00 committed by Alexandre Julliard
parent 084fa63e60
commit 683315d111
3 changed files with 31 additions and 0 deletions

View File

@ -110,6 +110,7 @@ extern GpStatus METAFILE_DrawImagePointsRect(GpMetafile* metafile, GpImage *imag
GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
DrawImageAbort callback, VOID *callbackData) DECLSPEC_HIDDEN;
extern GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val) DECLSPEC_HIDDEN;
extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;

View File

@ -5987,6 +5987,18 @@ GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics,
if(graphics->busy)
return ObjectBusy;
if(graphics->texthint == hint)
return Ok;
if(graphics->image && graphics->image->type == ImageTypeMetafile) {
GpStatus stat;
stat = METAFILE_AddSimpleProperty((GpMetafile*)graphics->image,
EmfPlusRecordTypeSetTextRenderingHint, hint);
if(stat != Ok)
return stat;
}
graphics->texthint = hint;
return Ok;

View File

@ -2551,3 +2551,21 @@ GpStatus METAFILE_DrawImagePointsRect(GpMetafile *metafile, GpImage *image,
METAFILE_WriteRecords(metafile);
return Ok;
}
GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val)
{
EmfPlusRecordHeader *record;
GpStatus stat;
if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
return Ok;
stat = METAFILE_AllocateRecord(metafile, sizeof(*record), (void**)&record);
if (stat != Ok) return stat;
record->Type = prop;
record->Flags = val;
METAFILE_WriteRecords(metafile);
return Ok;
}