mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[GDI32_WINETEST]
* Sync to Wine 1.5.4. I excluded bitmap and dib tests from the sync until bug #7070 is fixed. svn path=/trunk/; revision=56563
This commit is contained in:
parent
92daea0588
commit
211df8ffed
12 changed files with 2030 additions and 249 deletions
|
@ -78,8 +78,275 @@ static void test_solidbrush(void)
|
|||
"GetObject succeeded on a deleted %s brush\n", stock[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void test_hatch_brush(void)
|
||||
{
|
||||
int i, size;
|
||||
HBRUSH brush;
|
||||
LOGBRUSH lb;
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
SetLastError( 0xdeadbeef );
|
||||
brush = CreateHatchBrush( i, RGB(12,34,56) );
|
||||
if (i < HS_API_MAX)
|
||||
{
|
||||
ok( brush != 0, "%u: CreateHatchBrush failed err %u\n", i, GetLastError() );
|
||||
size = GetObject( brush, sizeof(lb), &lb );
|
||||
ok( size == sizeof(lb), "wrong size %u\n", size );
|
||||
ok( lb.lbColor == RGB(12,34,56), "wrong color %08x\n", lb.lbColor );
|
||||
if (i <= HS_DIAGCROSS)
|
||||
{
|
||||
ok( lb.lbStyle == BS_HATCHED, "wrong style %u\n", lb.lbStyle );
|
||||
ok( lb.lbHatch == i, "wrong hatch %lu/%u\n", lb.lbHatch, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
ok( lb.lbStyle == BS_SOLID, "wrong style %u\n", lb.lbStyle );
|
||||
ok( lb.lbHatch == 0, "wrong hatch %lu\n", lb.lbHatch );
|
||||
}
|
||||
DeleteObject( brush );
|
||||
}
|
||||
else
|
||||
{
|
||||
ok( !brush, "%u: CreateHatchBrush succeeded\n", i );
|
||||
ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void test_pattern_brush(void)
|
||||
{
|
||||
char buffer[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD) + 32 * 32 / 8];
|
||||
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
||||
HBRUSH brush;
|
||||
HBITMAP bitmap;
|
||||
LOGBRUSH br;
|
||||
INT ret;
|
||||
void *bits;
|
||||
DIBSECTION dib;
|
||||
HGLOBAL mem;
|
||||
|
||||
bitmap = CreateBitmap( 20, 20, 1, 1, NULL );
|
||||
ok( bitmap != NULL, "CreateBitmap failed\n" );
|
||||
brush = CreatePatternBrush( bitmap );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
|
||||
DeleteObject( brush );
|
||||
|
||||
br.lbStyle = BS_PATTERN8X8;
|
||||
br.lbColor = 0x12345;
|
||||
br.lbHatch = (ULONG_PTR)bitmap;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
|
||||
ret = GetObjectW( bitmap, sizeof(dib), &dib );
|
||||
ok( ret == sizeof(dib.dsBm), "wrong size %u\n", ret );
|
||||
DeleteObject( bitmap );
|
||||
ret = GetObjectW( bitmap, sizeof(dib), &dib );
|
||||
ok( ret == 0, "wrong size %u\n", ret );
|
||||
DeleteObject( brush );
|
||||
|
||||
memset( info, 0, sizeof(buffer) );
|
||||
info->bmiHeader.biSize = sizeof(info->bmiHeader);
|
||||
info->bmiHeader.biHeight = 32;
|
||||
info->bmiHeader.biWidth = 32;
|
||||
info->bmiHeader.biBitCount = 1;
|
||||
info->bmiHeader.biPlanes = 1;
|
||||
info->bmiHeader.biCompression = BI_RGB;
|
||||
bitmap = CreateDIBSection( 0, info, DIB_RGB_COLORS, (void**)&bits, NULL, 0 );
|
||||
ok( bitmap != NULL, "CreateDIBSection failed\n" );
|
||||
|
||||
/* MSDN says a DIB section is not allowed, but it works fine */
|
||||
brush = CreatePatternBrush( bitmap );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
|
||||
ret = GetObjectW( bitmap, sizeof(dib), &dib );
|
||||
ok( ret == sizeof(dib), "wrong size %u\n", ret );
|
||||
DeleteObject( brush );
|
||||
DeleteObject( bitmap );
|
||||
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_RGB_COLORS );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
|
||||
"wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
|
||||
DeleteObject( brush );
|
||||
|
||||
br.lbStyle = BS_DIBPATTERNPT;
|
||||
br.lbColor = DIB_PAL_COLORS;
|
||||
br.lbHatch = (ULONG_PTR)info;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
|
||||
"wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
|
||||
|
||||
mem = GlobalAlloc( GMEM_MOVEABLE, sizeof(buffer) );
|
||||
memcpy( GlobalLock( mem ), buffer, sizeof(buffer) );
|
||||
|
||||
br.lbStyle = BS_DIBPATTERN;
|
||||
br.lbColor = DIB_PAL_COLORS;
|
||||
br.lbHatch = (ULONG_PTR)mem;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( brush != NULL, "CreatePatternBrush failed\n" );
|
||||
memset( &br, 0x55, sizeof(br) );
|
||||
ret = GetObjectW( brush, sizeof(br), &br );
|
||||
ok( ret == sizeof(br), "wrong size %u\n", ret );
|
||||
ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
|
||||
ok( br.lbColor == 0, "wrong color %u\n", br.lbColor );
|
||||
ok( (HGLOBAL)br.lbHatch != mem, "wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, mem );
|
||||
bits = GlobalLock( mem );
|
||||
ok( (HGLOBAL)br.lbHatch == bits || broken(!br.lbHatch), /* nt4 */
|
||||
"wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, bits );
|
||||
ret = GlobalFlags( mem );
|
||||
ok( ret == 2, "wrong flags %x\n", ret );
|
||||
DeleteObject( brush );
|
||||
ret = GlobalFlags( mem );
|
||||
ok( ret == 2, "wrong flags %x\n", ret );
|
||||
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_PAL_COLORS );
|
||||
ok( brush != 0, "CreateDIBPatternBrushPt failed\n" );
|
||||
DeleteObject( brush );
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_PAL_COLORS + 1 );
|
||||
ok( brush != 0, "CreateDIBPatternBrushPt failed\n" );
|
||||
DeleteObject( brush );
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_PAL_COLORS + 2 );
|
||||
ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_PAL_COLORS + 3 );
|
||||
ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
|
||||
|
||||
info->bmiHeader.biBitCount = 8;
|
||||
info->bmiHeader.biCompression = BI_RLE8;
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_RGB_COLORS );
|
||||
ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
|
||||
|
||||
info->bmiHeader.biBitCount = 4;
|
||||
info->bmiHeader.biCompression = BI_RLE4;
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_RGB_COLORS );
|
||||
ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
|
||||
|
||||
br.lbStyle = BS_DIBPATTERN8X8;
|
||||
br.lbColor = DIB_RGB_COLORS;
|
||||
br.lbHatch = (ULONG_PTR)mem;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( !brush, "CreatePatternBrush succeeded\n" );
|
||||
|
||||
br.lbStyle = BS_MONOPATTERN;
|
||||
br.lbColor = DIB_RGB_COLORS;
|
||||
br.lbHatch = (ULONG_PTR)mem;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( !brush, "CreatePatternBrush succeeded\n" );
|
||||
|
||||
br.lbStyle = BS_INDEXED;
|
||||
br.lbColor = DIB_RGB_COLORS;
|
||||
br.lbHatch = (ULONG_PTR)mem;
|
||||
brush = CreateBrushIndirect( &br );
|
||||
ok( !brush, "CreatePatternBrush succeeded\n" );
|
||||
|
||||
GlobalFree( mem );
|
||||
}
|
||||
|
||||
static void test_palette_brush(void)
|
||||
{
|
||||
char buffer[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD) + 16 * 16];
|
||||
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
||||
WORD *indices = (WORD *)info->bmiColors;
|
||||
char pal_buffer[sizeof(LOGPALETTE) + 256 * sizeof(PALETTEENTRY)];
|
||||
LOGPALETTE *pal = (LOGPALETTE *)pal_buffer;
|
||||
HDC hdc = CreateCompatibleDC( 0 );
|
||||
DWORD *dib_bits;
|
||||
HBITMAP dib;
|
||||
HBRUSH brush;
|
||||
int i;
|
||||
HPALETTE palette, palette2;
|
||||
|
||||
memset( info, 0, sizeof(*info) );
|
||||
info->bmiHeader.biSize = sizeof(info->bmiHeader);
|
||||
info->bmiHeader.biWidth = 16;
|
||||
info->bmiHeader.biHeight = 16;
|
||||
info->bmiHeader.biPlanes = 1;
|
||||
info->bmiHeader.biBitCount = 32;
|
||||
info->bmiHeader.biCompression = BI_RGB;
|
||||
dib = CreateDIBSection( NULL, info, DIB_RGB_COLORS, (void**)&dib_bits, NULL, 0 );
|
||||
ok( dib != NULL, "CreateDIBSection failed\n" );
|
||||
|
||||
info->bmiHeader.biBitCount = 8;
|
||||
for (i = 0; i < 256; i++) indices[i] = 255 - i;
|
||||
for (i = 0; i < 256; i++) ((BYTE *)(indices + 256))[i] = i;
|
||||
brush = CreateDIBPatternBrushPt( info, DIB_PAL_COLORS );
|
||||
ok( brush != NULL, "CreateDIBPatternBrushPt failed\n" );
|
||||
|
||||
pal->palVersion = 0x300;
|
||||
pal->palNumEntries = 256;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
pal->palPalEntry[i].peRed = i * 2;
|
||||
pal->palPalEntry[i].peGreen = i * 2;
|
||||
pal->palPalEntry[i].peBlue = i * 2;
|
||||
pal->palPalEntry[i].peFlags = 0;
|
||||
}
|
||||
palette = CreatePalette( pal );
|
||||
|
||||
ok( SelectObject( hdc, dib ) != NULL, "SelectObject failed\n" );
|
||||
ok( SelectPalette( hdc, palette, 0 ) != NULL, "SelectPalette failed\n" );
|
||||
ok( SelectObject( hdc, brush ) != NULL, "SelectObject failed\n" );
|
||||
memset( dib_bits, 0xaa, 16 * 16 * 4 );
|
||||
PatBlt( hdc, 0, 0, 16, 16, PATCOPY );
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
|
||||
pal->palPalEntry[255 - i].peGreen << 8 |
|
||||
pal->palPalEntry[255 - i].peBlue);
|
||||
ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
|
||||
}
|
||||
|
||||
for (i = 0; i < 256; i++) pal->palPalEntry[i].peRed = i * 3;
|
||||
palette2 = CreatePalette( pal );
|
||||
ok( SelectPalette( hdc, palette2, 0 ) != NULL, "SelectPalette failed\n" );
|
||||
memset( dib_bits, 0xaa, 16 * 16 * 4 );
|
||||
PatBlt( hdc, 0, 0, 16, 16, PATCOPY );
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
|
||||
pal->palPalEntry[255 - i].peGreen << 8 |
|
||||
pal->palPalEntry[255 - i].peBlue);
|
||||
ok( dib_bits[i] == expect, "wrong bits %x/%x at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
|
||||
}
|
||||
DeleteDC( hdc );
|
||||
DeleteObject( dib );
|
||||
DeleteObject( brush );
|
||||
DeleteObject( palette );
|
||||
DeleteObject( palette2 );
|
||||
}
|
||||
|
||||
START_TEST(brush)
|
||||
{
|
||||
test_solidbrush();
|
||||
test_hatch_brush();
|
||||
test_pattern_brush();
|
||||
test_palette_brush();
|
||||
}
|
||||
|
|
|
@ -112,6 +112,8 @@ static void test_GetRandomRgn(void)
|
|||
GetRgnBox(hrgn, &ret_rc);
|
||||
if(GetVersion() & 0x80000000)
|
||||
OffsetRect(&window_rc, -window_rc.left, -window_rc.top);
|
||||
/* the window may be partially obscured so the region may be smaller */
|
||||
IntersectRect( &window_rc, &ret_rc, &ret_rc );
|
||||
ok(EqualRect(&window_rc, &ret_rc) ||
|
||||
broken(IsRectEmpty(&ret_rc)), /* win95 */
|
||||
"GetRandomRgn %d,%d - %d,%d\n",
|
||||
|
@ -331,7 +333,7 @@ static void test_GetClipRgn(void)
|
|||
|
||||
/* Try unsetting and then query the clipping region. */
|
||||
ret = SelectClipRgn(hdc, NULL);
|
||||
ok(ret == SIMPLEREGION,
|
||||
ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1),
|
||||
"Expected SelectClipRgn to return SIMPLEREGION, got %d\n", ret);
|
||||
|
||||
ret = GetClipRgn(hdc, NULL);
|
||||
|
@ -432,7 +434,8 @@ static void test_window_dc_clipping(void)
|
|||
ok(ret == 0, "expected 0, got %d\n", ret);
|
||||
|
||||
ret = ExtSelectClipRgn(hdc, hrgn_empty, RGN_DIFF);
|
||||
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
|
||||
ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1),
|
||||
"expected SIMPLEREGION, got %d\n", ret);
|
||||
|
||||
ret = GetClipRgn(hdc, hrgn);
|
||||
ok(ret == 1, "expected 1, got %d\n", ret);
|
||||
|
@ -444,7 +447,8 @@ static void test_window_dc_clipping(void)
|
|||
rc.left, rc.top, rc.right, rc.bottom);
|
||||
|
||||
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
|
||||
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
|
||||
ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1),
|
||||
"expected SIMPLEREGION, got %d\n", ret);
|
||||
|
||||
ret = GetClipRgn(hdc, hrgn);
|
||||
ok(ret == 0, "expected 0, got %d\n", ret);
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winspool.h"
|
||||
#include "winerror.h"
|
||||
|
||||
static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
|
||||
|
@ -53,6 +54,41 @@ static void dump_region(HRGN hrgn)
|
|||
HeapFree( GetProcessHeap(), 0, data );
|
||||
}
|
||||
|
||||
static void test_dc_values(void)
|
||||
{
|
||||
HDC hdc = CreateDCA("DISPLAY", NULL, NULL, NULL);
|
||||
COLORREF color;
|
||||
|
||||
ok( hdc != NULL, "CreateDC failed\n" );
|
||||
color = SetBkColor( hdc, 0x12345678 );
|
||||
ok( color == 0xffffff, "initial color %08x\n", color );
|
||||
color = GetBkColor( hdc );
|
||||
ok( color == 0x12345678, "wrong color %08x\n", color );
|
||||
color = SetBkColor( hdc, 0xffffffff );
|
||||
ok( color == 0x12345678, "wrong color %08x\n", color );
|
||||
color = GetBkColor( hdc );
|
||||
ok( color == 0xffffffff, "wrong color %08x\n", color );
|
||||
color = SetBkColor( hdc, 0 );
|
||||
ok( color == 0xffffffff, "wrong color %08x\n", color );
|
||||
color = GetBkColor( hdc );
|
||||
ok( color == 0, "wrong color %08x\n", color );
|
||||
|
||||
color = SetTextColor( hdc, 0xffeeddcc );
|
||||
ok( color == 0, "initial color %08x\n", color );
|
||||
color = GetTextColor( hdc );
|
||||
ok( color == 0xffeeddcc, "wrong color %08x\n", color );
|
||||
color = SetTextColor( hdc, 0xffffffff );
|
||||
ok( color == 0xffeeddcc, "wrong color %08x\n", color );
|
||||
color = GetTextColor( hdc );
|
||||
ok( color == 0xffffffff, "wrong color %08x\n", color );
|
||||
color = SetTextColor( hdc, 0 );
|
||||
ok( color == 0xffffffff, "wrong color %08x\n", color );
|
||||
color = GetTextColor( hdc );
|
||||
ok( color == 0, "wrong color %08x\n", color );
|
||||
|
||||
DeleteDC( hdc );
|
||||
}
|
||||
|
||||
static void test_savedc_2(void)
|
||||
{
|
||||
HWND hwnd;
|
||||
|
@ -262,13 +298,188 @@ static void test_GdiConvertToDevmodeW(void)
|
|||
HeapFree(GetProcessHeap(), 0, dmW);
|
||||
}
|
||||
|
||||
static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
|
||||
{
|
||||
static const int caps[] =
|
||||
{
|
||||
DRIVERVERSION,
|
||||
TECHNOLOGY,
|
||||
HORZSIZE,
|
||||
VERTSIZE,
|
||||
HORZRES,
|
||||
VERTRES,
|
||||
BITSPIXEL,
|
||||
PLANES,
|
||||
NUMBRUSHES,
|
||||
NUMPENS,
|
||||
NUMMARKERS,
|
||||
NUMFONTS,
|
||||
NUMCOLORS,
|
||||
PDEVICESIZE,
|
||||
CURVECAPS,
|
||||
LINECAPS,
|
||||
POLYGONALCAPS,
|
||||
/* TEXTCAPS broken on printer DC on winxp */
|
||||
CLIPCAPS,
|
||||
RASTERCAPS,
|
||||
ASPECTX,
|
||||
ASPECTY,
|
||||
ASPECTXY,
|
||||
LOGPIXELSX,
|
||||
LOGPIXELSY,
|
||||
SIZEPALETTE,
|
||||
NUMRESERVED,
|
||||
COLORRES,
|
||||
PHYSICALWIDTH,
|
||||
PHYSICALHEIGHT,
|
||||
PHYSICALOFFSETX,
|
||||
PHYSICALOFFSETY,
|
||||
SCALINGFACTORX,
|
||||
SCALINGFACTORY,
|
||||
VREFRESH,
|
||||
DESKTOPVERTRES,
|
||||
DESKTOPHORZRES,
|
||||
BLTALIGNMENT,
|
||||
SHADEBLENDCAPS
|
||||
};
|
||||
unsigned int i;
|
||||
WORD ramp[3][256];
|
||||
BOOL ret;
|
||||
RECT rect;
|
||||
UINT type;
|
||||
|
||||
if (GetObjectType( hdc ) == OBJ_METADC)
|
||||
{
|
||||
for (i = 0; i < sizeof(caps)/sizeof(caps[0]); i++)
|
||||
ok( GetDeviceCaps( hdc, caps[i] ) == (caps[i] == TECHNOLOGY ? DT_METAFILE : 0),
|
||||
"wrong caps on %s for %u: %u\n", descr, caps[i],
|
||||
GetDeviceCaps( hdc, caps[i] ) );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = GetDeviceGammaRamp( hdc, &ramp );
|
||||
ok( !ret, "GetDeviceGammaRamp succeeded on %s\n", descr );
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef), /* nt4 */
|
||||
"wrong error %u on %s\n", GetLastError(), descr );
|
||||
type = GetClipBox( hdc, &rect );
|
||||
ok( type == ERROR, "GetClipBox returned %d on %s\n", type, descr );
|
||||
|
||||
SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE );
|
||||
SetMapMode( hdc, MM_TEXT );
|
||||
Rectangle( hdc, 2, 2, 5, 5 );
|
||||
type = GetBoundsRect( hdc, &rect, DCB_RESET );
|
||||
ok( !type, "GetBoundsRect succeeded on %s\n", descr );
|
||||
type = SetBoundsRect( hdc, &rect, DCB_RESET | DCB_ENABLE );
|
||||
ok( !type, "SetBoundsRect succeeded on %s\n", descr );
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < sizeof(caps)/sizeof(caps[0]); i++)
|
||||
ok( GetDeviceCaps( hdc, caps[i] ) == GetDeviceCaps( ref_dc, caps[i] ),
|
||||
"mismatched caps on %s for %u: %u/%u\n", descr, caps[i],
|
||||
GetDeviceCaps( hdc, caps[i] ), GetDeviceCaps( ref_dc, caps[i] ) );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = GetDeviceGammaRamp( hdc, &ramp );
|
||||
ok( !ret, "GetDeviceGammaRamp succeeded on %s\n", descr );
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef), /* nt4 */
|
||||
"wrong error %u on %s\n", GetLastError(), descr );
|
||||
type = GetClipBox( hdc, &rect );
|
||||
if (GetObjectType( hdc ) == OBJ_ENHMETADC)
|
||||
todo_wine ok( type == SIMPLEREGION, "GetClipBox returned %d on memdc for %s\n", type, descr );
|
||||
else
|
||||
ok( type == SIMPLEREGION, "GetClipBox returned %d on memdc for %s\n", type, descr );
|
||||
|
||||
type = SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE );
|
||||
ok( type == (DCB_RESET | DCB_DISABLE), "SetBoundsRect returned %x\n", type );
|
||||
SetMapMode( hdc, MM_TEXT );
|
||||
Rectangle( hdc, 2, 2, 4, 4 );
|
||||
type = GetBoundsRect( hdc, &rect, DCB_RESET );
|
||||
if (GetObjectType( hdc ) == OBJ_ENHMETADC)
|
||||
todo_wine
|
||||
ok( rect.left == 2 && rect.top == 2 && rect.right == 4 && rect.bottom == 4 && type == DCB_SET,
|
||||
"GetBoundsRect returned %d,%d,%d,%d type %x for %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, type, descr );
|
||||
else
|
||||
ok( rect.left == 2 && rect.top == 2 && rect.right == 4 && rect.bottom == 4 && type == DCB_SET,
|
||||
"GetBoundsRect returned %d,%d,%d,%d type %x for %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, type, descr );
|
||||
}
|
||||
|
||||
type = GetClipBox( ref_dc, &rect );
|
||||
if (type != COMPLEXREGION) /* region can be complex on multi-monitor setups */
|
||||
{
|
||||
ok( type == SIMPLEREGION, "GetClipBox returned %d on %s\n", type, descr );
|
||||
ok( rect.left == 0 && rect.top == 0 &&
|
||||
rect.right == GetDeviceCaps( ref_dc, DESKTOPHORZRES ) &&
|
||||
rect.bottom == GetDeviceCaps( ref_dc, DESKTOPVERTRES ),
|
||||
"GetClipBox returned %d,%d,%d,%d on %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, descr );
|
||||
}
|
||||
|
||||
SetBoundsRect( ref_dc, NULL, DCB_RESET | DCB_ACCUMULATE );
|
||||
SetMapMode( ref_dc, MM_TEXT );
|
||||
Rectangle( ref_dc, 3, 3, 5, 5 );
|
||||
type = GetBoundsRect( ref_dc, &rect, DCB_RESET );
|
||||
/* it may or may not work on non-memory DCs */
|
||||
ok( (rect.left == 0 && rect.top == 0 && rect.right == 0 && rect.bottom == 0 && type == DCB_RESET) ||
|
||||
(rect.left == 3 && rect.top == 3 && rect.right == 5 && rect.bottom == 5 && type == DCB_SET),
|
||||
"GetBoundsRect returned %d,%d,%d,%d type %x on %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, type, descr );
|
||||
|
||||
if (GetObjectType( hdc ) == OBJ_MEMDC)
|
||||
{
|
||||
char buffer[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
|
||||
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
||||
HBITMAP dib, old;
|
||||
|
||||
memset( buffer, 0, sizeof(buffer) );
|
||||
info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
info->bmiHeader.biWidth = 16;
|
||||
info->bmiHeader.biHeight = 16;
|
||||
info->bmiHeader.biPlanes = 1;
|
||||
info->bmiHeader.biBitCount = 8;
|
||||
info->bmiHeader.biCompression = BI_RGB;
|
||||
dib = CreateDIBSection( ref_dc, info, DIB_RGB_COLORS, NULL, NULL, 0 );
|
||||
old = SelectObject( hdc, dib );
|
||||
|
||||
for (i = 0; i < sizeof(caps)/sizeof(caps[0]); i++)
|
||||
ok( GetDeviceCaps( hdc, caps[i] ) == GetDeviceCaps( ref_dc, caps[i] ),
|
||||
"mismatched caps on %s and DIB for %u: %u/%u\n", descr, caps[i],
|
||||
GetDeviceCaps( hdc, caps[i] ), GetDeviceCaps( ref_dc, caps[i] ) );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = GetDeviceGammaRamp( hdc, &ramp );
|
||||
ok( !ret, "GetDeviceGammaRamp succeeded on %s\n", descr );
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == 0xdeadbeef), /* nt4 */
|
||||
"wrong error %u on %s\n", GetLastError(), descr );
|
||||
|
||||
type = GetClipBox( hdc, &rect );
|
||||
ok( type == SIMPLEREGION, "GetClipBox returned %d on memdc for %s\n", type, descr );
|
||||
ok( rect.left == 0 && rect.top == 0 && rect.right == 16 && rect.bottom == 16,
|
||||
"GetClipBox returned %d,%d,%d,%d on memdc for %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, descr );
|
||||
|
||||
SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE );
|
||||
SetMapMode( hdc, MM_TEXT );
|
||||
Rectangle( hdc, 5, 5, 12, 14 );
|
||||
type = GetBoundsRect( hdc, &rect, DCB_RESET );
|
||||
ok( rect.left == 5 && rect.top == 5 && rect.right == 12 && rect.bottom == 14 && type == DCB_SET,
|
||||
"GetBoundsRect returned %d,%d,%d,%d type %x on memdc for %s\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom, type, descr );
|
||||
|
||||
SelectObject( hdc, old );
|
||||
DeleteObject( dib );
|
||||
}
|
||||
}
|
||||
|
||||
static void test_CreateCompatibleDC(void)
|
||||
{
|
||||
BOOL bRet;
|
||||
HDC hdc, hNewDC, hdcMetafile;
|
||||
HDC hdc, hNewDC, hdcMetafile, screen_dc;
|
||||
HBITMAP bitmap;
|
||||
INT caps;
|
||||
|
||||
screen_dc = CreateDC( "DISPLAY", NULL, NULL, NULL );
|
||||
bitmap = CreateBitmap( 10, 10, 1, 1, NULL );
|
||||
|
||||
/* Create a DC compatible with the screen */
|
||||
|
@ -278,6 +489,8 @@ static void test_CreateCompatibleDC(void)
|
|||
caps = GetDeviceCaps( hdc, TECHNOLOGY );
|
||||
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
|
||||
|
||||
test_device_caps( hdc, screen_dc, "display dc" );
|
||||
|
||||
/* Delete this DC, this should succeed */
|
||||
bRet = DeleteDC(hdc);
|
||||
ok(bRet == TRUE, "DeleteDC returned %u\n", bRet);
|
||||
|
@ -294,8 +507,7 @@ static void test_CreateCompatibleDC(void)
|
|||
ok( SelectObject( hNewDC, bitmap ) != 0, "SelectObject failed\n" );
|
||||
caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY );
|
||||
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
|
||||
caps = GetDeviceCaps( hNewDC, TECHNOLOGY );
|
||||
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
|
||||
test_device_caps( hdcMetafile, hdc, "enhmetafile dc" );
|
||||
DeleteDC( hNewDC );
|
||||
DeleteEnhMetaFile( CloseEnhMetaFile( hdcMetafile ));
|
||||
ReleaseDC( 0, hdc );
|
||||
|
@ -306,9 +518,11 @@ static void test_CreateCompatibleDC(void)
|
|||
ok(hNewDC == NULL, "CreateCompatibleDC succeeded\n");
|
||||
caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY );
|
||||
ok( caps == DT_METAFILE, "wrong caps %u\n", caps );
|
||||
test_device_caps( hdcMetafile, screen_dc, "metafile dc" );
|
||||
DeleteMetaFile( CloseMetaFile( hdcMetafile ));
|
||||
|
||||
DeleteObject( bitmap );
|
||||
DeleteDC( screen_dc );
|
||||
}
|
||||
|
||||
static void test_DC_bitmap(void)
|
||||
|
@ -534,15 +748,18 @@ todo_wine
|
|||
|
||||
static void test_boundsrect(void)
|
||||
{
|
||||
char buffer[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
|
||||
BITMAPINFO *info = (BITMAPINFO *)buffer;
|
||||
HDC hdc;
|
||||
HBITMAP bitmap;
|
||||
HBITMAP bitmap, dib, old;
|
||||
RECT rect, expect, set_rect;
|
||||
UINT ret;
|
||||
int i, level;
|
||||
|
||||
hdc = CreateCompatibleDC(0);
|
||||
ok(hdc != NULL, "CreateCompatibleDC failed\n");
|
||||
bitmap = CreateCompatibleBitmap( hdc, 200, 200 );
|
||||
SelectObject( hdc, bitmap );
|
||||
old = SelectObject( hdc, bitmap );
|
||||
|
||||
ret = GetBoundsRect(hdc, NULL, 0);
|
||||
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
|
||||
|
@ -672,8 +889,147 @@ static void test_boundsrect(void)
|
|||
rect.left, rect.top, rect.right, rect.bottom);
|
||||
}
|
||||
|
||||
SetBoundsRect( hdc, NULL, DCB_RESET | DCB_ENABLE );
|
||||
MoveToEx( hdc, 10, 10, NULL );
|
||||
LineTo( hdc, 20, 20 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 10, 10, 21, 21 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
SetRect( &rect, 8, 8, 23, 23 );
|
||||
expect = rect;
|
||||
SetBoundsRect( hdc, &rect, DCB_ACCUMULATE );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
level = SaveDC( hdc );
|
||||
LineTo( hdc, 30, 25 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 8, 8, 31, 26 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
SetBoundsRect( hdc, NULL, DCB_DISABLE );
|
||||
LineTo( hdc, 40, 40 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 8, 8, 31, 26 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
SetRect( &rect, 6, 6, 30, 30 );
|
||||
SetBoundsRect( hdc, &rect, DCB_ACCUMULATE );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 31, 30 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
RestoreDC( hdc, level );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
LineTo( hdc, 40, 40 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
SelectObject( hdc, old );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 1, 1 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
SetBoundsRect( hdc, NULL, DCB_ENABLE );
|
||||
LineTo( hdc, 50, 40 );
|
||||
|
||||
SelectObject( hdc, bitmap );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 51, 41 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
SelectObject( hdc, GetStockObject( NULL_PEN ));
|
||||
LineTo( hdc, 50, 50 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 51, 51 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
memset( buffer, 0, sizeof(buffer) );
|
||||
info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
info->bmiHeader.biWidth = 256;
|
||||
info->bmiHeader.biHeight = 256;
|
||||
info->bmiHeader.biPlanes = 1;
|
||||
info->bmiHeader.biBitCount = 8;
|
||||
info->bmiHeader.biCompression = BI_RGB;
|
||||
dib = CreateDIBSection( 0, info, DIB_RGB_COLORS, NULL, NULL, 0 );
|
||||
ok( dib != 0, "failed to create DIB\n" );
|
||||
SelectObject( hdc, dib );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 51, 51 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
LineTo( hdc, 55, 30 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 56, 51 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
LineTo( hdc, 300, 30 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 6, 6, 256, 51 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
LineTo( hdc, -300, -300 );
|
||||
ret = GetBoundsRect( hdc, &rect, 0 );
|
||||
ok( ret == DCB_SET, "GetBoundsRect returned %x\n", ret );
|
||||
SetRect( &expect, 0, 0, 256, 51 );
|
||||
ok( EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n", rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
/* test the wide pen heuristics */
|
||||
SetBoundsRect( hdc, NULL, DCB_ENABLE | DCB_RESET );
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
static const UINT endcaps[3] = { PS_ENDCAP_ROUND, PS_ENDCAP_SQUARE, PS_ENDCAP_FLAT };
|
||||
static const UINT joins[3] = { PS_JOIN_ROUND, PS_JOIN_BEVEL, PS_JOIN_MITER };
|
||||
LOGBRUSH brush = { BS_SOLID, RGB(0,0,0), 0 };
|
||||
UINT join = joins[i % 3];
|
||||
UINT endcap = endcaps[(i / 3) % 3];
|
||||
INT inflate, width = 1 + i / 9;
|
||||
HPEN pen = ExtCreatePen( PS_GEOMETRIC | join | endcap | PS_SOLID, width, &brush, 0, NULL );
|
||||
HPEN old = SelectObject( hdc, pen );
|
||||
MoveToEx( hdc, 100, 100, NULL );
|
||||
LineTo( hdc, 160, 100 );
|
||||
LineTo( hdc, 100, 160 );
|
||||
LineTo( hdc, 160, 160 );
|
||||
GetBoundsRect( hdc, &rect, DCB_RESET );
|
||||
SetRect( &expect, 100, 100, 161, 161 );
|
||||
|
||||
inflate = width + 2;
|
||||
if (join == PS_JOIN_MITER)
|
||||
{
|
||||
inflate *= 5;
|
||||
if (endcap == PS_ENDCAP_SQUARE)
|
||||
InflateRect( &expect, (inflate * 3 + 1) / 2, (inflate * 3 + 1) / 2 );
|
||||
else
|
||||
InflateRect( &expect, inflate, inflate );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (endcap == PS_ENDCAP_SQUARE)
|
||||
InflateRect( &expect, inflate - inflate / 4, inflate - inflate / 4 );
|
||||
else
|
||||
InflateRect( &expect, (inflate + 1) / 2, (inflate + 1) / 2 );
|
||||
}
|
||||
expect.left = max( expect.left, 0 );
|
||||
expect.top = max( expect.top, 0 );
|
||||
expect.right = min( expect.right, 256 );
|
||||
expect.bottom = min( expect.bottom, 256 );
|
||||
ok( EqualRect(&rect, &expect),
|
||||
"Got %d,%d,%d,%d expected %d,%d,%d,%d %u/%x/%x\n",
|
||||
rect.left, rect.top, rect.right, rect.bottom,
|
||||
expect.left, expect.top, expect.right, expect.bottom, width, endcap, join );
|
||||
DeleteObject( SelectObject( hdc, old ));
|
||||
}
|
||||
|
||||
DeleteDC( hdc );
|
||||
DeleteObject( bitmap );
|
||||
DeleteObject( dib );
|
||||
}
|
||||
|
||||
static void test_desktop_colorres(void)
|
||||
|
@ -783,9 +1139,115 @@ done:
|
|||
ReleaseDC(NULL, hdc);
|
||||
}
|
||||
|
||||
static HDC create_printer_dc(void)
|
||||
{
|
||||
char buffer[260];
|
||||
DWORD len;
|
||||
PRINTER_INFO_2A *pbuf = NULL;
|
||||
DRIVER_INFO_3A *dbuf = NULL;
|
||||
HANDLE hprn = 0;
|
||||
HDC hdc = 0;
|
||||
HMODULE winspool = LoadLibraryA( "winspool.drv" );
|
||||
BOOL (WINAPI *pOpenPrinterA)(LPSTR, HANDLE *, LPPRINTER_DEFAULTSA);
|
||||
BOOL (WINAPI *pGetDefaultPrinterA)(LPSTR, LPDWORD);
|
||||
BOOL (WINAPI *pGetPrinterA)(HANDLE, DWORD, LPBYTE, DWORD, LPDWORD);
|
||||
BOOL (WINAPI *pGetPrinterDriverA)(HANDLE, LPSTR, DWORD, LPBYTE, DWORD, LPDWORD);
|
||||
BOOL (WINAPI *pClosePrinter)(HANDLE);
|
||||
|
||||
pGetDefaultPrinterA = (void *)GetProcAddress( winspool, "GetDefaultPrinterA" );
|
||||
pOpenPrinterA = (void *)GetProcAddress( winspool, "OpenPrinterA" );
|
||||
pGetPrinterA = (void *)GetProcAddress( winspool, "GetPrinterA" );
|
||||
pGetPrinterDriverA = (void *)GetProcAddress( winspool, "GetPrinterDriverA" );
|
||||
pClosePrinter = (void *)GetProcAddress( winspool, "ClosePrinter" );
|
||||
|
||||
if (!pGetDefaultPrinterA || !pOpenPrinterA || !pGetPrinterA || !pGetPrinterDriverA || !pClosePrinter)
|
||||
goto done;
|
||||
|
||||
len = sizeof(buffer);
|
||||
if (!pGetDefaultPrinterA( buffer, &len )) goto done;
|
||||
if (!pOpenPrinterA( buffer, &hprn, NULL )) goto done;
|
||||
|
||||
pGetPrinterA( hprn, 2, NULL, 0, &len );
|
||||
pbuf = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
if (!pGetPrinterA( hprn, 2, (LPBYTE)pbuf, len, &len )) goto done;
|
||||
|
||||
pGetPrinterDriverA( hprn, NULL, 3, NULL, 0, &len );
|
||||
dbuf = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
if (!pGetPrinterDriverA( hprn, NULL, 3, (LPBYTE)dbuf, len, &len )) goto done;
|
||||
|
||||
hdc = CreateDCA( dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName, pbuf->pDevMode );
|
||||
trace( "hdc %p for driver '%s' printer '%s' port '%s'\n", hdc,
|
||||
dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName );
|
||||
done:
|
||||
HeapFree( GetProcessHeap(), 0, dbuf );
|
||||
HeapFree( GetProcessHeap(), 0, pbuf );
|
||||
if (hprn) pClosePrinter( hprn );
|
||||
if (winspool) FreeLibrary( winspool );
|
||||
if (!hdc) skip( "could not create a DC for the default printer\n" );
|
||||
return hdc;
|
||||
}
|
||||
|
||||
static void test_printer_dc(void)
|
||||
{
|
||||
HDC memdc, display_memdc, enhmf_dc;
|
||||
HBITMAP orig, bmp;
|
||||
DWORD ret;
|
||||
HDC hdc = create_printer_dc();
|
||||
|
||||
if (!hdc) return;
|
||||
|
||||
memdc = CreateCompatibleDC( hdc );
|
||||
display_memdc = CreateCompatibleDC( 0 );
|
||||
|
||||
ok( memdc != NULL, "CreateCompatibleDC failed for printer\n" );
|
||||
ok( display_memdc != NULL, "CreateCompatibleDC failed for screen\n" );
|
||||
|
||||
ret = GetDeviceCaps( hdc, TECHNOLOGY );
|
||||
ok( ret == DT_RASPRINTER, "wrong type %u\n", ret );
|
||||
|
||||
ret = GetDeviceCaps( memdc, TECHNOLOGY );
|
||||
ok( ret == DT_RASPRINTER, "wrong type %u\n", ret );
|
||||
|
||||
ret = GetDeviceCaps( display_memdc, TECHNOLOGY );
|
||||
ok( ret == DT_RASDISPLAY, "wrong type %u\n", ret );
|
||||
|
||||
bmp = CreateBitmap( 100, 100, 1, GetDeviceCaps( hdc, BITSPIXEL ), NULL );
|
||||
orig = SelectObject( memdc, bmp );
|
||||
ok( orig != NULL, "SelectObject failed\n" );
|
||||
ok( BitBlt( hdc, 10, 10, 20, 20, memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
|
||||
|
||||
test_device_caps( memdc, hdc, "printer dc" );
|
||||
|
||||
ok( !SelectObject( display_memdc, bmp ), "SelectObject succeeded\n" );
|
||||
SelectObject( memdc, orig );
|
||||
DeleteObject( bmp );
|
||||
|
||||
bmp = CreateBitmap( 100, 100, 1, 1, NULL );
|
||||
orig = SelectObject( display_memdc, bmp );
|
||||
ok( orig != NULL, "SelectObject failed\n" );
|
||||
ok( !SelectObject( memdc, bmp ), "SelectObject succeeded\n" );
|
||||
ok( BitBlt( hdc, 10, 10, 20, 20, display_memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
|
||||
ok( BitBlt( memdc, 10, 10, 20, 20, display_memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
|
||||
ok( BitBlt( display_memdc, 10, 10, 20, 20, memdc, 0, 0, SRCCOPY ), "BitBlt failed\n" );
|
||||
|
||||
ret = GetPixel( hdc, 0, 0 );
|
||||
ok( ret == CLR_INVALID, "wrong pixel value %x\n", ret );
|
||||
|
||||
enhmf_dc = CreateEnhMetaFileA( hdc, NULL, NULL, NULL );
|
||||
ok(enhmf_dc != 0, "CreateEnhMetaFileA failed\n");
|
||||
test_device_caps( enhmf_dc, hdc, "enhmetafile printer dc" );
|
||||
DeleteEnhMetaFile( CloseEnhMetaFile( enhmf_dc ));
|
||||
|
||||
DeleteDC( memdc );
|
||||
DeleteDC( display_memdc );
|
||||
DeleteDC( hdc );
|
||||
DeleteObject( bmp );
|
||||
}
|
||||
|
||||
START_TEST(dc)
|
||||
{
|
||||
pSetLayout = (void *)GetProcAddress( GetModuleHandle("gdi32.dll"), "SetLayout");
|
||||
test_dc_values();
|
||||
test_savedc();
|
||||
test_savedc_2();
|
||||
test_GdiConvertToDevmodeW();
|
||||
|
@ -795,4 +1257,5 @@ START_TEST(dc)
|
|||
test_boundsrect();
|
||||
test_desktop_colorres();
|
||||
test_gamma();
|
||||
test_printer_dc();
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ static DWORD (WINAPI *pGdiGetCodePage)(HDC hdc);
|
|||
static BOOL (WINAPI *pGetCharABCWidthsI)(HDC hdc, UINT first, UINT count, LPWORD glyphs, LPABC abc);
|
||||
static BOOL (WINAPI *pGetCharABCWidthsA)(HDC hdc, UINT first, UINT last, LPABC abc);
|
||||
static BOOL (WINAPI *pGetCharABCWidthsW)(HDC hdc, UINT first, UINT last, LPABC abc);
|
||||
static BOOL (WINAPI *pGetCharABCWidthsFloatW)(HDC hdc, UINT first, UINT last, LPABCFLOAT abc);
|
||||
static DWORD (WINAPI *pGetFontUnicodeRanges)(HDC hdc, LPGLYPHSET lpgs);
|
||||
static DWORD (WINAPI *pGetGlyphIndicesA)(HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi, DWORD flags);
|
||||
static DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags);
|
||||
|
@ -63,6 +64,7 @@ static void init(void)
|
|||
pGetCharABCWidthsI = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsI");
|
||||
pGetCharABCWidthsA = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsA");
|
||||
pGetCharABCWidthsW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsW");
|
||||
pGetCharABCWidthsFloatW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsFloatW");
|
||||
pGetFontUnicodeRanges = (void *)GetProcAddress(hgdi32, "GetFontUnicodeRanges");
|
||||
pGetGlyphIndicesA = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesA");
|
||||
pGetGlyphIndicesW = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesW");
|
||||
|
@ -332,7 +334,7 @@ static void test_bitmap_font(void)
|
|||
return;
|
||||
}
|
||||
|
||||
hdc = GetDC(0);
|
||||
hdc = CreateCompatibleDC(0);
|
||||
|
||||
/* "System" has only 1 pixel size defined, otherwise the test breaks */
|
||||
ret = EnumFontFamiliesA(hdc, "System", font_enum_proc, (LPARAM)&bitmap_lf);
|
||||
|
@ -406,7 +408,7 @@ static void test_bitmap_font(void)
|
|||
SelectObject(hdc, old_hfont);
|
||||
DeleteObject(hfont);
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
|
||||
/* Test how GDI scales outline font metrics */
|
||||
|
@ -678,6 +680,7 @@ static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DW
|
|||
return 1; /* continue enumeration */
|
||||
}
|
||||
|
||||
#define FH_SCALE 0x80000000
|
||||
static void test_bitmap_font_metrics(void)
|
||||
{
|
||||
static const struct font_data
|
||||
|
@ -685,145 +688,207 @@ static void test_bitmap_font_metrics(void)
|
|||
const char face_name[LF_FACESIZE];
|
||||
int weight, height, ascent, descent, int_leading, ext_leading;
|
||||
int ave_char_width, max_char_width, dpi;
|
||||
BYTE first_char, last_char, def_char, break_char;
|
||||
DWORD ansi_bitfield;
|
||||
WORD skip_lang_id;
|
||||
int scaled_height;
|
||||
} fd[] =
|
||||
{
|
||||
{ "MS Sans Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 96, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 19, 96, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 24, 96, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 20, 96, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 96, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 96, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 25, 96, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 17, 120, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 120, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 120, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 },
|
||||
{ "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 },
|
||||
|
||||
{ "MS Serif", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 12, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 96, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 16, 96, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 19, 15, 4, 3, 0, 8, 18, 96, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 19, 15, 4, 3, 0, 8, 19, 96, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 17, 96, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 22, 96, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 23, 96, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 23, 96, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 26, 96, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 27, 96, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 35, 27, 8, 3, 0, 16, 33, 96, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 35, 27, 8, 3, 0, 16, 34, 96, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 19, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 24, 96, 0x20, 0xff, 0x81, 0x40, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 24, 19, 5, 6, 0, 9, 20, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 25, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x40, FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 120, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 13, 120, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 15, 120, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 23, 18, 5, 3, 0, 10, 21, 120, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 23, 18, 5, 3, 0, 10, 19, 120, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 4, 0, 12, 23, 120, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_MEDIUM, 27, 22, 5, 2, 0, 12, 30, 120, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 33, 26, 7, 3, 0, 14, 30, 120, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_MEDIUM, 32, 25, 7, 2, 0, 14, 32, 120, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 43, 34, 9, 3, 0, 19, 39, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 17, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
{ "MS Sans Serif", FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Sans Serif", FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC },
|
||||
|
||||
{ "Courier", FW_NORMAL, 13, 11, 2, 0, 0, 8, 8, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 13, 11, 2, 2, 0, 5, 12, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 16, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 19, 15, 4, 3, 0, 8, 18, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 19, 15, 4, 3, 0, 8, 19, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 17, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 22, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 21, 16, 5, 3, 0, 9, 23, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 23, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 26, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 3, 0, 12, 27, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 35, 27, 8, 3, 0, 16, 33, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 35, 27, 8, 3, 0, 16, 34, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
|
||||
{ "Courier", FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 25, 20, 5, 0, 0, 15, 15, 120, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 16, 13, 3, 3, 0, 6, 13, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 20, 16, 4, 4, 0, 8, 15, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 23, 18, 5, 3, 0, 10, 21, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 23, 18, 5, 3, 0, 10, 19, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 },
|
||||
{ "MS Serif", FW_NORMAL, 27, 21, 6, 4, 0, 12, 23, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_MEDIUM, 27, 22, 5, 2, 0, 12, 30, 120, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 33, 26, 7, 3, 0, 14, 30, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "MS Serif", FW_MEDIUM, 32, 25, 7, 2, 0, 14, 32, 120, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "MS Serif", FW_NORMAL, 43, 34, 9, 3, 0, 19, 39, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
|
||||
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 14, 96, FS_LATIN1 },
|
||||
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 15, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "System", FW_NORMAL, 18, 16, 2, 0, 2, 8, 16, 96, FS_JISJAPAN },
|
||||
{ "Courier", FW_NORMAL, 13, 11, 2, 0, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
|
||||
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 14, 120, FS_LATIN1 },
|
||||
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 17, 120, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Courier", FW_NORMAL, 25, 20, 5, 0, 0, 15, 15, 120, 0x20, 0xff, 0x40, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC },
|
||||
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 96, FS_LATIN1 },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 2, 4, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 2, 8, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 0, 0, 3, 6, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 0, 0, 4, 8, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 0, 0, 5, 10, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, FS_LATIN1 | FS_LATIN2, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 9, 96, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 4, 10, 96, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, 96, FS_JISJAPAN },
|
||||
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 15, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "System", FW_NORMAL, 18, 16, 2, 0, 2, 8, 16, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 120, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 120, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 5, 120, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 120, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 120, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 120, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 9, 120, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 120, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 12, 10, 2, 2, 0, 5, 10, 120, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 12, 10, 2, 2, 0, 6, 10, 120, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 13, 11, 2, 2, 0, 6, 12, 120, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 13, 11, 2, 2, 0, 6, 11, 120, FS_CYRILLIC },
|
||||
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 14, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 17, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
|
||||
{ "Fixedsys", FW_NORMAL, 15, 12, 3, 3, 0, 8, 8, 96, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "Fixedsys", FW_NORMAL, 16, 12, 4, 3, 0, 8, 8, 96, FS_CYRILLIC },
|
||||
{ "FixedSys", FW_NORMAL, 18, 16, 2, 0, 0, 8, 16, 96, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 2, 4, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 2, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 5, 4, 1, 0, 0, 3, 6, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0, 0, 0, 0, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 0, 0, 4, 8, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0, 0, 0, 0, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 0, 0, 5, 10, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 9, 96, 0, 0, 0, 0, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC, LANG_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 4, 10, 96, 0, 0, 0, 0, FS_ARABIC },
|
||||
{ "Small Fonts", FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
|
||||
/* The 120dpi version still has its dpi marked as 96 */
|
||||
{ "Fixedsys", FW_NORMAL, 20, 16, 4, 2, 0, 10, 10, 96, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC }
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 5, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 9, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 120, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 12, 10, 2, 2, 0, 5, 10, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 12, 10, 2, 2, 0, 6, 10, 120, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "Small Fonts", FW_NORMAL, 13, 11, 2, 2, 0, 6, 12, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_JISJAPAN },
|
||||
{ "Small Fonts", FW_NORMAL, 13, 11, 2, 2, 0, 6, 11, 120, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
|
||||
{ "Fixedsys", FW_NORMAL, 15, 12, 3, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 },
|
||||
{ "Fixedsys", FW_NORMAL, 16, 12, 4, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC },
|
||||
{ "FixedSys", FW_NORMAL, 18, 16, 2, 0, 0, 8, 16, 96, 0, 0, 0, 0, FS_JISJAPAN },
|
||||
|
||||
{ "Fixedsys", FW_NORMAL, 20, 16, 4, 2, 0, 10, 10, 120, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC }
|
||||
|
||||
/* FIXME: add "Terminal" */
|
||||
};
|
||||
static const int font_log_pixels[] = { 96, 120 };
|
||||
HDC hdc;
|
||||
LOGFONT lf;
|
||||
HFONT hfont, old_hfont;
|
||||
TEXTMETRIC tm;
|
||||
INT ret, i;
|
||||
INT ret, i, expected_cs, screen_log_pixels, diff, font_res;
|
||||
WORD system_lang_id;
|
||||
char face_name[LF_FACESIZE];
|
||||
CHARSETINFO csi;
|
||||
|
||||
system_lang_id = PRIMARYLANGID(GetSystemDefaultLangID());
|
||||
trace("system language id %04x\n", system_lang_id);
|
||||
|
||||
expected_cs = GetACP();
|
||||
if (!TranslateCharsetInfo(ULongToPtr(expected_cs), &csi, TCI_SRCCODEPAGE))
|
||||
{
|
||||
skip("TranslateCharsetInfo failed for code page %d\n", expected_cs);
|
||||
return;
|
||||
}
|
||||
expected_cs = csi.ciCharset;
|
||||
trace("ACP %d -> charset %d\n", GetACP(), expected_cs);
|
||||
|
||||
hdc = CreateCompatibleDC(0);
|
||||
assert(hdc);
|
||||
|
||||
trace("logpixelsX %d, logpixelsY %d\n", GetDeviceCaps(hdc, LOGPIXELSX),
|
||||
GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
|
||||
screen_log_pixels = GetDeviceCaps(hdc, LOGPIXELSY);
|
||||
diff = 32768;
|
||||
font_res = 0;
|
||||
for (i = 0; i < sizeof(font_log_pixels)/sizeof(font_log_pixels[0]); i++)
|
||||
{
|
||||
int new_diff = abs(font_log_pixels[i] - screen_log_pixels);
|
||||
if (new_diff < diff)
|
||||
{
|
||||
diff = new_diff;
|
||||
font_res = font_log_pixels[i];
|
||||
}
|
||||
}
|
||||
trace("best font resolution is %d\n", font_res);
|
||||
|
||||
for (i = 0; i < sizeof(fd)/sizeof(fd[0]); i++)
|
||||
{
|
||||
int bit;
|
||||
int bit, height;
|
||||
|
||||
memset(&lf, 0, sizeof(lf));
|
||||
|
||||
lf.lfHeight = fd[i].height;
|
||||
height = fd[i].height & ~FH_SCALE;
|
||||
lf.lfHeight = height;
|
||||
strcpy(lf.lfFaceName, fd[i].face_name);
|
||||
|
||||
for(bit = 0; bit < 32; bit++)
|
||||
{
|
||||
DWORD fs[2];
|
||||
CHARSETINFO csi;
|
||||
BOOL bRet;
|
||||
|
||||
fs[0] = 1L << bit;
|
||||
|
@ -832,30 +897,78 @@ static void test_bitmap_font_metrics(void)
|
|||
if(!TranslateCharsetInfo( fs, &csi, TCI_SRCFONTSIG )) continue;
|
||||
|
||||
lf.lfCharSet = csi.ciCharset;
|
||||
trace("looking for %s height %d charset %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet);
|
||||
ret = EnumFontFamiliesEx(hdc, &lf, find_font_proc, (LPARAM)&lf, 0);
|
||||
if (ret) continue;
|
||||
if (fd[i].height & FH_SCALE)
|
||||
ok(ret, "scaled font height %d should not be enumerated\n", height);
|
||||
else
|
||||
{
|
||||
if (font_res == fd[i].dpi && lf.lfCharSet == expected_cs)
|
||||
{
|
||||
if (ret) /* FIXME: Remove once Wine is fixed */
|
||||
todo_wine ok(!ret, "%s height %d charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi);
|
||||
else
|
||||
ok(!ret, "%s height %d charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi);
|
||||
}
|
||||
}
|
||||
if (ret && !(fd[i].height & FH_SCALE))
|
||||
continue;
|
||||
|
||||
hfont = create_font(lf.lfFaceName, &lf);
|
||||
old_hfont = SelectObject(hdc, hfont);
|
||||
bRet = GetTextMetrics(hdc, &tm);
|
||||
ok(bRet, "GetTextMetrics error %d\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = GetTextFace(hdc, sizeof(face_name), face_name);
|
||||
ok(ret, "GetTextFace error %u\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = GetTextCharset(hdc);
|
||||
|
||||
if (lstrcmp(face_name, fd[i].face_name) != 0)
|
||||
{
|
||||
ok(ret != ANSI_CHARSET, "font charset should not be ANSI_CHARSET\n");
|
||||
ok(ret != expected_cs, "font charset %d should not be %d\n", ret, expected_cs);
|
||||
trace("Skipping replacement %s height %d charset %d\n", face_name, tm.tmHeight, tm.tmCharSet);
|
||||
SelectObject(hdc, old_hfont);
|
||||
DeleteObject(hfont);
|
||||
continue;
|
||||
}
|
||||
|
||||
ok(ret == expected_cs, "got charset %d, expected %d\n", ret, expected_cs);
|
||||
|
||||
trace("created %s, height %d charset %x dpi %d\n", face_name, tm.tmHeight, tm.tmCharSet, tm.tmDigitizedAspectX);
|
||||
trace("expected %s, height %d scaled_hight %d, dpi %d\n", fd[i].face_name, height, fd[i].scaled_height, fd[i].dpi);
|
||||
|
||||
if(fd[i].dpi == tm.tmDigitizedAspectX)
|
||||
{
|
||||
trace("found font %s, height %d charset %x dpi %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi);
|
||||
trace("matched %s, height %d charset %x dpi %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi);
|
||||
if (fd[i].skip_lang_id == 0 || system_lang_id != fd[i].skip_lang_id)
|
||||
{
|
||||
ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, fd[i].height, tm.tmWeight, fd[i].weight);
|
||||
ok(tm.tmHeight == fd[i].height, "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].height, tm.tmHeight, fd[i].height);
|
||||
ok(tm.tmAscent == fd[i].ascent, "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, fd[i].height, tm.tmAscent, fd[i].ascent);
|
||||
ok(tm.tmDescent == fd[i].descent, "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, fd[i].height, tm.tmDescent, fd[i].descent);
|
||||
ok(tm.tmInternalLeading == fd[i].int_leading, "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, fd[i].height, tm.tmInternalLeading, fd[i].int_leading);
|
||||
ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %d != %d\n", fd[i].face_name, fd[i].height, tm.tmExternalLeading, fd[i].ext_leading);
|
||||
ok(tm.tmAveCharWidth == fd[i].ave_char_width, "%s(%d): tm.tmAveCharWidth %d != %d\n", fd[i].face_name, fd[i].height, tm.tmAveCharWidth, fd[i].ave_char_width);
|
||||
ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, height, tm.tmWeight, fd[i].weight);
|
||||
if (fd[i].height & FH_SCALE)
|
||||
ok(tm.tmHeight == fd[i].scaled_height, "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, height, tm.tmHeight, fd[i].scaled_height);
|
||||
else
|
||||
ok(tm.tmHeight == fd[i].height, "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].height, tm.tmHeight, fd[i].height);
|
||||
ok(tm.tmAscent == fd[i].ascent, "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, height, tm.tmAscent, fd[i].ascent);
|
||||
ok(tm.tmDescent == fd[i].descent, "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, height, tm.tmDescent, fd[i].descent);
|
||||
ok(tm.tmInternalLeading == fd[i].int_leading, "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, height, tm.tmInternalLeading, fd[i].int_leading);
|
||||
ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %d != %d\n", fd[i].face_name, height, tm.tmExternalLeading, fd[i].ext_leading);
|
||||
ok(tm.tmAveCharWidth == fd[i].ave_char_width, "%s(%d): tm.tmAveCharWidth %d != %d\n", fd[i].face_name, height, tm.tmAveCharWidth, fd[i].ave_char_width);
|
||||
ok(tm.tmFirstChar == fd[i].first_char, "%s(%d): tm.tmFirstChar = %02x\n", fd[i].face_name, height, tm.tmFirstChar);
|
||||
ok(tm.tmLastChar == fd[i].last_char, "%s(%d): tm.tmLastChar = %02x\n", fd[i].face_name, height, tm.tmLastChar);
|
||||
/* Substitutions like MS Sans Serif,0=MS Sans Serif,204
|
||||
make default char test fail */
|
||||
if (tm.tmCharSet == lf.lfCharSet)
|
||||
ok(tm.tmDefaultChar == fd[i].def_char, "%s(%d): tm.tmDefaultChar = %02x\n", fd[i].face_name, height, tm.tmDefaultChar);
|
||||
ok(tm.tmBreakChar == fd[i].break_char, "%s(%d): tm.tmBreakChar = %02x\n", fd[i].face_name, height, tm.tmBreakChar);
|
||||
ok(tm.tmCharSet == expected_cs || tm.tmCharSet == ANSI_CHARSET, "%s(%d): tm.tmCharSet %d != %d\n", fd[i].face_name, height, tm.tmCharSet, expected_cs);
|
||||
|
||||
/* Don't run the max char width test on System/ANSI_CHARSET. We have extra characters in our font
|
||||
that make the max width bigger */
|
||||
if(strcmp(lf.lfFaceName, "System") || lf.lfCharSet != ANSI_CHARSET)
|
||||
ok(tm.tmMaxCharWidth == fd[i].max_char_width, "%s(%d): tm.tmMaxCharWidth %d != %d\n", fd[i].face_name, fd[i].height, tm.tmMaxCharWidth, fd[i].max_char_width);
|
||||
ok(tm.tmMaxCharWidth == fd[i].max_char_width, "%s(%d): tm.tmMaxCharWidth %d != %d\n", fd[i].face_name, height, tm.tmMaxCharWidth, fd[i].max_char_width);
|
||||
}
|
||||
else
|
||||
skip("Skipping font metrics test for system langid 0x%x\n",
|
||||
|
@ -934,6 +1047,7 @@ static void test_GetCharABCWidths(void)
|
|||
LOGFONTA lf;
|
||||
HFONT hfont;
|
||||
ABC abc[1];
|
||||
ABCFLOAT abcf[1];
|
||||
WORD glyphs[1];
|
||||
DWORD nb;
|
||||
static const struct
|
||||
|
@ -952,7 +1066,8 @@ static void test_GetCharABCWidths(void)
|
|||
{0xffffff, 0xffffff},
|
||||
{0x1000000, 0x1000000},
|
||||
{0xffffff, 0x1000000},
|
||||
{0xffffffff, 0xffffffff}
|
||||
{0xffffffff, 0xffffffff},
|
||||
{0x00, 0xff}
|
||||
};
|
||||
static const struct
|
||||
{
|
||||
|
@ -962,16 +1077,22 @@ static void test_GetCharABCWidths(void)
|
|||
BOOL r[sizeof range / sizeof range[0]];
|
||||
} c[] =
|
||||
{
|
||||
{ANSI_CHARSET, 0x30, 0x30, {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}},
|
||||
{SHIFTJIS_CHARSET, 0x82a0, 0x3042, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}},
|
||||
{HANGEUL_CHARSET, 0x8141, 0xac02, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}},
|
||||
{JOHAB_CHARSET, 0x8446, 0x3135, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}},
|
||||
{GB2312_CHARSET, 0x8141, 0x4e04, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}},
|
||||
{CHINESEBIG5_CHARSET, 0xa142, 0x3001, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}}
|
||||
{ANSI_CHARSET, 0x30, 0x30,
|
||||
{TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}},
|
||||
{SHIFTJIS_CHARSET, 0x82a0, 0x3042,
|
||||
{TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}},
|
||||
{HANGEUL_CHARSET, 0x8141, 0xac02,
|
||||
{TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}},
|
||||
{JOHAB_CHARSET, 0x8446, 0x3135,
|
||||
{TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}},
|
||||
{GB2312_CHARSET, 0x8141, 0x4e04,
|
||||
{TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}},
|
||||
{CHINESEBIG5_CHARSET, 0xa142, 0x3001,
|
||||
{TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}
|
||||
};
|
||||
UINT i;
|
||||
|
||||
if (!pGetCharABCWidthsA || !pGetCharABCWidthsW || !pGetCharABCWidthsI)
|
||||
if (!pGetCharABCWidthsA || !pGetCharABCWidthsW || !pGetCharABCWidthsFloatW || !pGetCharABCWidthsI)
|
||||
{
|
||||
win_skip("GetCharABCWidthsA/W/I not available on this platform\n");
|
||||
return;
|
||||
|
@ -1006,6 +1127,15 @@ static void test_GetCharABCWidths(void)
|
|||
ret = pGetCharABCWidthsW(hdc, 'a', 'a', abc);
|
||||
ok(!ret, "GetCharABCWidthsW should have failed\n");
|
||||
|
||||
ret = pGetCharABCWidthsFloatW(NULL, 'a', 'a', abcf);
|
||||
ok(!ret, "GetCharABCWidthsFloatW should have failed\n");
|
||||
|
||||
ret = pGetCharABCWidthsFloatW(hdc, 'a', 'a', NULL);
|
||||
ok(!ret, "GetCharABCWidthsFloatW should have failed\n");
|
||||
|
||||
ret = pGetCharABCWidthsFloatW(hdc, 'a', 'a', abcf);
|
||||
ok(ret, "GetCharABCWidthsFloatW should have succeeded\n");
|
||||
|
||||
hfont = SelectObject(hdc, hfont);
|
||||
DeleteObject(hfont);
|
||||
|
||||
|
@ -1043,9 +1173,18 @@ static void test_GetCharABCWidths(void)
|
|||
|
||||
for (j = 0; j < sizeof range / sizeof range[0]; ++j)
|
||||
{
|
||||
memset(full, 0xdd, sizeof full);
|
||||
ret = pGetCharABCWidthsA(hdc, range[j].first, range[j].last, full);
|
||||
ok(ret == c[i].r[j], "GetCharABCWidthsA %x - %x should have %s\n",
|
||||
range[j].first, range[j].last, c[i].r[j] ? "succeeded" : "failed");
|
||||
if (ret)
|
||||
{
|
||||
UINT last = range[j].last - range[j].first;
|
||||
ret = pGetCharABCWidthsA(hdc, range[j].last, range[j].last, a);
|
||||
ok(ret && memcmp(&full[last], &a[0], sizeof(ABC)) == 0,
|
||||
"GetCharABCWidthsA %x should match. codepage = %u\n",
|
||||
range[j].last, c[i].cs);
|
||||
}
|
||||
}
|
||||
|
||||
hfont = SelectObject(hdc, hfont);
|
||||
|
@ -1066,6 +1205,7 @@ static void test_text_extents(void)
|
|||
HFONT hfont;
|
||||
SIZE sz;
|
||||
SIZE sz1, sz2;
|
||||
BOOL ret;
|
||||
|
||||
memset(&lf, 0, sizeof(lf));
|
||||
strcpy(lf.lfFaceName, "Arial");
|
||||
|
@ -1122,6 +1262,47 @@ static void test_text_extents(void)
|
|||
"GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results\n");
|
||||
HeapFree(GetProcessHeap(), 0, extents);
|
||||
|
||||
/* extents functions fail with -ve counts (the interesting case being -1) */
|
||||
ret = GetTextExtentPointA(hdc, "o", -1, &sz);
|
||||
ok(ret == FALSE, "got %d\n", ret);
|
||||
ret = GetTextExtentExPointA(hdc, "o", -1, 0, NULL, NULL, &sz);
|
||||
ok(ret == FALSE, "got %d\n", ret);
|
||||
ret = GetTextExtentExPointW(hdc, wt, -1, 0, NULL, NULL, &sz1);
|
||||
ok(ret == FALSE, "got %d\n", ret);
|
||||
|
||||
/* max_extent = 0 succeeds and returns zero */
|
||||
fit1 = fit2 = -215;
|
||||
ret = GetTextExtentExPointA(hdc, NULL, 0, 0, &fit1, NULL, &sz);
|
||||
ok(ret == TRUE ||
|
||||
broken(ret == FALSE), /* NT4, 2k */
|
||||
"got %d\n", ret);
|
||||
ok(fit1 == 0 ||
|
||||
broken(fit1 == -215), /* NT4, 2k */
|
||||
"fit = %d\n", fit1);
|
||||
ret = GetTextExtentExPointW(hdc, NULL, 0, 0, &fit2, NULL, &sz1);
|
||||
ok(ret == TRUE, "got %d\n", ret);
|
||||
ok(fit2 == 0, "fit = %d\n", fit2);
|
||||
|
||||
/* max_extent = -1 is interpreted as a very large width that will
|
||||
* definitely fit our three characters */
|
||||
fit1 = fit2 = -215;
|
||||
ret = GetTextExtentExPointA(hdc, "One", 3, -1, &fit1, NULL, &sz);
|
||||
ok(ret == TRUE, "got %d\n", ret);
|
||||
todo_wine ok(fit1 == 3, "fit = %d\n", fit1);
|
||||
ret = GetTextExtentExPointW(hdc, wt, 3, -1, &fit2, NULL, &sz);
|
||||
ok(ret == TRUE, "got %d\n", ret);
|
||||
todo_wine ok(fit2 == 3, "fit = %d\n", fit2);
|
||||
|
||||
/* max_extent = -2 is interpreted similarly, but the Ansi version
|
||||
* rejects it while the Unicode one accepts it */
|
||||
fit1 = fit2 = -215;
|
||||
ret = GetTextExtentExPointA(hdc, "One", 3, -2, &fit1, NULL, &sz);
|
||||
todo_wine ok(ret == FALSE, "got %d\n", ret);
|
||||
todo_wine ok(fit1 == -215, "fit = %d\n", fit1);
|
||||
ret = GetTextExtentExPointW(hdc, wt, 3, -2, &fit2, NULL, &sz);
|
||||
ok(ret == TRUE, "got %d\n", ret);
|
||||
todo_wine ok(fit2 == 3, "fit = %d\n", fit2);
|
||||
|
||||
hfont = SelectObject(hdc, hfont);
|
||||
DeleteObject(hfont);
|
||||
ReleaseDC(NULL, hdc);
|
||||
|
@ -1354,13 +1535,14 @@ todo_wine {
|
|||
trace("total_kern_pairs %u\n", total_kern_pairs);
|
||||
kern_pair = HeapAlloc(GetProcessHeap(), 0, total_kern_pairs * sizeof(*kern_pair));
|
||||
|
||||
#if 0 /* Win98 (GetKerningPairsA) and XP behave differently here, the test passes on XP */
|
||||
/* Win98 (GetKerningPairsA) and XP behave differently here, the test
|
||||
* passes on XP.
|
||||
*/
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = GetKerningPairsW(hdc, 0, kern_pair);
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
||||
"got error %ld, expected ERROR_INVALID_PARAMETER\n", GetLastError());
|
||||
ok(ret == 0, "got %lu, expected 0\n", ret);
|
||||
#endif
|
||||
"got error %u, expected ERROR_INVALID_PARAMETER\n", GetLastError());
|
||||
ok(ret == 0, "got %u, expected 0\n", ret);
|
||||
|
||||
ret = GetKerningPairsW(hdc, 100, NULL);
|
||||
ok(ret == total_kern_pairs, "got %u, expected %u\n", ret, total_kern_pairs);
|
||||
|
@ -1376,11 +1558,10 @@ todo_wine {
|
|||
for (n = 0; n < ret; n++)
|
||||
{
|
||||
DWORD j;
|
||||
#if 0
|
||||
if (kern_pair[n].wFirst < 127 && kern_pair[n].wSecond < 127)
|
||||
/* Disabled to limit console spam */
|
||||
if (0 && kern_pair[n].wFirst < 127 && kern_pair[n].wSecond < 127)
|
||||
trace("{'%c','%c',%d},\n",
|
||||
kern_pair[n].wFirst, kern_pair[n].wSecond, kern_pair[n].iKernAmount);
|
||||
#endif
|
||||
for (j = 0; j < kd[i].total_kern_pairs; j++)
|
||||
{
|
||||
if (kern_pair[n].wFirst == kd[i].kern_pair[j].wFirst &&
|
||||
|
@ -1832,6 +2013,7 @@ static void test_GetFontUnicodeRanges(void)
|
|||
HFONT hfont, hfont_old;
|
||||
DWORD size;
|
||||
GLYPHSET *gs;
|
||||
DWORD i;
|
||||
|
||||
if (!pGetFontUnicodeRanges)
|
||||
{
|
||||
|
@ -1856,10 +2038,10 @@ static void test_GetFontUnicodeRanges(void)
|
|||
|
||||
size = pGetFontUnicodeRanges(hdc, gs);
|
||||
ok(size, "GetFontUnicodeRanges failed\n");
|
||||
#if 0
|
||||
for (i = 0; i < gs->cRanges; i++)
|
||||
trace("%03d wcLow %04x cGlyphs %u\n", i, gs->ranges[i].wcLow, gs->ranges[i].cGlyphs);
|
||||
#endif
|
||||
|
||||
if (0) /* Disabled to limit console spam */
|
||||
for (i = 0; i < gs->cRanges; i++)
|
||||
trace("%03d wcLow %04x cGlyphs %u\n", i, gs->ranges[i].wcLow, gs->ranges[i].cGlyphs);
|
||||
trace("found %u ranges\n", gs->cRanges);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, gs);
|
||||
|
@ -1886,14 +2068,18 @@ struct enum_font_dataW
|
|||
static INT CALLBACK arial_enum_proc(const LOGFONT *lf, const TEXTMETRIC *tm, DWORD type, LPARAM lParam)
|
||||
{
|
||||
struct enum_font_data *efd = (struct enum_font_data *)lParam;
|
||||
const NEWTEXTMETRIC *ntm = (const NEWTEXTMETRIC *)tm;
|
||||
|
||||
ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight);
|
||||
ok(lf->lfHeight > 0 && lf->lfHeight < 200, "enumerated font height %d\n", lf->lfHeight);
|
||||
|
||||
if (type != TRUETYPE_FONTTYPE) return 1;
|
||||
#if 0
|
||||
trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
|
||||
lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
|
||||
#endif
|
||||
|
||||
ok(ntm->ntmCellHeight + ntm->ntmCellHeight/5 >= ntm->ntmSizeEM, "ntmCellHeight %d should be close to ntmSizeEM %d\n", ntm->ntmCellHeight, ntm->ntmSizeEM);
|
||||
|
||||
if (0) /* Disabled to limit console spam */
|
||||
trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
|
||||
lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
|
||||
if (efd->total < MAX_ENUM_FONTS)
|
||||
efd->lf[efd->total++] = *lf;
|
||||
else
|
||||
|
@ -1905,14 +2091,18 @@ static INT CALLBACK arial_enum_proc(const LOGFONT *lf, const TEXTMETRIC *tm, DWO
|
|||
static INT CALLBACK arial_enum_procw(const LOGFONTW *lf, const TEXTMETRICW *tm, DWORD type, LPARAM lParam)
|
||||
{
|
||||
struct enum_font_dataW *efd = (struct enum_font_dataW *)lParam;
|
||||
const NEWTEXTMETRICW *ntm = (const NEWTEXTMETRICW *)tm;
|
||||
|
||||
ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight);
|
||||
ok(lf->lfHeight > 0 && lf->lfHeight < 200, "enumerated font height %d\n", lf->lfHeight);
|
||||
|
||||
if (type != TRUETYPE_FONTTYPE) return 1;
|
||||
#if 0
|
||||
trace("enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
|
||||
lf->lfFaceName, lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
|
||||
#endif
|
||||
|
||||
ok(ntm->ntmCellHeight + ntm->ntmCellHeight/5 >= ntm->ntmSizeEM, "ntmCellHeight %d should be close to ntmSizeEM %d\n", ntm->ntmCellHeight, ntm->ntmSizeEM);
|
||||
|
||||
if (0) /* Disabled to limit console spam */
|
||||
trace("enumed font %s, charset %d, height %d, weight %d, italic %d\n",
|
||||
wine_dbgstr_w(lf->lfFaceName), lf->lfCharSet, lf->lfHeight, lf->lfWeight, lf->lfItalic);
|
||||
if (efd->total < MAX_ENUM_FONTS)
|
||||
efd->lf[efd->total++] = *lf;
|
||||
else
|
||||
|
@ -2477,7 +2667,7 @@ static BOOL get_first_last_from_cmap4(void *ptr, DWORD *first, DWORD *last, DWOR
|
|||
+ i - seg_count;
|
||||
|
||||
/* some fonts have broken last segment */
|
||||
if ((char *)(glyph_ids + index + sizeof(*glyph_ids)) < (char *)ptr + limit)
|
||||
if ((char *)(glyph_ids + index + 1) < (char *)ptr + limit)
|
||||
index = GET_BE_WORD(glyph_ids[index]);
|
||||
else
|
||||
{
|
||||
|
@ -2664,7 +2854,7 @@ out:
|
|||
return r;
|
||||
}
|
||||
|
||||
static void test_text_metrics(const LOGFONTA *lf)
|
||||
static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm)
|
||||
{
|
||||
HDC hdc;
|
||||
HFONT hfont, hfont_old;
|
||||
|
@ -2673,6 +2863,7 @@ static void test_text_metrics(const LOGFONTA *lf)
|
|||
LONG size, ret;
|
||||
const char *font_name = lf->lfFaceName;
|
||||
DWORD cmap_first = 0, cmap_last = 0;
|
||||
UINT ascent, descent, cell_height;
|
||||
cmap_type cmap_type;
|
||||
BOOL sys_lang_non_english;
|
||||
|
||||
|
@ -2701,6 +2892,12 @@ static void test_text_metrics(const LOGFONTA *lf)
|
|||
ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size);
|
||||
ok(ret == size, "GetFontData should return %u not %u\n", size, ret);
|
||||
|
||||
ascent = GET_BE_WORD(tt_os2.usWinAscent);
|
||||
descent = GET_BE_WORD(tt_os2.usWinDescent);
|
||||
cell_height = ascent + descent;
|
||||
ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n",
|
||||
font_name, ntm->ntmCellHeight, cell_height, ascent, descent);
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = GetTextMetricsA(hdc, &tmA);
|
||||
ok(ret, "GetTextMetricsA error %u\n", GetLastError());
|
||||
|
@ -2889,7 +3086,7 @@ static INT CALLBACK enum_truetype_font_proc(const LOGFONT *lf, const TEXTMETRIC
|
|||
if (type == TRUETYPE_FONTTYPE)
|
||||
{
|
||||
(*enumed)++;
|
||||
test_text_metrics(lf);
|
||||
test_text_metrics(lf, (const NEWTEXTMETRIC *)ntm);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -3685,6 +3882,11 @@ static INT CALLBACK enum_all_fonts_proc(const LOGFONT *elf, const TEXTMETRIC *nt
|
|||
return 1;
|
||||
}
|
||||
|
||||
static INT CALLBACK enum_with_magic_retval_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lparam)
|
||||
{
|
||||
return lparam;
|
||||
}
|
||||
|
||||
static void test_EnumFonts(void)
|
||||
{
|
||||
int ret;
|
||||
|
@ -3706,6 +3908,10 @@ static void test_EnumFonts(void)
|
|||
|
||||
hdc = CreateCompatibleDC(0);
|
||||
|
||||
/* check that the enumproc's retval is returned */
|
||||
ret = EnumFontFamilies(hdc, NULL, enum_with_magic_retval_proc, 0xcafe);
|
||||
ok(ret == 0xcafe, "got %08x\n", ret);
|
||||
|
||||
ret = EnumFontFamilies(hdc, "Arial", enum_fonts_proc, (LPARAM)&lf);
|
||||
ok(!ret, "font Arial is not enumerated\n");
|
||||
ret = strcmp(lf.lfFaceName, "Arial");
|
||||
|
@ -3815,7 +4021,7 @@ static void test_fullname(void)
|
|||
DeleteDC(hdc);
|
||||
}
|
||||
|
||||
static BOOL write_ttf_file(char *tmp_name)
|
||||
static BOOL write_ttf_file(const char *fontname, char *tmp_name)
|
||||
{
|
||||
char tmp_path[MAX_PATH];
|
||||
HRSRC rsrc;
|
||||
|
@ -3825,7 +4031,7 @@ static BOOL write_ttf_file(char *tmp_name)
|
|||
BOOL ret;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
rsrc = FindResource(GetModuleHandle(0), "wine_test.ttf", RT_RCDATA);
|
||||
rsrc = FindResource(GetModuleHandle(0), fontname, RT_RCDATA);
|
||||
ok(rsrc != 0, "FindResource error %d\n", GetLastError());
|
||||
if (!rsrc) return FALSE;
|
||||
SetLastError(0xdeadbeef);
|
||||
|
@ -3871,7 +4077,7 @@ static void test_CreateScalableFontResource(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!write_ttf_file(ttf_name))
|
||||
if (!write_ttf_file("wine_test.ttf", ttf_name))
|
||||
{
|
||||
skip("Failed to create ttf file for testing\n");
|
||||
return;
|
||||
|
@ -3909,13 +4115,11 @@ static void test_CreateScalableFontResource(void)
|
|||
SetLastError(0xdeadbeef);
|
||||
ret = CreateScalableFontResource(0, fot_name, "random file name", tmp_path);
|
||||
ok(!ret, "CreateScalableFontResource() should fail\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CreateScalableFontResource(0, fot_name, NULL, ttf_name);
|
||||
ok(!ret, "CreateScalableFontResource() should fail\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError());
|
||||
|
||||
ret = DeleteFile(fot_name);
|
||||
|
@ -3925,9 +4129,6 @@ todo_wine
|
|||
todo_wine
|
||||
ok(!ret, "RemoveFontResourceEx() should fail\n");
|
||||
|
||||
/* FIXME: since CreateScalableFontResource is a stub further testing is impossible */
|
||||
if (ret) return;
|
||||
|
||||
/* test public font resource */
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CreateScalableFontResource(0, fot_name, ttf_name, NULL);
|
||||
|
@ -3944,11 +4145,11 @@ todo_wine
|
|||
ok(ret, "font wine_test should be enumerated\n");
|
||||
|
||||
ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0);
|
||||
todo_wine
|
||||
ok(!ret, "RemoveFontResourceEx() with not matching flags should fail\n");
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pRemoveFontResourceExA(fot_name, 0, 0);
|
||||
todo_wine
|
||||
ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
|
||||
|
||||
ret = is_truetype_font_installed("wine_test");
|
||||
|
@ -3999,6 +4200,159 @@ todo_wine
|
|||
DeleteFile(ttf_name);
|
||||
}
|
||||
|
||||
static void check_vertical_font(const char *name, BOOL *installed, BOOL *selected, GLYPHMETRICS *gm, WORD *gi)
|
||||
{
|
||||
LOGFONTA lf;
|
||||
HFONT hfont, hfont_prev;
|
||||
HDC hdc;
|
||||
char facename[100];
|
||||
DWORD ret;
|
||||
static const WCHAR str[] = { 0x2025 };
|
||||
|
||||
*installed = is_truetype_font_installed(name);
|
||||
|
||||
lf.lfHeight = -18;
|
||||
lf.lfWidth = 0;
|
||||
lf.lfEscapement = 0;
|
||||
lf.lfOrientation = 0;
|
||||
lf.lfWeight = FW_DONTCARE;
|
||||
lf.lfItalic = 0;
|
||||
lf.lfUnderline = 0;
|
||||
lf.lfStrikeOut = 0;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
|
||||
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||
lf.lfQuality = DEFAULT_QUALITY;
|
||||
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
|
||||
strcpy(lf.lfFaceName, name);
|
||||
|
||||
hfont = CreateFontIndirectA(&lf);
|
||||
ok(hfont != NULL, "CreateFontIndirectA failed\n");
|
||||
|
||||
hdc = GetDC(NULL);
|
||||
|
||||
hfont_prev = SelectObject(hdc, hfont);
|
||||
ok(hfont_prev != NULL, "SelectObject failed\n");
|
||||
|
||||
ret = GetTextFaceA(hdc, sizeof facename, facename);
|
||||
ok(ret, "GetTextFaceA failed\n");
|
||||
*selected = !strcmp(facename, name);
|
||||
|
||||
ret = GetGlyphOutlineW(hdc, 0x2025, GGO_METRICS, gm, 0, NULL, &mat);
|
||||
ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n");
|
||||
if (!*selected)
|
||||
memset(gm, 0, sizeof *gm);
|
||||
|
||||
ret = pGetGlyphIndicesW(hdc, str, 1, gi, 0);
|
||||
ok(ret != GDI_ERROR, "GetGlyphIndicesW failed\n");
|
||||
|
||||
SelectObject(hdc, hfont_prev);
|
||||
DeleteObject(hfont);
|
||||
ReleaseDC(NULL, hdc);
|
||||
}
|
||||
|
||||
static void test_vertical_font(void)
|
||||
{
|
||||
char ttf_name[MAX_PATH];
|
||||
int num;
|
||||
BOOL ret, installed, selected;
|
||||
GLYPHMETRICS gm;
|
||||
WORD hgi, vgi;
|
||||
|
||||
if (!pAddFontResourceExA || !pRemoveFontResourceExA || !pGetGlyphIndicesW)
|
||||
{
|
||||
win_skip("AddFontResourceExA or GetGlyphIndicesW is not available on this platform\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!write_ttf_file("vertical.ttf", ttf_name))
|
||||
{
|
||||
skip("Failed to create ttf file for testing\n");
|
||||
return;
|
||||
}
|
||||
|
||||
num = pAddFontResourceExA(ttf_name, FR_PRIVATE, 0);
|
||||
ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical.ttf\n");
|
||||
|
||||
check_vertical_font("@WineTestVertical", &installed, &selected, &gm, &hgi);
|
||||
ok(installed, "@WineTestVertical is not installed\n");
|
||||
ok(selected, "@WineTestVertical is not selected\n");
|
||||
ok(gm.gmBlackBoxX > gm.gmBlackBoxY,
|
||||
"gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n",
|
||||
gm.gmBlackBoxX, gm.gmBlackBoxY);
|
||||
|
||||
check_vertical_font("@@WineTestVertical", &installed, &selected, &gm, &vgi);
|
||||
ok(installed, "@@WineTestVertical is not installed\n");
|
||||
ok(selected, "@@WineTestVertical is not selected\n");
|
||||
ok(gm.gmBlackBoxX < gm.gmBlackBoxY,
|
||||
"gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n",
|
||||
gm.gmBlackBoxX, gm.gmBlackBoxY);
|
||||
|
||||
ok(hgi == vgi, "different glyph h:%u v:%u\n", hgi, vgi);
|
||||
|
||||
ret = pRemoveFontResourceExA(ttf_name, FR_PRIVATE, 0);
|
||||
ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
|
||||
|
||||
DeleteFile(ttf_name);
|
||||
}
|
||||
|
||||
static INT CALLBACK has_vertical_font_proc(const LOGFONT *lf, const TEXTMETRIC *ntm,
|
||||
DWORD type, LPARAM lParam)
|
||||
{
|
||||
if (lf->lfFaceName[0] == '@') {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void test_east_asian_font_selection(void)
|
||||
{
|
||||
HDC hdc;
|
||||
UINT charset[] = { SHIFTJIS_CHARSET, HANGEUL_CHARSET, JOHAB_CHARSET,
|
||||
GB2312_CHARSET, CHINESEBIG5_CHARSET };
|
||||
size_t i;
|
||||
|
||||
hdc = GetDC(NULL);
|
||||
|
||||
for (i = 0; i < sizeof(charset)/sizeof(charset[0]); i++)
|
||||
{
|
||||
LOGFONTA lf;
|
||||
HFONT hfont;
|
||||
char face_name[LF_FACESIZE];
|
||||
int ret;
|
||||
|
||||
memset(&lf, 0, sizeof lf);
|
||||
lf.lfFaceName[0] = '\0';
|
||||
lf.lfCharSet = charset[i];
|
||||
|
||||
if (EnumFontFamiliesEx(hdc, &lf, has_vertical_font_proc, 0, 0))
|
||||
{
|
||||
skip("Vertical font for charset %u is not installed\n", charset[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
hfont = CreateFontIndirectA(&lf);
|
||||
hfont = SelectObject(hdc, hfont);
|
||||
memset(face_name, 0, sizeof face_name);
|
||||
ret = GetTextFaceA(hdc, sizeof face_name, face_name);
|
||||
ok(ret && face_name[0] != '@',
|
||||
"expected non-vertical face for charset %u, got %s\n", charset[i], face_name);
|
||||
DeleteObject(SelectObject(hdc, hfont));
|
||||
|
||||
memset(&lf, 0, sizeof lf);
|
||||
strcpy(lf.lfFaceName, "@");
|
||||
lf.lfCharSet = charset[i];
|
||||
hfont = CreateFontIndirectA(&lf);
|
||||
hfont = SelectObject(hdc, hfont);
|
||||
memset(face_name, 0, sizeof face_name);
|
||||
ret = GetTextFaceA(hdc, sizeof face_name, face_name);
|
||||
ok(ret && face_name[0] == '@',
|
||||
"expected vertical face for charset %u, got %s\n", charset[i], face_name);
|
||||
DeleteObject(SelectObject(hdc, hfont));
|
||||
}
|
||||
ReleaseDC(NULL, hdc);
|
||||
}
|
||||
|
||||
START_TEST(font)
|
||||
{
|
||||
init();
|
||||
|
@ -4051,9 +4405,11 @@ START_TEST(font)
|
|||
test_CreateFontIndirectEx();
|
||||
test_oemcharset();
|
||||
test_fullname();
|
||||
test_east_asian_font_selection();
|
||||
|
||||
/* CreateScalableFontResource should be last test until RemoveFontResource
|
||||
/* These tests should be last test until RemoveFontResource
|
||||
* is properly implemented.
|
||||
*/
|
||||
test_vertical_font();
|
||||
test_CreateScalableFontResource();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -1321,6 +1321,51 @@ static const unsigned char EMF_DCBRUSH_BITS[] =
|
|||
0x14, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static const unsigned char EMF_BEZIER_BITS[] =
|
||||
{
|
||||
0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x2a, 0x0d, 0x00, 0x1a, 0x2f, 0x0d, 0x00,
|
||||
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
|
||||
0x44, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
||||
0x51, 0x01, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x68, 0x24, 0x05, 0x00,
|
||||
0xb0, 0x1e, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x14, 0x00,
|
||||
0x0f, 0x00, 0x0f, 0x00, 0x55, 0x00, 0x00, 0x00,
|
||||
0x2c, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x14, 0x00,
|
||||
0x0f, 0x00, 0x0f, 0x00, 0x19, 0x00, 0x19, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
|
||||
0x01, 0x80, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x34, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
|
||||
0x01, 0x80, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
/* For debugging or dumping the raw metafiles produced by
|
||||
* new test functions.
|
||||
*/
|
||||
|
@ -1588,6 +1633,28 @@ static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr
|
|||
HeapFree(GetProcessHeap(), 0, emr_nt4);
|
||||
}
|
||||
}
|
||||
else if (emr1->iType == EMR_POLYBEZIERTO16 || emr1->iType == EMR_POLYBEZIER16)
|
||||
{
|
||||
EMRPOLYBEZIER16 *eto1, *eto2;
|
||||
|
||||
eto1 = (EMRPOLYBEZIER16*)emr1;
|
||||
eto2 = (EMRPOLYBEZIER16*)emr2;
|
||||
|
||||
diff = eto1->cpts != eto2->cpts;
|
||||
if(!diff)
|
||||
diff = memcmp(eto1->apts, eto2->apts, eto1->cpts * sizeof(POINTS));
|
||||
}
|
||||
else if (emr1->iType == EMR_POLYBEZIERTO || emr1->iType == EMR_POLYBEZIER)
|
||||
{
|
||||
EMRPOLYBEZIER *eto1, *eto2;
|
||||
|
||||
eto1 = (EMRPOLYBEZIER*)emr1;
|
||||
eto2 = (EMRPOLYBEZIER*)emr2;
|
||||
|
||||
diff = eto1->cptl != eto2->cptl;
|
||||
if(!diff)
|
||||
diff = memcmp(eto1->aptl, eto2->aptl, eto1->cptl * sizeof(POINTL));
|
||||
}
|
||||
else
|
||||
diff = memcmp(emr1, emr2, emr1->nSize);
|
||||
|
||||
|
@ -2256,7 +2323,7 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
|
|||
{
|
||||
if (emr->iType == EMR_EXTSELECTCLIPRGN)
|
||||
{
|
||||
const EMREXTSELECTCLIPRGN *clip = (const EMREXTSELECTCLIPRGN *)emr;
|
||||
const EMREXTSELECTCLIPRGN *clip = (const EMREXTSELECTCLIPRGN *)emr;
|
||||
union _rgn
|
||||
{
|
||||
RGNDATA data;
|
||||
|
@ -3095,6 +3162,45 @@ static void test_SetEnhMetaFileBits(void)
|
|||
DeleteEnhMetaFile(hemf);
|
||||
}
|
||||
|
||||
static void test_emf_polybezier(void)
|
||||
{
|
||||
HDC hdcMetafile;
|
||||
HENHMETAFILE hemf;
|
||||
POINT pts[4];
|
||||
BOOL ret;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL);
|
||||
ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError());
|
||||
|
||||
pts[0].x = pts[0].y = 10;
|
||||
pts[1].x = pts[1].y = 20;
|
||||
pts[2].x = pts[2].y = 15;
|
||||
pts[3].x = pts[3].y = 25;
|
||||
ret = PolyBezierTo(hdcMetafile, pts, 3); /* EMR_POLYBEZIERTO16 */
|
||||
ok( ret, "PolyBezierTo failed\n" );
|
||||
ret = PolyBezier(hdcMetafile, pts, 4); /* EMR_POLYBEZIER16 */
|
||||
ok( ret, "PolyBezier failed\n" );
|
||||
|
||||
pts[0].x = pts[0].y = 32769;
|
||||
ret = PolyBezier(hdcMetafile, pts, 4); /* EMR_POLYBEZIER */
|
||||
ok( ret, "PolyBezier failed\n" );
|
||||
ret = PolyBezierTo(hdcMetafile, pts, 3); /* EMR_POLYBEZIERTO */
|
||||
ok( ret, "PolyBezierTo failed\n" );
|
||||
|
||||
hemf = CloseEnhMetaFile(hdcMetafile);
|
||||
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());
|
||||
|
||||
if(compare_emf_bits(hemf, EMF_BEZIER_BITS, sizeof(EMF_BEZIER_BITS),
|
||||
"emf_Bezier", FALSE) != 0)
|
||||
{
|
||||
dump_emf_bits(hemf, "emf_Bezier");
|
||||
dump_emf_records(hemf, "emf_Bezier");
|
||||
}
|
||||
|
||||
DeleteEnhMetaFile(hemf);
|
||||
}
|
||||
|
||||
START_TEST(metafile)
|
||||
{
|
||||
init_function_pointers();
|
||||
|
@ -3117,6 +3223,7 @@ START_TEST(metafile)
|
|||
test_mf_ExtTextOut_on_path();
|
||||
test_emf_ExtTextOut_on_path();
|
||||
test_emf_clipping();
|
||||
test_emf_polybezier();
|
||||
|
||||
/* For metafile conversions */
|
||||
test_mf_conversions();
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -145,8 +144,56 @@ static void test_palette_entries(void)
|
|||
ok( palEntry.peFlags == getEntryResult.peFlags, "palEntry.peFlags (%#x) != getEntryResult.peFlags (%#x)\n", palEntry.peFlags, getEntryResult.peFlags );
|
||||
}
|
||||
|
||||
static void test_halftone_palette(void)
|
||||
{
|
||||
HDC hdc;
|
||||
HPALETTE pal;
|
||||
PALETTEENTRY entries[256];
|
||||
PALETTEENTRY defpal[20];
|
||||
int i, count;
|
||||
|
||||
hdc = GetDC(0);
|
||||
|
||||
count = GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, 20, defpal );
|
||||
ok( count == 20, "wrong size %u\n", count );
|
||||
|
||||
pal = CreateHalftonePalette( hdc );
|
||||
count = GetPaletteEntries( pal, 0, 256, entries );
|
||||
ok( count == 256 || broken(count <= 20), /* nt 4 */
|
||||
"wrong size %u\n", count );
|
||||
|
||||
/* first and last 10 match the default palette */
|
||||
if (count >= 20)
|
||||
{
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
ok( entries[i].peRed == defpal[i].peRed &&
|
||||
entries[i].peGreen == defpal[i].peGreen &&
|
||||
entries[i].peBlue == defpal[i].peBlue &&
|
||||
!entries[i].peFlags,
|
||||
"%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
|
||||
entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
|
||||
defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue );
|
||||
}
|
||||
for (i = count - 10; i < count; i++)
|
||||
{
|
||||
int idx = i - count + 20;
|
||||
ok( entries[i].peRed == defpal[idx].peRed &&
|
||||
entries[i].peGreen == defpal[idx].peGreen &&
|
||||
entries[i].peBlue == defpal[idx].peBlue &&
|
||||
!entries[i].peFlags,
|
||||
"%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
|
||||
entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
|
||||
defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue );
|
||||
}
|
||||
}
|
||||
DeleteObject( pal );
|
||||
ReleaseDC( 0, hdc );
|
||||
}
|
||||
|
||||
START_TEST(palette)
|
||||
{
|
||||
test_DIB_PAL_COLORS();
|
||||
test_palette_entries();
|
||||
test_halftone_palette();
|
||||
}
|
||||
|
|
|
@ -33,6 +33,238 @@
|
|||
|
||||
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
|
||||
|
||||
static void test_path_state(void)
|
||||
{
|
||||
BYTE buffer[sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD)];
|
||||
BITMAPINFO *bi = (BITMAPINFO *)buffer;
|
||||
HDC hdc;
|
||||
HBITMAP orig, dib;
|
||||
void *bits;
|
||||
BOOL ret;
|
||||
|
||||
hdc = CreateCompatibleDC( 0 );
|
||||
memset( buffer, 0, sizeof(buffer) );
|
||||
bi->bmiHeader.biSize = sizeof(bi->bmiHeader);
|
||||
bi->bmiHeader.biHeight = 256;
|
||||
bi->bmiHeader.biWidth = 256;
|
||||
bi->bmiHeader.biBitCount = 32;
|
||||
bi->bmiHeader.biPlanes = 1;
|
||||
bi->bmiHeader.biCompression = BI_RGB;
|
||||
dib = CreateDIBSection( 0, bi, DIB_RGB_COLORS, (void**)&bits, NULL, 0 );
|
||||
orig = SelectObject( hdc, dib );
|
||||
|
||||
BeginPath( hdc );
|
||||
LineTo( hdc, 100, 100 );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
|
||||
/* selecting another bitmap doesn't affect the path */
|
||||
SelectObject( hdc, orig );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
|
||||
SelectObject( hdc, dib );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
|
||||
ret = EndPath( hdc );
|
||||
ok( ret, "EndPath failed error %u\n", GetLastError() );
|
||||
ret = WidenPath( hdc );
|
||||
ok( ret, "WidenPath failed error %u\n", GetLastError() );
|
||||
|
||||
SelectObject( hdc, orig );
|
||||
ret = WidenPath( hdc );
|
||||
ok( ret, "WidenPath failed error %u\n", GetLastError() );
|
||||
|
||||
BeginPath( hdc );
|
||||
LineTo( hdc, 100, 100 );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
SaveDC( hdc );
|
||||
SelectObject( hdc, dib );
|
||||
ret = EndPath( hdc );
|
||||
ok( ret, "EndPath failed error %u\n", GetLastError() );
|
||||
ret = WidenPath( hdc );
|
||||
ok( ret, "WidenPath failed error %u\n", GetLastError() );
|
||||
|
||||
/* path should be open again after RestoreDC */
|
||||
RestoreDC( hdc, -1 );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
ret = EndPath( hdc );
|
||||
ok( ret, "EndPath failed error %u\n", GetLastError() );
|
||||
|
||||
SaveDC( hdc );
|
||||
BeginPath( hdc );
|
||||
RestoreDC( hdc, -1 );
|
||||
ret = WidenPath( hdc );
|
||||
ok( ret, "WidenPath failed error %u\n", GetLastError() );
|
||||
|
||||
/* test all functions with no path at all */
|
||||
AbortPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = FlattenPath( hdc );
|
||||
ok( !ret, "FlattenPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = StrokePath( hdc );
|
||||
ok( !ret, "StrokePath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = FillPath( hdc );
|
||||
ok( !ret, "FillPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = StrokeAndFillPath( hdc );
|
||||
ok( !ret, "StrokeAndFillPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = SelectClipPath( hdc, RGN_OR );
|
||||
ok( !ret, "SelectClipPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = EndPath( hdc );
|
||||
ok( !ret, "SelectClipPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = CloseFigure( hdc );
|
||||
ok( !ret, "CloseFigure succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
/* test all functions with an open path */
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = WidenPath( hdc );
|
||||
ok( !ret, "WidenPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = FlattenPath( hdc );
|
||||
ok( !ret, "FlattenPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = StrokePath( hdc );
|
||||
ok( !ret, "StrokePath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = FillPath( hdc );
|
||||
ok( !ret, "FillPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = StrokeAndFillPath( hdc );
|
||||
ok( !ret, "StrokeAndFillPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
Rectangle( hdc, 1, 1, 10, 10 ); /* region needs some contents */
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = SelectClipPath( hdc, RGN_OR );
|
||||
ok( !ret, "SelectClipPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
ret = CloseFigure( hdc );
|
||||
ok( ret, "CloseFigure failed\n" );
|
||||
|
||||
/* test all functions with a closed path */
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
ret = WidenPath( hdc );
|
||||
ok( ret, "WidenPath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
ret = FlattenPath( hdc );
|
||||
ok( ret, "FlattenPath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
ret = StrokePath( hdc );
|
||||
ok( ret, "StrokePath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
ret = FillPath( hdc );
|
||||
ok( ret, "FillPath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
ret = StrokeAndFillPath( hdc );
|
||||
ok( ret, "StrokeAndFillPath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
Rectangle( hdc, 1, 1, 10, 10 ); /* region needs some contents */
|
||||
EndPath( hdc );
|
||||
ret = SelectClipPath( hdc, RGN_OR );
|
||||
ok( ret, "SelectClipPath failed\n" );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = CloseFigure( hdc );
|
||||
ok( !ret, "CloseFigure succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
AbortPath( hdc );
|
||||
BeginPath( hdc );
|
||||
EndPath( hdc );
|
||||
SetLastError( 0xdeadbeef );
|
||||
ret = EndPath( hdc );
|
||||
ok( !ret, "SelectClipPath succeeded\n" );
|
||||
ok( GetLastError() == ERROR_CAN_NOT_COMPLETE || broken(GetLastError() == 0xdeadbeef),
|
||||
"wrong error %u\n", GetLastError() );
|
||||
|
||||
DeleteDC( hdc );
|
||||
DeleteObject( dib );
|
||||
}
|
||||
|
||||
static void test_widenpath(void)
|
||||
{
|
||||
HDC hdc = GetDC(0);
|
||||
|
@ -504,6 +736,7 @@ static void test_linedda(void)
|
|||
|
||||
START_TEST(path)
|
||||
{
|
||||
test_path_state();
|
||||
test_widenpath();
|
||||
test_arcto();
|
||||
test_anglearc();
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -54,7 +53,13 @@ static void test_logpen(void)
|
|||
{ PS_NULL, 123, RGB(0x12,0x34,0x56), PS_NULL, 1, 0 },
|
||||
{ PS_INSIDEFRAME, 123, RGB(0x12,0x34,0x56), PS_INSIDEFRAME, 123, RGB(0x12,0x34,0x56) },
|
||||
{ PS_USERSTYLE, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ PS_ALTERNATE, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) }
|
||||
{ PS_ALTERNATE, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 9, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 10, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 11, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 13, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 14, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
{ 15, 123, RGB(0x12,0x34,0x56), PS_SOLID, 123, RGB(0x12,0x34,0x56) },
|
||||
};
|
||||
INT i, size;
|
||||
HPEN hpen;
|
||||
|
@ -63,11 +68,9 @@ static void test_logpen(void)
|
|||
LOGBRUSH lb;
|
||||
DWORD_PTR unset_hatch;
|
||||
DWORD obj_type, user_style[2] = { 0xabc, 0xdef };
|
||||
struct
|
||||
{
|
||||
EXTLOGPEN elp;
|
||||
DWORD style_data[10];
|
||||
} ext_pen;
|
||||
char elp_buffer[128];
|
||||
EXTLOGPEN *ext_pen = (EXTLOGPEN *)elp_buffer;
|
||||
DWORD *ext_style = ext_pen->elpStyleEntry;
|
||||
|
||||
for (i = 0; i < sizeof(pen)/sizeof(pen[0]); i++)
|
||||
{
|
||||
|
@ -95,19 +98,9 @@ static void test_logpen(void)
|
|||
size = GetObject(hpen, sizeof(lp), &lp);
|
||||
ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError());
|
||||
|
||||
if (pen[i].style == PS_USERSTYLE || pen[i].style == PS_ALTERNATE)
|
||||
{
|
||||
if (lp.lopnStyle == pen[i].style)
|
||||
{
|
||||
win_skip("Skipping PS_USERSTYLE and PS_ALTERNATE tests on Win9x\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
|
||||
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
|
||||
ok(lp.lopnWidth.y == 0 ||
|
||||
broken(lp.lopnWidth.y == 0xb), /* Win9x */
|
||||
"expected 0, got %d\n", lp.lopnWidth.y);
|
||||
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
|
||||
ok(lp.lopnColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, lp.lopnColor);
|
||||
|
||||
DeleteObject(hpen);
|
||||
|
@ -128,9 +121,7 @@ static void test_logpen(void)
|
|||
memset(&lp, 0xb0, sizeof(lp));
|
||||
SetLastError(0xdeadbeef);
|
||||
size = GetObject(hpen, sizeof(lp.lopnStyle), &lp);
|
||||
ok(!size ||
|
||||
broken(size == sizeof(lp.lopnStyle)), /* Win9x */
|
||||
"GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
|
||||
/* see how larger buffer sizes are handled */
|
||||
memset(&lp, 0xb0, sizeof(lp));
|
||||
|
@ -219,6 +210,12 @@ static void test_logpen(void)
|
|||
ok(hpen == 0, "ExtCreatePen should fail\n");
|
||||
goto test_geometric_pens;
|
||||
}
|
||||
if (pen[i].style > PS_ALTERNATE)
|
||||
{
|
||||
ok(hpen == 0, "ExtCreatePen should fail\n");
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError());
|
||||
goto test_geometric_pens;
|
||||
}
|
||||
ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError());
|
||||
|
||||
obj_type = GetObjectType(hpen);
|
||||
|
@ -242,17 +239,12 @@ static void test_logpen(void)
|
|||
break;
|
||||
|
||||
case PS_USERSTYLE:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style) ||
|
||||
broken(size == 0 && GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
break;
|
||||
|
||||
default:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) ||
|
||||
broken(size == sizeof(LOGPEN)) || /* Win9x */
|
||||
broken(pen[i].style == PS_ALTERNATE &&
|
||||
size == 0 &&
|
||||
GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
break;
|
||||
}
|
||||
|
@ -261,20 +253,18 @@ static void test_logpen(void)
|
|||
memset(&elp, 0xb0, sizeof(elp));
|
||||
SetLastError(0xdeadbeef);
|
||||
size = GetObject(hpen, sizeof(elp.elpPenStyle), &elp);
|
||||
ok(!size ||
|
||||
broken(size == sizeof(elp.elpPenStyle)), /* Win9x */
|
||||
"GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
|
||||
/* see how larger buffer sizes are handled */
|
||||
memset(&ext_pen, 0xb0, sizeof(ext_pen));
|
||||
memset(elp_buffer, 0xb0, sizeof(elp_buffer));
|
||||
SetLastError(0xdeadbeef);
|
||||
size = GetObject(hpen, sizeof(ext_pen), &ext_pen.elp);
|
||||
size = GetObject(hpen, sizeof(elp_buffer), elp_buffer);
|
||||
switch (pen[i].style)
|
||||
{
|
||||
case PS_NULL:
|
||||
ok(size == sizeof(LOGPEN),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
memcpy(&lp, &ext_pen.elp, sizeof(lp));
|
||||
memcpy(&lp, ext_pen, sizeof(lp));
|
||||
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
|
||||
ok(lp.lopnWidth.x == pen[i].ret_width, "expected %u, got %d\n", pen[i].ret_width, lp.lopnWidth.x);
|
||||
ok(lp.lopnWidth.y == 0, "expected 0, got %d\n", lp.lopnWidth.y);
|
||||
|
@ -287,41 +277,31 @@ static void test_logpen(void)
|
|||
size = GetObject(hpen, sizeof(elp), &elp);
|
||||
ok(size == sizeof(EXTLOGPEN),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen->elpNumEntries);
|
||||
break;
|
||||
|
||||
case PS_USERSTYLE:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style),
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 2, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen.elp.elpStyleEntry[0] == 0xabc, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[0]);
|
||||
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xdef, got %x\n", ext_pen.elp.elpStyleEntry[1]);
|
||||
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
|
||||
ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]);
|
||||
ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) ||
|
||||
broken(size == sizeof(LOGPEN)) || /* Win9x */
|
||||
broken(pen[i].style == PS_ALTERNATE &&
|
||||
size == 0 &&
|
||||
GetLastError() == ERROR_INVALID_PARAMETER), /* Win9x */
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 0, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pen[i].style == PS_USERSTYLE)
|
||||
{
|
||||
todo_wine
|
||||
ok(ext_pen.elp.elpPenStyle == pen[i].style, "expected %x, got %x\n", pen[i].style, ext_pen.elp.elpPenStyle);
|
||||
}
|
||||
else
|
||||
ok(ext_pen.elp.elpPenStyle == pen[i].style, "expected %x, got %x\n", pen[i].style, ext_pen.elp.elpPenStyle);
|
||||
ok(ext_pen.elp.elpWidth == 1, "expected 1, got %x\n", ext_pen.elp.elpWidth);
|
||||
ok(ext_pen.elp.elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen.elp.elpColor);
|
||||
ok(ext_pen.elp.elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen.elp.elpBrushStyle);
|
||||
ok(ext_pen->elpPenStyle == pen[i].style, "expected %x, got %x\n", pen[i].style, ext_pen->elpPenStyle);
|
||||
ok(ext_pen->elpWidth == 1, "expected 1, got %x\n", ext_pen->elpWidth);
|
||||
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor);
|
||||
ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
|
||||
|
||||
DeleteObject(hpen);
|
||||
|
||||
|
@ -344,6 +324,12 @@ test_geometric_pens:
|
|||
ok(hpen == 0, "ExtCreatePen should fail\n");
|
||||
continue;
|
||||
}
|
||||
if (pen[i].style > PS_ALTERNATE)
|
||||
{
|
||||
ok(hpen == 0, "ExtCreatePen should fail\n");
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong last error value %d\n", GetLastError());
|
||||
continue;
|
||||
}
|
||||
ok(hpen != 0, "ExtCreatePen error %d\n", GetLastError());
|
||||
|
||||
obj_type = GetObjectType(hpen);
|
||||
|
@ -363,12 +349,12 @@ test_geometric_pens:
|
|||
break;
|
||||
|
||||
case PS_USERSTYLE:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style),
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
break;
|
||||
|
||||
default:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry),
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
break;
|
||||
}
|
||||
|
@ -396,21 +382,21 @@ test_geometric_pens:
|
|||
ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/,
|
||||
"GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
|
||||
memset(&ext_pen, 0xb0, sizeof(ext_pen));
|
||||
memset(elp_buffer, 0xb0, sizeof(elp_buffer));
|
||||
SetLastError(0xdeadbeef);
|
||||
/* buffer is too small for user styles */
|
||||
size = GetObject(hpen, sizeof(elp), &ext_pen.elp);
|
||||
size = GetObject(hpen, sizeof(EXTLOGPEN), elp_buffer);
|
||||
switch (pen[i].style)
|
||||
{
|
||||
case PS_NULL:
|
||||
ok(size == sizeof(EXTLOGPEN),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == 0, "expected 0, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 0, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen->elpHatch == 0, "expected 0, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
|
||||
|
||||
/* for PS_NULL it also works this way */
|
||||
SetLastError(0xdeadbeef);
|
||||
size = GetObject(hpen, sizeof(ext_pen), &lp);
|
||||
size = GetObject(hpen, sizeof(elp_buffer), &lp);
|
||||
ok(size == sizeof(LOGPEN),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle);
|
||||
|
@ -422,37 +408,37 @@ test_geometric_pens:
|
|||
case PS_USERSTYLE:
|
||||
ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/,
|
||||
"GetObject should fail: size %d, error %d\n", size, GetLastError());
|
||||
size = GetObject(hpen, sizeof(ext_pen), &ext_pen.elp);
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry) + sizeof(user_style),
|
||||
size = GetObject(hpen, sizeof(elp_buffer), elp_buffer);
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 2, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen.elp.elpStyleEntry[0] == 0xabc, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[0]);
|
||||
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xdef, got %x\n", ext_pen.elp.elpStyleEntry[1]);
|
||||
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries);
|
||||
ok(ext_style[0] == 0xabc, "expected 0xabc, got %x\n", ext_style[0]);
|
||||
ok(ext_style[1] == 0xdef, "expected 0xdef, got %x\n", ext_style[1]);
|
||||
break;
|
||||
|
||||
default:
|
||||
ok(size == sizeof(EXTLOGPEN) - sizeof(elp.elpStyleEntry),
|
||||
ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ),
|
||||
"GetObject returned %d, error %d\n", size, GetLastError());
|
||||
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
|
||||
ok(ext_pen.elp.elpNumEntries == 0, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
|
||||
ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch);
|
||||
ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries);
|
||||
break;
|
||||
}
|
||||
|
||||
/* for some reason XP differentiates PS_NULL here */
|
||||
if (pen[i].style == PS_NULL)
|
||||
ok(ext_pen.elp.elpPenStyle == pen[i].ret_style, "expected %x, got %x\n", pen[i].ret_style, ext_pen.elp.elpPenStyle);
|
||||
ok(ext_pen->elpPenStyle == pen[i].ret_style, "expected %x, got %x\n", pen[i].ret_style, ext_pen->elpPenStyle);
|
||||
else
|
||||
{
|
||||
ok(ext_pen.elp.elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %x\n", PS_GEOMETRIC | pen[i].style, ext_pen.elp.elpPenStyle);
|
||||
ok(ext_pen->elpPenStyle == (PS_GEOMETRIC | pen[i].style), "expected %x, got %x\n", PS_GEOMETRIC | pen[i].style, ext_pen->elpPenStyle);
|
||||
}
|
||||
|
||||
if (pen[i].style == PS_NULL)
|
||||
ok(ext_pen.elp.elpWidth == 0, "expected 0, got %x\n", ext_pen.elp.elpWidth);
|
||||
ok(ext_pen->elpWidth == 0, "expected 0, got %x\n", ext_pen->elpWidth);
|
||||
else
|
||||
ok(ext_pen.elp.elpWidth == pen[i].ret_width, "expected %u, got %x\n", pen[i].ret_width, ext_pen.elp.elpWidth);
|
||||
ok(ext_pen.elp.elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen.elp.elpColor);
|
||||
ok(ext_pen.elp.elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen.elp.elpBrushStyle);
|
||||
ok(ext_pen->elpWidth == pen[i].ret_width, "expected %u, got %x\n", pen[i].ret_width, ext_pen->elpWidth);
|
||||
ok(ext_pen->elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, ext_pen->elpColor);
|
||||
ok(ext_pen->elpBrushStyle == BS_SOLID, "expected BS_SOLID, got %x\n", ext_pen->elpBrushStyle);
|
||||
|
||||
DeleteObject(hpen);
|
||||
}
|
||||
|
@ -538,11 +524,6 @@ static void test_ps_userstyle(void)
|
|||
|
||||
pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 3, NULL);
|
||||
ok(pen == 0, "ExtCreatePen should fail\n");
|
||||
if (pen == 0 && GetLastError() == 0xdeadbeef)
|
||||
{
|
||||
win_skip("Looks like 9x, skipping PS_USERSTYLE tests\n");
|
||||
return;
|
||||
}
|
||||
expect(ERROR_INVALID_PARAMETER, GetLastError());
|
||||
DeleteObject(pen);
|
||||
SetLastError(0xdeadbeef);
|
||||
|
@ -589,9 +570,130 @@ static void test_ps_userstyle(void)
|
|||
DeleteObject(pen);
|
||||
}
|
||||
|
||||
static void test_brush_pens(void)
|
||||
{
|
||||
char buffer[sizeof(EXTLOGPEN) + 15 * sizeof(DWORD)];
|
||||
EXTLOGPEN *elp = (EXTLOGPEN *)buffer;
|
||||
LOGBRUSH lb;
|
||||
HPEN pen = 0;
|
||||
DWORD size;
|
||||
HBITMAP bmp = CreateBitmap( 8, 8, 1, 1, NULL );
|
||||
BITMAPINFO *info;
|
||||
HGLOBAL hmem;
|
||||
|
||||
hmem = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof(*info) + 16 * 16 * 4 );
|
||||
info = GlobalLock( hmem );
|
||||
info->bmiHeader.biSize = sizeof(info->bmiHeader);
|
||||
info->bmiHeader.biWidth = 16;
|
||||
info->bmiHeader.biHeight = 16;
|
||||
info->bmiHeader.biPlanes = 1;
|
||||
info->bmiHeader.biBitCount = 32;
|
||||
info->bmiHeader.biCompression = BI_RGB;
|
||||
|
||||
for (lb.lbStyle = BS_SOLID; lb.lbStyle <= BS_MONOPATTERN + 1; lb.lbStyle++)
|
||||
{
|
||||
SetLastError( 0xdeadbeef );
|
||||
memset( buffer, 0xcc, sizeof(buffer) );
|
||||
trace( "testing brush style %u\n", lb.lbStyle );
|
||||
|
||||
switch (lb.lbStyle)
|
||||
{
|
||||
case BS_SOLID:
|
||||
case BS_HATCHED:
|
||||
lb.lbColor = RGB(12,34,56);
|
||||
lb.lbHatch = HS_CROSS;
|
||||
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
|
||||
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
|
||||
size = GetObject( pen, sizeof(buffer), elp );
|
||||
ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
|
||||
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
|
||||
ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle );
|
||||
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
|
||||
ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch );
|
||||
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
|
||||
break;
|
||||
|
||||
case BS_NULL:
|
||||
pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL );
|
||||
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
|
||||
size = GetObject( pen, sizeof(buffer), elp );
|
||||
ok( size == sizeof(LOGPEN), "wrong size %u\n", size );
|
||||
ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL,
|
||||
"wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle );
|
||||
ok( ((LOGPEN *)elp)->lopnColor == 0,
|
||||
"wrong color %x\n", ((LOGPEN *)elp)->lopnColor );
|
||||
break;
|
||||
|
||||
case BS_PATTERN:
|
||||
lb.lbColor = RGB(12,34,56);
|
||||
lb.lbHatch = (ULONG_PTR)bmp;
|
||||
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
|
||||
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
|
||||
size = GetObject( pen, sizeof(buffer), elp );
|
||||
ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
|
||||
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
|
||||
ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle );
|
||||
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
|
||||
ok( elp->elpHatch == (ULONG_PTR)bmp, "wrong hatch %lx/%p\n", elp->elpHatch, bmp );
|
||||
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
|
||||
break;
|
||||
|
||||
case BS_DIBPATTERN:
|
||||
case BS_DIBPATTERNPT:
|
||||
lb.lbColor = DIB_PAL_COLORS;
|
||||
lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info;
|
||||
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
|
||||
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
|
||||
size = GetObject( pen, sizeof(buffer), elp );
|
||||
ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
|
||||
ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle );
|
||||
ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle );
|
||||
ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor );
|
||||
ok( elp->elpHatch == lb.lbHatch || broken(elp->elpHatch != lb.lbHatch), /* <= w2k */
|
||||
"wrong hatch %lx/%lx\n", elp->elpHatch, lb.lbHatch );
|
||||
ok( elp->elpNumEntries == 0, "wrong entries %x\n", elp->elpNumEntries );
|
||||
break;
|
||||
|
||||
default:
|
||||
pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL );
|
||||
ok( !pen, "ExtCreatePen succeeded\n" );
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
|
||||
break;
|
||||
}
|
||||
|
||||
if (pen) DeleteObject( pen );
|
||||
else continue;
|
||||
|
||||
/* cosmetic pens require BS_SOLID */
|
||||
SetLastError( 0xdeadbeef );
|
||||
pen = ExtCreatePen( PS_DOT, 1, &lb, 0, NULL );
|
||||
if (lb.lbStyle == BS_SOLID)
|
||||
{
|
||||
ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() );
|
||||
size = GetObject( pen, sizeof(buffer), elp );
|
||||
ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size );
|
||||
ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle );
|
||||
ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle );
|
||||
ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor );
|
||||
ok( elp->elpHatch == HS_CROSS, "wrong hatch %lx\n", elp->elpHatch );
|
||||
DeleteObject( pen );
|
||||
}
|
||||
else
|
||||
{
|
||||
ok( !pen, "ExtCreatePen succeeded\n" );
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
|
||||
}
|
||||
}
|
||||
|
||||
GlobalUnlock( hmem );
|
||||
GlobalFree( hmem );
|
||||
DeleteObject( bmp );
|
||||
}
|
||||
|
||||
START_TEST(pen)
|
||||
{
|
||||
test_logpen();
|
||||
test_brush_pens();
|
||||
test_ps_alternate();
|
||||
test_ps_userstyle();
|
||||
}
|
||||
|
|
|
@ -22,3 +22,7 @@
|
|||
|
||||
/* @makedep: wine_test.ttf */
|
||||
wine_test.ttf RCDATA wine_test.ttf
|
||||
|
||||
|
||||
/* @makedep: vertical.ttf */
|
||||
vertical.ttf RCDATA vertical.ttf
|
||||
|
|
199
rostests/winetests/gdi32/vertical.sfd
Normal file
199
rostests/winetests/gdi32/vertical.sfd
Normal file
|
@ -0,0 +1,199 @@
|
|||
SplineFontDB: 3.0
|
||||
FontName: mplus-1p-regular
|
||||
FullName: M+ 1p regular
|
||||
FamilyName: M+ 1p regular
|
||||
Weight: Book
|
||||
Copyright: Copyright(c) 2011 M+ FONTS PROJECT
|
||||
Version: 1.044
|
||||
ItalicAngle: 0
|
||||
UnderlinePosition: -100
|
||||
UnderlineWidth: 50
|
||||
Ascent: 860
|
||||
Descent: 140
|
||||
sfntRevision: 0x00010b43
|
||||
LayerCount: 2
|
||||
Layer: 0 1 "Back" 1
|
||||
Layer: 1 1 "Fore" 0
|
||||
NeedsXUIDChange: 1
|
||||
XUID: [1021 311 1688707159 7641229]
|
||||
FSType: 0
|
||||
OS2Version: 1
|
||||
OS2_WeightWidthSlopeOnly: 0
|
||||
OS2_UseTypoMetrics: 1
|
||||
CreationTime: 1314095750
|
||||
ModificationTime: 1323339383
|
||||
PfmFamily: 17
|
||||
TTFWeight: 400
|
||||
TTFWidth: 5
|
||||
LineGap: 90
|
||||
VLineGap: 0
|
||||
Panose: 2 11 5 2 2 2 3 2 2 7
|
||||
OS2TypoAscent: 0
|
||||
OS2TypoAOffset: 1
|
||||
OS2TypoDescent: 0
|
||||
OS2TypoDOffset: 1
|
||||
OS2TypoLinegap: 90
|
||||
OS2WinAscent: 0
|
||||
OS2WinAOffset: 1
|
||||
OS2WinDescent: -23
|
||||
OS2WinDOffset: 1
|
||||
HheadAscent: 0
|
||||
HheadAOffset: 1
|
||||
HheadDescent: 23
|
||||
HheadDOffset: 1
|
||||
OS2SubXSize: 650
|
||||
OS2SubYSize: 700
|
||||
OS2SubXOff: 0
|
||||
OS2SubYOff: 140
|
||||
OS2SupXSize: 650
|
||||
OS2SupYSize: 700
|
||||
OS2SupXOff: 0
|
||||
OS2SupYOff: 480
|
||||
OS2StrikeYSize: 49
|
||||
OS2StrikeYPos: 258
|
||||
OS2FamilyClass: 2054
|
||||
OS2Vendor: 'M+ '
|
||||
OS2CodePages: 601201bf.dff70000
|
||||
OS2UnicodeRanges: e1000aff.4a47fdfb.02000012.00000000
|
||||
Lookup: 4 0 1 "kana semi-voiced lookup" {"kana semi-voiced table" } ['ccmp' ('kana' <'dflt' > ) 'liga' ('kana' <'dflt' > ) ]
|
||||
Lookup: 1 0 0 "gsubvert" {"j-vert" } ['vert' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 4 0 1 "ligalookup01" {"ligalookup01 subtable" } ['liga' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 4 0 0 "ccmplookup01" {"ccmplookup01 subtable" } ['ccmp' ('hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 4 0 0 "ccmplookup02" {"ccmplookup02 subtable" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 1 0 0 "SingleSubstitutionlookupDotless" {"SingleSubstitutionlookupDotless subtable" } []
|
||||
Lookup: 6 0 0 "ccmplookup03" {"ccmplookup03 contextual 0" "ccmplookup03 contextual 1" "ccmplookup03 contextual 2" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 258 0 0 "kerning pairs" {"kp" } ['kern' ('latn' <'dflt' > ) ]
|
||||
Lookup: 262 4 0 "mkmklookup1" {"mkmklookup1 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 260 4 0 "marklookup2" {"marklookup2 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 260 4 0 "marklookup1" {"marklookup1 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
Lookup: 262 4 0 "mkmklookup2" {"mkmklookup2 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
|
||||
DEI: 91125
|
||||
ChainSub2: coverage "ccmplookup03 contextual 2" 0 0 0 1
|
||||
1 0 3
|
||||
Coverage: 19 i j uni0249 uni03F3
|
||||
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
|
||||
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
|
||||
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
|
||||
1
|
||||
SeqLookup: 0 "SingleSubstitutionlookupDotless"
|
||||
EndFPST
|
||||
ChainSub2: coverage "ccmplookup03 contextual 1" 0 0 0 1
|
||||
1 0 2
|
||||
Coverage: 19 i j uni0249 uni03F3
|
||||
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
|
||||
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
|
||||
1
|
||||
SeqLookup: 0 "SingleSubstitutionlookupDotless"
|
||||
EndFPST
|
||||
ChainSub2: coverage "ccmplookup03 contextual 0" 0 0 0 1
|
||||
1 0 1
|
||||
Coverage: 19 i j uni0249 uni03F3
|
||||
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
|
||||
1
|
||||
SeqLookup: 0 "SingleSubstitutionlookupDotless"
|
||||
EndFPST
|
||||
MacFeat: 0 0 0
|
||||
MacName: 0 0 24 "All Typographic Features"
|
||||
MacName: 0 1 24 "Fonctions typographiques"
|
||||
MacName: 0 2 33 "Alle typografischen M\232glichkeiten"
|
||||
MacName: 0 3 21 "Funzioni Tipografiche"
|
||||
MacName: 0 4 28 "Alle typografische kenmerken"
|
||||
MacSetting: 0
|
||||
MacName: 0 0 17 "All Type Features"
|
||||
MacName: 0 1 31 "Toutes fonctions typographiques"
|
||||
MacName: 0 2 23 "Alle Auszeichnungsarten"
|
||||
MacName: 0 3 17 "Tutte le Funzioni"
|
||||
MacName: 0 4 18 "Alle typekenmerken"
|
||||
MacFeat: 1 0 0
|
||||
MacName: 0 0 9 "Ligatures"
|
||||
MacName: 0 1 9 "Ligatures"
|
||||
MacName: 0 2 9 "Ligaturen"
|
||||
MacName: 0 3 8 "Legature"
|
||||
MacName: 0 4 9 "Ligaturen"
|
||||
MacSetting: 2
|
||||
MacName: 0 0 16 "Common Ligatures"
|
||||
MacName: 0 1 18 "Ligatures Usuelles"
|
||||
MacName: 0 2 17 "Normale Ligaturen"
|
||||
MacName: 0 3 19 "Legature pi\235 Comuni"
|
||||
MacName: 0 4 28 "Gemeenschappelijke Ligaturen"
|
||||
EndMacFeatures
|
||||
TtTable: prep
|
||||
PUSHW_2
|
||||
511
|
||||
0
|
||||
SCANTYPE
|
||||
SCANCTRL
|
||||
EndTTInstrs
|
||||
ShortTable: maxp 16
|
||||
1
|
||||
0
|
||||
6439
|
||||
216
|
||||
18
|
||||
0
|
||||
0
|
||||
2
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
4
|
||||
0
|
||||
0
|
||||
0
|
||||
EndShort
|
||||
LangName: 1033 "" "@WineTestVertical" "Regular" "FontForge 2.0 : M+- 1p regular : 2-11-2011" "" "" "" "" "" "" "" "http://mplus-fonts.sourceforge.jp" "" "" "" "" "M+- 1p" "regular"
|
||||
GaspTable: 1 65535 2
|
||||
Encoding: UnicodeFull
|
||||
UnicodeInterp: none
|
||||
NameList: Adobe Glyph List
|
||||
DisplaySize: -24
|
||||
AntiAlias: 1
|
||||
FitToEm: 1
|
||||
AnchorClass2: "TopMark" "mkmklookup1 subtable" "Bottom" "marklookup2 subtable" "Top" "marklookup1 subtable" "BottomMark" "mkmklookup2 subtable"
|
||||
BeginChars: 1114185 2
|
||||
|
||||
StartChar: twodotenleader
|
||||
Encoding: 8229 8229 0
|
||||
Width: 1000
|
||||
GlyphClass: 2
|
||||
Flags: W
|
||||
LayerCount: 2
|
||||
Fore
|
||||
SplineSet
|
||||
703 290 m 1,0,-1
|
||||
703 430 l 1,1,-1
|
||||
797 430 l 1,2,-1
|
||||
797 290 l 1,3,-1
|
||||
703 290 l 1,0,-1
|
||||
203 290 m 1,4,-1
|
||||
203 430 l 1,5,-1
|
||||
297 430 l 1,6,-1
|
||||
297 290 l 1,7,-1
|
||||
203 290 l 1,4,-1
|
||||
EndSplineSet
|
||||
Substitution2: "j-vert" twodotenleader.vert
|
||||
EndChar
|
||||
|
||||
StartChar: twodotenleader.vert
|
||||
Encoding: 1114131 -1 1
|
||||
Width: 1000
|
||||
GlyphClass: 2
|
||||
Flags: W
|
||||
LayerCount: 2
|
||||
Fore
|
||||
SplineSet
|
||||
453 540 m 1,0,-1
|
||||
453 680 l 1,1,-1
|
||||
547 680 l 1,2,-1
|
||||
547 540 l 1,3,-1
|
||||
453 540 l 1,0,-1
|
||||
453 40 m 1,4,-1
|
||||
453 180 l 1,5,-1
|
||||
547 180 l 1,6,-1
|
||||
547 40 l 1,7,-1
|
||||
453 40 l 1,4,-1
|
||||
EndSplineSet
|
||||
EndChar
|
||||
EndChars
|
||||
EndSplineFont
|
BIN
rostests/winetests/gdi32/vertical.ttf
Normal file
BIN
rostests/winetests/gdi32/vertical.ttf
Normal file
Binary file not shown.
Loading…
Reference in a new issue