gdiplus: Make GdipMeasureCharacterRanges use common font transformation code.
This commit is contained in:
parent
7a1ccd8abe
commit
4e2959ab9b
|
@ -4927,8 +4927,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
|
||||||
{
|
{
|
||||||
GpStatus stat;
|
GpStatus stat;
|
||||||
int i;
|
int i;
|
||||||
LOGFONTW lfw;
|
HFONT gdifont, oldfont;
|
||||||
HFONT oldfont;
|
|
||||||
struct measure_ranges_args args;
|
struct measure_ranges_args args;
|
||||||
HDC hdc, temp_hdc=NULL;
|
HDC hdc, temp_hdc=NULL;
|
||||||
GpPointF pt[3];
|
GpPointF pt[3];
|
||||||
|
@ -4971,8 +4970,8 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
|
||||||
scaled_rect.Width = layoutRect->Width * args.rel_width;
|
scaled_rect.Width = layoutRect->Width * args.rel_width;
|
||||||
scaled_rect.Height = layoutRect->Height * args.rel_height;
|
scaled_rect.Height = layoutRect->Height * args.rel_height;
|
||||||
|
|
||||||
get_log_fontW(font, graphics, &lfw);
|
get_font_hfont(graphics, font, &gdifont);
|
||||||
oldfont = SelectObject(hdc, CreateFontIndirectW(&lfw));
|
oldfont = SelectObject(hdc, gdifont);
|
||||||
|
|
||||||
for (i=0; i<stringFormat->range_count; i++)
|
for (i=0; i<stringFormat->range_count; i++)
|
||||||
{
|
{
|
||||||
|
@ -4986,7 +4985,8 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
|
||||||
stat = gdip_format_string(hdc, string, length, font, &scaled_rect, stringFormat,
|
stat = gdip_format_string(hdc, string, length, font, &scaled_rect, stringFormat,
|
||||||
measure_ranges_callback, &args);
|
measure_ranges_callback, &args);
|
||||||
|
|
||||||
DeleteObject(SelectObject(hdc, oldfont));
|
SelectObject(hdc, oldfont);
|
||||||
|
DeleteObject(gdifont);
|
||||||
|
|
||||||
if (temp_hdc)
|
if (temp_hdc)
|
||||||
DeleteDC(temp_hdc);
|
DeleteDC(temp_hdc);
|
||||||
|
|
|
@ -3828,9 +3828,13 @@ static void test_font_height_scaling(void)
|
||||||
win_skip("GdipMeasureCharacterRanges ignores units before Win7\n");
|
win_skip("GdipMeasureCharacterRanges ignores units before Win7\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* FIXME: Wine uses integer gdi32 regions and rounding breaks things */
|
||||||
|
if (height < 1.0)
|
||||||
expectf_(height, rect.Height, height / 15.0);
|
expectf_(height, rect.Height, height / 15.0);
|
||||||
|
else
|
||||||
todo_wine
|
todo_wine
|
||||||
expectf_(bounds.Width, rect.Width + margin * 2.0, bounds.Width / 25.0);
|
expectf_(height, rect.Height, height / 15.0);
|
||||||
|
expectf_(bounds.Width, rect.Width + margin * 2.0, bounds.Width / 15.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue