38#define match_off_by_1(a, b, exact) match_off_by_n((a), (b), (exact) ? 0 : 1)
39#define near_match(a, b) match_off_by_n((a), (b), 6)
40#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
51static const MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} };
55#define GET_BE_WORD(x) (x)
56#define GET_BE_DWORD(x) (x)
58#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
59#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x)));
62#define MS_MAKE_TAG(ch0, ch1, ch2, ch3) \
63 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
64 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
65#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2')
66#define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p')
67#define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e')
126 if (!rsrc)
return NULL;
129 if (!rsrc_data)
return NULL;
132 if (!*rsrc_size)
return NULL;
161 if (!rsrc_data)
return FALSE;
195 ok(
hfont != 0,
"%s: CreateFontIndirect failed\n",
test);
206 memset(&lf, 0,
sizeof lf);
219 memset(&lf,
'A',
sizeof(lf));
221 ok(
hfont != 0,
"CreateFontIndirectA with strange LOGFONT failed\n");
266 LONG lfWidth,
const char *test_str,
268 const SIZE *size_orig,
INT width_of_A_orig,
290 ok(
ret ==
sizeof(otm)/2,
"expected sizeof(otm)/2, got %u\n",
ret);
292 memset(&otm, 0x1,
sizeof(otm));
295 ok(
ret ==
sizeof(otm),
"expected sizeof(otm), got %u\n",
ret);
299 ok(
ret,
"GetTextMetricsA failed\n");
303 ok(0,
"tm != otm\n");
314 ok(otm.
otmDescent < 0,
"otm.otmDescent should be < 0\n");
316 ok(
tm.tmDescent > 0,
"tm.tmDescent should be > 0\n");
324 ok(
ret,
"GetTextMetricsA failed\n");
329 ok(
cx == scale_x &&
cy == scale_y,
"height %ld: expected scale_x %d, scale_y %d, got cx %d, cy %d\n",
330 lfHeight, scale_x, scale_y,
cx,
cy);
331 ok(
tm.tmHeight == tm_orig->
tmHeight * scale_y,
"height %ld != %ld\n",
tm.tmHeight, tm_orig->
tmHeight * scale_y);
332 ok(
tm.tmAscent == tm_orig->
tmAscent * scale_y,
"ascent %ld != %ld\n",
tm.tmAscent, tm_orig->
tmAscent * scale_y);
333 ok(
tm.tmDescent == tm_orig->
tmDescent * scale_y,
"descent %ld != %ld\n",
tm.tmDescent, tm_orig->
tmDescent * scale_y);
349 ok(
size.cy == size_orig->
cy * scale_y,
"cy %ld != %ld\n",
size.cy, size_orig->
cy * scale_y);
353 ok(
near_match(width_of_A, width_of_A_orig * scale_x),
"width A %d != %d\n", width_of_A, width_of_A_orig * scale_x);
360 static const char test_str[11] =
"Test String";
363 HFONT
hfont, old_hfont;
375 skip(
"no bitmap fonts were found, skipping the test\n");
396 test_font_metrics(
"bitmap",
hdc,
hfont, 0, 4, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 1, 1);
404 for (
i = 1;
i <= height_orig * 6;
i++)
410 scale = (
i + height_orig - 1) / height_orig;
411 nearest_height =
scale * height_orig;
413 if (
scale > 2 && nearest_height -
i > height_orig / 4)
scale--;
416 else if(
scale == 2 && nearest_height -
i == (height_orig / 4))
continue;
417 else if(
scale == 2 && nearest_height -
i > (height_orig / 4 - 1))
scale--;
420 test_font_metrics(
NULL,
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 1,
scale);
427 bitmap_lf.
lfHeight = height_orig * 2;
431 test_font_metrics(
"bitmap 3x2",
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 2);
436 bitmap_lf.
lfHeight = height_orig * 3;
440 test_font_metrics(
"bitmap 3x3",
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 3);
450 static const char test_str[11] =
"Test String";
453 HFONT
hfont, old_hfont, old_hfont_2;
456 INT width_orig, height_orig, lfWidth;
459 MAT2 mat2 = { {0x8000,0}, {0,0}, {0,0}, {0x8000,0} };
465 skip(
"Arial is not installed\n");
471 memset(&lf, 0,
sizeof(lf));
481 test_font_metrics(
"outline",
hdc,
hfont, lf.
lfHeight, otm.
otmTextMetrics.
tmAveCharWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
505 test_font_metrics(
"outline 3x2",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 3, 2);
514 test_font_metrics(
"outline 3x3",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 3, 3);
523 test_font_metrics(
"outline 1x1",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
532 test_font_metrics(
"outline 1x0",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
535 memset(&gm, 0,
sizeof(gm));
542 memset(&gm, 0,
sizeof(gm));
555 test_font_metrics(
"dc2.base", hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
560 test_font_metrics(
"dc2.aniso", hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
568 test_font_metrics(
"xscaling",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 2, 1);
570 test_font_metrics(
"dc2.xscaling", hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
577 test_font_metrics(
"yscaling",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 2, 1);
579 test_font_metrics(
"dc2.yscaling", hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
585 test_font_metrics(
"dc2.text", hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
595 skip(
"GM_ADVANCED is not supported on this platform\n");
610 test_font_metrics(
"xform",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
613 memset(&gm, 0,
sizeof(gm));
617 pt.x = width_orig;
pt.y = 0;
623 memset(&gm, 0,
sizeof(gm));
627 pt.x = width_orig;
pt.y = 0;
637 test_font_metrics(
"lometric",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
640 memset(&gm, 0,
sizeof(gm));
644 pt.x = width_orig;
pt.y = 0;
649 memset(&gm, 0,
sizeof(gm));
653 pt.x = width_orig;
pt.y = 0;
662 test_font_metrics(
"text",
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
665 memset(&gm, 0,
sizeof(gm));
669 pt.x = width_orig;
pt.y = 0;
675 memset(&gm, 0,
sizeof(gm));
679 pt.x = width_orig;
pt.y = 0;
707#define FH_SCALE 0x80000000
715 int ave_char_width, max_char_width,
dpi;
716 BYTE first_char, last_char, def_char, break_char;
718 const WORD *skip_lang_id;
722 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl, 13 },
723 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
724 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl, 13 },
725 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
726 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl, 13 },
727 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
728 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl, 13 },
729 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
730 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl, 16 },
731 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
733 {
"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 },
734 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 6, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
735 {
"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 },
736 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 8, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
737 {
"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 },
738 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 10, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
739 {
"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 },
740 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 14, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
741 {
"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 },
742 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
744 {
"MS Sans Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
745 {
"MS Sans Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
746 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
747 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
748 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
749 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN2 },
750 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
751 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 19, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
752 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 24, 96, 0x20, 0xff, 0x81, 0x40,
FS_LATIN2 },
753 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 20, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
754 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
755 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN2 },
756 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 25, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
757 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
758 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x40,
FS_LATIN2 },
759 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
761 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
762 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
763 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
764 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 17, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
765 {
"MS Sans Serif",
FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
766 {
"MS Sans Serif",
FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
767 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
768 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
769 {
"MS Sans Serif",
FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
770 {
"MS Sans Serif",
FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
771 {
"MS Sans Serif",
FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
772 {
"MS Sans Serif",
FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
774 {
"MS Serif",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
775 {
"MS Serif",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
776 {
"MS Serif",
FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
777 {
"MS Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
778 {
"MS Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
779 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
780 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 16, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
781 {
"MS Serif",
FW_NORMAL, 19, 15, 4, 3, 0, 8, 18, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
782 {
"MS Serif",
FW_NORMAL, 19, 15, 4, 3, 0, 8, 19, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
783 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 17, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
784 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 22, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
785 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 23, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
786 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 23, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
787 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 26, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
788 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 27, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
789 {
"MS Serif",
FW_NORMAL, 35, 27, 8, 3, 0, 16, 33, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
790 {
"MS Serif",
FW_NORMAL, 35, 27, 8, 3, 0, 16, 34, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
792 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
793 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 13, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
794 {
"MS Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
795 {
"MS Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 15, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
796 {
"MS Serif",
FW_NORMAL, 23, 18, 5, 3, 0, 10, 21, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
797 {
"MS Serif",
FW_NORMAL, 23, 18, 5, 3, 0, 10, 19, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
798 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 4, 0, 12, 23, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
799 {
"MS Serif",
FW_MEDIUM, 27, 22, 5, 2, 0, 12, 30, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
800 {
"MS Serif",
FW_NORMAL, 33, 26, 7, 3, 0, 14, 30, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
801 {
"MS Serif",
FW_MEDIUM, 32, 25, 7, 2, 0, 14, 32, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
802 {
"MS Serif",
FW_NORMAL, 43, 34, 9, 3, 0, 19, 39, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
804 {
"Courier",
FW_NORMAL, 13, 11, 2, 0, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
805 {
"Courier",
FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
806 {
"Courier",
FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
808 {
"Courier",
FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
809 {
"Courier",
FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
810 {
"Courier",
FW_NORMAL, 25, 20, 5, 0, 0, 15, 15, 120, 0x20, 0xff, 0x40, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
812 {
"System",
FW_BOLD, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
813 {
"System",
FW_BOLD, 16, 13, 3, 3, 0, 7, 15, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
814 {
"System",
FW_NORMAL, 18, 16, 2, 0, 2, 8, 16, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
816 {
"System",
FW_BOLD, 20, 16, 4, 4, 0, 9, 14, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
817 {
"System",
FW_BOLD, 20, 16, 4, 4, 0, 9, 17, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
819 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
820 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
821 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 2, 4, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
822 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
823 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 1, 0, 2, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
824 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 0, 0, 3, 6, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
825 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
826 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
827 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
828 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 0, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
829 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
830 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
831 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
832 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 0, 0, 5, 10, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
833 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl},
834 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
835 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 9, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
836 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
837 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC, skip_rtl},
838 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 2, 0, 4, 10, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
839 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
841 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
842 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
843 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 5, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
844 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
845 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
846 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
847 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 9, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
848 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
849 {
"Small Fonts",
FW_NORMAL, 12, 10, 2, 2, 0, 5, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
850 {
"Small Fonts",
FW_NORMAL, 12, 10, 2, 2, 0, 6, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
851 {
"Small Fonts",
FW_NORMAL, 13, 11, 2, 2, 0, 6, 12, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
852 {
"Small Fonts",
FW_NORMAL, 13, 11, 2, 2, 0, 6, 11, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
854 {
"Fixedsys",
FW_NORMAL, 15, 12, 3, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
855 {
"Fixedsys",
FW_NORMAL, 16, 12, 4, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
856 {
"FixedSys",
FW_NORMAL, 18, 16, 2, 0, 0, 8, 16, 96, 0x20, 0xff, 0xa0, 0x20,
FS_JISJAPAN },
858 {
"Fixedsys",
FW_NORMAL, 20, 16, 4, 2, 0, 10, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC }
862 static const int font_log_pixels[] = { 96, 120 };
865 HFONT
hfont, old_hfont;
867 INT ret,
i, expected_cs, screen_log_pixels, diff, font_res;
876 skip(
"TranslateCharsetInfo failed for code page %d\n", expected_cs);
880 trace(
"ACP %d -> charset %d\n",
GetACP(), expected_cs);
883 ok(
hdc !=
NULL,
"failed to create hdc\n");
893 int new_diff =
abs(font_log_pixels[
i] - screen_log_pixels);
897 font_res = font_log_pixels[
i];
900 trace(
"best font resolution is %d\n", font_res);
906 memset(&lf, 0,
sizeof(lf));
912 for(bit = 0; bit < 32; bit++)
920 if((
fd[
i].ansi_bitfield &
fs[0]) == 0)
continue;
926 ok(
ret,
"scaled font height %d should not be enumerated\n",
height);
929 if (font_res ==
fd[
i].
dpi && lf.lfCharSet == expected_cs)
932 ok(!
ret,
"%s height %ld charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet,
fd[
i].dpi);
945 if (
strcmp(face_name,
fd[
i].face_name) != 0)
948 ok(
ret != expected_cs,
"font charset %d should not be %d\n",
ret, expected_cs);
954 memset(&gm, 0,
sizeof(gm));
958 ok(
ret ==
GDI_ERROR,
"GetGlyphOutline should fail for a bitmap font\n");
970 ok(
ret == expected_cs,
"got charset %d, expected %d\n",
ret, expected_cs);
972 if(
fd[
i].
dpi ==
tm.tmDigitizedAspectX)
975 if (
fd[
i].skip_lang_id)
979 while(!skipme &&
fd[
i].skip_lang_id[
si])
985 ok(
tm.tmWeight ==
fd[
i].weight,
"%s(%d): tm.tmWeight %ld != %d\n",
fd[
i].face_name,
height,
tm.tmWeight,
fd[
i].weight);
987 ok(
tm.tmHeight ==
fd[
i].scaled_height,
"%s(%d): tm.tmHeight %ld != %d\n",
fd[
i].face_name,
height,
tm.tmHeight,
fd[
i].scaled_height);
989 ok(
tm.tmHeight ==
fd[
i].height,
"%s(%d): tm.tmHeight %ld != %d\n",
fd[
i].face_name,
fd[
i].height,
tm.tmHeight,
fd[
i].height);
990 ok(
tm.tmAscent ==
fd[
i].ascent,
"%s(%d): tm.tmAscent %ld != %d\n",
fd[
i].face_name,
height,
tm.tmAscent,
fd[
i].ascent);
991 ok(
tm.tmDescent ==
fd[
i].descent,
"%s(%d): tm.tmDescent %ld != %d\n",
fd[
i].face_name,
height,
tm.tmDescent,
fd[
i].descent);
992 ok(
tm.tmInternalLeading ==
fd[
i].int_leading,
"%s(%d): tm.tmInternalLeading %ld != %d\n",
fd[
i].face_name,
height,
tm.tmInternalLeading,
fd[
i].int_leading);
993 ok(
tm.tmExternalLeading ==
fd[
i].ext_leading,
"%s(%d): tm.tmExternalLeading %ld != %d\n",
fd[
i].face_name,
height,
tm.tmExternalLeading,
fd[
i].ext_leading);
994 ok(
tm.tmAveCharWidth ==
fd[
i].ave_char_width,
"%s(%d): tm.tmAveCharWidth %ld != %d\n",
fd[
i].face_name,
height,
tm.tmAveCharWidth,
fd[
i].ave_char_width);
995 ok(
tm.tmFirstChar ==
fd[
i].first_char,
"%s(%d): tm.tmFirstChar = %02x\n",
fd[
i].face_name,
height,
tm.tmFirstChar);
996 ok(
tm.tmLastChar ==
fd[
i].last_char,
"%s(%d): tm.tmLastChar = %02x\n",
fd[
i].face_name,
height,
tm.tmLastChar);
999 if (
tm.tmCharSet == lf.lfCharSet)
1000 ok(
tm.tmDefaultChar ==
fd[
i].def_char,
"%s(%d): tm.tmDefaultChar = %02x\n",
fd[
i].face_name,
height,
tm.tmDefaultChar);
1001 ok(
tm.tmBreakChar ==
fd[
i].break_char,
"%s(%d): tm.tmBreakChar = %02x\n",
fd[
i].face_name,
height,
tm.tmBreakChar);
1002 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);
1006 if ((
strcmp(lf.lfFaceName,
"System") || lf.lfCharSet !=
ANSI_CHARSET) &&
tm.tmDigitizedAspectX == 96)
1007 ok(
tm.tmMaxCharWidth ==
fd[
i].max_char_width,
"%s(%d): tm.tmMaxCharWidth %ld != %d\n",
fd[
i].face_name,
height,
tm.tmMaxCharWidth,
fd[
i].max_char_width);
1010 skip(
"Skipping font metrics test for system langid 0x%x\n",
1028 static const char szAlphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
1030 if (!pGdiGetCharDimensions)
1032 win_skip(
"GdiGetCharDimensions not available on this platform\n");
1039 avgwidth = ((
size.cx / 26) + 1) / 2;
1042 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth,
ret);
1043 ok(
height ==
tm.tmHeight,
"GdiGetCharDimensions should have set height to %ld instead of %ld\n",
tm.tmHeight,
height);
1046 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth,
ret);
1049 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth,
ret);
1053 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %ld instead of %ld\n", avgwidth,
ret);
1054 ok(
height ==
size.cy,
"GdiGetCharDimensions should have set height to %ld instead of %ld\n",
size.cy,
height);
1103 ok(
ret,
"%s: GetCharABCWidthsFloatW should have succeeded\n",
description);
1134 {0xffffff, 0xffffff},
1135 {0x1000000, 0x1000000},
1136 {0xffffff, 0x1000000},
1137 {0xffffffff, 0xffffffff},
1149 {
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1151 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1153 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1155 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1157 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}}
1161 memset(&lf, 0,
sizeof(lf));
1170 ok(nb == 1,
"GetGlyphIndicesW should have returned 1\n");
1173 ok(!
ret,
"GetCharABCWidthsI should have failed\n");
1176 ok(!
ret,
"GetCharABCWidthsI should have failed\n");
1179 ok(
ret,
"GetCharABCWidthsI should have succeeded\n");
1182 ok(!
ret,
"GetCharABCWidthsW should have failed\n");
1185 ok(!
ret,
"GetCharABCWidthsW should have failed\n");
1188 ok(
ret ||
broken(!
ret) ,
"GetCharABCWidthsW should have succeeded\n");
1191 ok(!
ret,
"GetCharABCWidthsFloatW should have failed\n");
1194 ok(!
ret,
"GetCharABCWidthsFloatW should have failed\n");
1197 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1213 skip(
"TrueType font for charset %u is not installed\n",
c[
i].
cs);
1222 "GetCharABCWidthsA and GetCharABCWidthsW should return same widths. charset = %u\n",
c[
i].
cs);
1226 ok(
ret,
"GetCharABCWidthsA should have succeeded\n");
1227 memset(full, 0xcc,
sizeof full);
1229 ok(
ret,
"GetCharABCWidthsA should have succeeded\n");
1231 "GetCharABCWidthsA info should match. codepage = %u\n",
c[
i].
cs);
1235 memset(full, 0xdd,
sizeof full);
1237 ok(
ret ==
c[
i].
r[
j],
"GetCharABCWidthsA %x - %x should have %s\n",
1244 "GetCharABCWidthsA %x should match. codepage = %u\n",
1253 memset(&lf, 0,
sizeof(lf));
1261 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1262 ok(abcf[0].abcfB == 1.0,
"got %f\n", abcf[0].abcfB);
1264 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1265 ok(abcw[0].abcB == 1,
"got %u\n", abcw[0].abcB);
1269 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1277 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1281 "got %d, expected %d (A)\n", abc[0].abcA, abcw[0].abcA);
1283 "got %d, expected %d (B)\n", abc[0].abcB, abcw[0].abcB);
1285 "got %d, expected %d (C)\n", abc[0].abcC, abcw[0].abcC);
1291 for (
i = 1;
i <= 2;
i++)
1296 memset(&lf, 0,
sizeof(lf));
1314 for (
j = 1;
j <= 80;
j++)
1323 ok(nb,
"GetGlyphOutlineA should have succeeded at width %d\n",
i);
1326 ok(
ret,
"GetCharABCWidthsA should have succeeded at width %d\n",
i);
1329 "abcA(%d) and gmptGlyphOrigin.x(%ld) values are different at width %d\n",
1332 "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n",
1340 memset(&lf, 0,
sizeof(lf));
1351 ok(nb == 1,
"GetGlyphIndicesW should have returned 1\n");
1354 ok(
ret,
"GetCharABCWidthsI should have succeeded\n");
1356 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1358 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1401 static const WCHAR wt[] =
L"One\ntwo 3";
1403 INT i,
len, fit1, fit2, extents2[3];
1412 memset(&lf, 0,
sizeof(lf));
1422 ok(sz.
cy ==
tm.tmHeight,
"cy %ld tmHeight %ld\n", sz.
cy,
tm.tmHeight);
1424 memset(&sz, 0xcc,
sizeof(sz));
1427 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %ld, cy %ld\n", sz.
cx, sz.
cy);
1429 memset(&sz, 0xcc,
sizeof(sz));
1432 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %ld, cy %ld\n", sz.
cx, sz.
cy);
1434 memset(&sz, 0xcc,
sizeof(sz));
1437 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %ld, cy %ld\n", sz.
cx, sz.
cy);
1439 memset(&sz, 0xcc,
sizeof(sz));
1442 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %ld, cy %ld\n", sz.
cx, sz.
cy);
1445 extents =
calloc(
len,
sizeof extents[0]);
1451 "cy from GetTextExtentExPointW (%ld) and GetTextExtentPointW (%ld) differ\n", sz1.
cy, sz2.
cy);
1457 for (
i = 1;
i <
len; ++
i)
1458 ok(extents[
i-1] <= extents[
i],
1459 "GetTextExtentExPointW generated a non-increasing sequence of partial extents (at position %d)\n",
1461 ok(extents[
len-1] == sz1.
cx,
"GetTextExtentExPointW extents and size don't match\n");
1462 ok(0 <= fit1 && fit1 <=
len,
"GetTextExtentExPointW generated illegal value %d for fit\n", fit1);
1463 ok(0 < fit1,
"GetTextExtentExPointW says we can't even fit one letter in 32767 logical units\n");
1465 ok(sz1.
cx == sz2.
cx && sz1.
cy == sz2.
cy,
"GetTextExtentExPointW returned different sizes for the same string\n");
1466 ok(fit2 == 3,
"GetTextExtentExPointW extents isn't consistent with fit\n");
1468 ok(fit2 == 2,
"GetTextExtentExPointW extents isn't consistent with fit\n");
1470 ok(extents[0] == extents[2] && extents[1] == extents[3],
1471 "GetTextExtentExPointW with lpnFit == NULL returns incorrect results\n");
1474 "GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results\n");
1488 ok(fit1 == 0,
"fit = %d\n", fit1);
1491 ok(fit2 == 0,
"fit = %d\n", fit2);
1498 ok(fit1 == 3,
"fit = %d\n", fit1);
1501 ok(fit2 == 3,
"fit = %d\n", fit2);
1508 ok(fit1 == -215,
"fit = %d\n", fit1);
1511 ok(fit2 == 3,
"fit = %d\n", fit2);
1524 ok(sz.
cx == extents[2],
"got %ld vs %d\n", sz.
cx, extents[2]);
1528 ok(fit1 == 2,
"got %d\n", fit1);
1529 ok(sz2.
cx == sz.
cx,
"got %ld vs %ld\n", sz2.
cx, sz.
cx);
1530 for(
i = 0;
i < 2;
i++)
1531 ok(extents2[
i] == extents[
i],
"%d: %d, %d\n",
i, extents2[
i], extents[
i]);
1550 if (font_name[1] ==
':')
1586 WCHAR c[] = { 0x25bc , 0x212a };
1597 memset(&lf, 0,
sizeof(lf));
1603 ok(
hfont != 0,
"CreateFontIndirect failed\n");
1610 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount);
1611 ok((glyphs[4] == 0x001f || glyphs[4] == 0xffff ),
"GetGlyphIndicesW should have returned a nonexistent char not %04x\n", glyphs[4]);
1614 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount);
1616 "GetGlyphIndicesW should have returned a %04x not %04x\n", textm.
tmDefaultChar, glyphs[4]);
1620 skip(
"GetGlyphIndices System font tests only for ANSI_CHARSET\n");
1624 memset(&lf, 0,
sizeof(lf));
1629 ok(
hfont != 0,
"CreateFontIndirect failed\n");
1633 glyphs[0] = glyphs[1] = 0;
1636 ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff ,
"got %#x\n", glyphs[0]);
1637 ok(glyphs[1] == 0x001f || glyphs[1] == 0xffff ,
"got %#x\n", glyphs[1]);
1639 glyphs[0] = glyphs[1] = 0;
1642 ok(glyphs[0] == textm.
tmDefaultChar || glyphs[0] == 0x20 ,
"got %#x\n", glyphs[0]);
1643 ok(glyphs[1] == textm.
tmDefaultChar || glyphs[1] == 0x20 ,
"got %#x\n", glyphs[1]);
1649 skip(
"Tahoma is not installed so skipping this test\n");
1653 memset(&lf, 0,
sizeof(lf));
1662 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount);
1663 ok(glyphs[4] == 0xffff,
"GetGlyphIndicesW should have returned 0xffff char not %04x\n", glyphs[4]);
1667 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount);
1668 ok(glyphs[0] == 0,
"GetGlyphIndicesW for tmDefaultChar should be 0 not %04x\n", glyphs[0]);
1669 ok(glyphs[4] == 0,
"GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]);
1673 ok(
ret,
"Failed to create test font file.\n");
1675 ok(
font !=
NULL,
"Failed to map font file.\n");
1679 ok(num_fonts == 1,
"Unexpected number of fonts %lu.\n", num_fonts);
1681 memset(&lf, 0,
sizeof(lf));
1690 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %ld\n", charcount);
1691 ok(glyphs[0] == 0,
"GetGlyphIndicesW for tmDefaultChar should be 0 not %04x\n", glyphs[0]);
1692 ok(glyphs[4] == 0,
"GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]);
1706 static const struct kerning_data
1711 LONG tmHeight, tmAscent, tmDescent;
1716 UINT otmsCapEmHeight;
1721 UINT otmusMinimumPPEM;
1723 DWORD total_kern_pairs;
1727 {
"Arial", 12, 12, 9, 3,
1728 2048, 7, -2, 1, 5, 2, 8, -2, 0, 9,
1731 {
' ',
'A',-1},{
' ',
'T',0},{
' ',
'Y',0},{
'1',
'1',-1},
1732 {
'A',
' ',-1},{
'A',
'T',-1},{
'A',
'V',-1},{
'A',
'W',0},
1733 {
'A',
'Y',-1},{
'A',
'v',0},{
'A',
'w',0},{
'A',
'y',0},
1734 {
'F',
',',-1},{
'F',
'.',-1},{
'F',
'A',-1},{
'L',
' ',0},
1735 {
'L',
'T',-1},{
'L',
'V',-1},{
'L',
'W',-1},{
'L',
'Y',-1},
1736 {915,912,+1},{915,913,-1},{910,912,+1},{910,913,-1},
1737 {933,970,+1},{933,972,-1}
1740 {
"Arial", -34, 39, 32, 7,
1741 2048, 25, -7, 5, 17, 9, 31, -7, 1, 9,
1744 {
' ',
'A',-2},{
' ',
'T',-1},{
' ',
'Y',-1},{
'1',
'1',-3},
1745 {
'A',
' ',-2},{
'A',
'T',-3},{
'A',
'V',-3},{
'A',
'W',-1},
1746 {
'A',
'Y',-3},{
'A',
'v',-1},{
'A',
'w',-1},{
'A',
'y',-1},
1747 {
'F',
',',-4},{
'F',
'.',-4},{
'F',
'A',-2},{
'L',
' ',-1},
1748 {
'L',
'T',-3},{
'L',
'V',-3},{
'L',
'W',-3},{
'L',
'Y',-3},
1749 {915,912,+3},{915,913,-3},{910,912,+3},{910,913,-3},
1750 {933,970,+2},{933,972,-3}
1753 {
"Arial", 120, 120, 97, 23,
1754 2048, 79, -23, 16, 54, 27, 98, -23, 4, 9,
1757 {
' ',
'A',-6},{
' ',
'T',-2},{
' ',
'Y',-2},{
'1',
'1',-8},
1758 {
'A',
' ',-6},{
'A',
'T',-8},{
'A',
'V',-8},{
'A',
'W',-4},
1759 {
'A',
'Y',-8},{
'A',
'v',-2},{
'A',
'w',-2},{
'A',
'y',-2},
1760 {
'F',
',',-12},{
'F',
'.',-12},{
'F',
'A',-6},{
'L',
' ',-4},
1761 {
'L',
'T',-8},{
'L',
'V',-8},{
'L',
'W',-8},{
'L',
'Y',-8},
1762 {915,912,+9},{915,913,-10},{910,912,+9},{910,913,-8},
1763 {933,970,+6},{933,972,-10}
1767 {
"Arial", 1024 , 1024, 830, 194,
1768 2048, 668, -193, 137, 459, 229, 830, -194, 30, 9,
1771 {
' ',
'A',-51},{
' ',
'T',-17},{
' ',
'Y',-17},{
'1',
'1',-68},
1772 {
'A',
' ',-51},{
'A',
'T',-68},{
'A',
'V',-68},{
'A',
'W',-34},
1773 {
'A',
'Y',-68},{
'A',
'v',-17},{
'A',
'w',-17},{
'A',
'y',-17},
1774 {
'F',
',',-102},{
'F',
'.',-102},{
'F',
'A',-51},{
'L',
' ',-34},
1775 {
'L',
'T',-68},{
'L',
'V',-68},{
'L',
'W',-68},{
'L',
'Y',-68},
1776 {915,912,+73},{915,913,-84},{910,912,+76},{910,913,-68},
1777 {933,970,+54},{933,972,-83}
1783 HFONT
hfont, hfont_old;
1797 skip(
"%s is not installed so skipping this test\n", kd[
i].face_name);
1801 memset(&lf, 0,
sizeof(lf));
1805 ok(
hfont !=
NULL,
"failed to create a font, name %s\n", kd[
i].face_name);
1811 ok(uiRet ==
sizeof(otm),
"GetOutlineTextMetricsW error %ld\n",
GetLastError());
1820 ok(kd[
i].otmEMSquare == otm.
otmEMSquare,
"expected %u, got %u\n",
1822 ok(kd[
i].otmAscent == otm.
otmAscent,
"expected %d, got %d\n",
1824 ok(kd[
i].otmDescent == otm.
otmDescent,
"expected %d, got %d\n",
1826 ok(kd[
i].otmLineGap == otm.
otmLineGap,
"expected %u, got %u\n",
1836 ok(kd[
i].otmsXHeight == otm.
otmsXHeight,
"expected %u, got %u\n",
1845 kern_pair =
malloc(total_kern_pairs *
sizeof(*kern_pair));
1853 "got error %lu, expected ERROR_INVALID_PARAMETER\n",
GetLastError());
1854 ok(
ret == 0,
"got %lu, expected 0\n",
ret);
1857 ok(
ret == total_kern_pairs,
"got %lu, expected %lu\n",
ret, total_kern_pairs);
1860 ok(
ret == total_kern_pairs/2,
"got %lu, expected %lu\n",
ret, total_kern_pairs/2);
1863 ok(
ret == total_kern_pairs,
"got %lu, expected %lu\n",
ret, total_kern_pairs);
1867 for (
n = 0;
n <
ret;
n++)
1871 for (
j = 0;
j < kd[
i].total_kern_pairs;
j++)
1873 if (kern_pair[
n].wFirst == kd[
i].kern_pair[
j].wFirst &&
1874 kern_pair[
n].wSecond == kd[
i].kern_pair[
j].wSecond)
1876 ok(kern_pair[
n].iKernAmount == kd[
i].kern_pair[
j].iKernAmount,
1877 "pair %d:%d got %d, expected %d\n",
1878 kern_pair[
n].wFirst, kern_pair[
n].wSecond,
1879 kern_pair[
n].iKernAmount, kd[
i].kern_pair[
j].iKernAmount);
1885 ok(
matches == kd[
i].total_kern_pairs,
"got matches %lu, expected %lu\n",
1908 HFONT
hfont, old_hfont;
1912 for (
i = 0;
fd[
i].face_name[0];
i++)
1916 skip(
"%s is not installed\n",
fd[
i].face_name);
1920 memset(&lf, 0,
sizeof(lf));
1926 ok(
hfont !=
NULL,
"failed to create a font, name %s\n",
fd[
i].face_name);
1931 if(
fd[
i].
dpi ==
tm.tmDigitizedAspectX)
1933 ok(
tm.tmWeight ==
fd[
i].weight,
"%s(%d): tm.tmWeight %ld != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmWeight,
fd[
i].weight);
1937 ok(
match_off_by_1(
tm.tmInternalLeading,
fd[
i].int_leading,
fd[
i].exact),
"%s(%d): tm.tmInternalLeading %ld != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmInternalLeading,
fd[
i].int_leading);
1938 ok(
tm.tmExternalLeading ==
fd[
i].ext_leading,
"%s(%d): tm.tmExternalLeading %ld != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmExternalLeading,
fd[
i].ext_leading);
1953 for (
i = 0;
i < num_tables;
i++)
1964 static const struct font_data charset_0[] =
1966 {
"wine_vdmx", 10,
FW_NORMAL, 10, 8, 2, 2, 0, 96,
TRUE },
1967 {
"wine_vdmx", 11,
FW_NORMAL, 11, 9, 2, 2, 0, 96,
TRUE },
1968 {
"wine_vdmx", 12,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
1969 {
"wine_vdmx", 13,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
1970 {
"wine_vdmx", 14,
FW_NORMAL, 14, 12, 2, 2, 0, 96,
TRUE },
1971 {
"wine_vdmx", 15,
FW_NORMAL, 15, 12, 3, 3, 0, 96,
FALSE },
1972 {
"wine_vdmx", 16,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
1973 {
"wine_vdmx", 17,
FW_NORMAL, 17, 14, 3, 3, 0, 96,
TRUE },
1974 {
"wine_vdmx", 18,
FW_NORMAL, 18, 15, 3, 3, 0, 96,
TRUE },
1975 {
"wine_vdmx", 19,
FW_NORMAL, 19, 16, 3, 3, 0, 96,
TRUE },
1976 {
"wine_vdmx", 20,
FW_NORMAL, 20, 17, 3, 4, 0, 96,
FALSE },
1977 {
"wine_vdmx", 21,
FW_NORMAL, 21, 17, 4, 4, 0, 96,
TRUE },
1978 {
"wine_vdmx", 22,
FW_NORMAL, 22, 18, 4, 4, 0, 96,
TRUE },
1979 {
"wine_vdmx", 23,
FW_NORMAL, 23, 19, 4, 4, 0, 96,
TRUE },
1980 {
"wine_vdmx", 24,
FW_NORMAL, 24, 20, 4, 4, 0, 96,
TRUE },
1981 {
"wine_vdmx", 25,
FW_NORMAL, 25, 21, 4, 4, 0, 96,
TRUE },
1982 {
"wine_vdmx", 26,
FW_NORMAL, 26, 22, 4, 5, 0, 96,
FALSE },
1983 {
"wine_vdmx", 27,
FW_NORMAL, 27, 22, 5, 5, 0, 96,
TRUE },
1984 {
"wine_vdmx", 28,
FW_NORMAL, 28, 23, 5, 5, 0, 96,
TRUE },
1985 {
"wine_vdmx", 29,
FW_NORMAL, 29, 24, 5, 5, 0, 96,
TRUE },
1986 {
"wine_vdmx", 30,
FW_NORMAL, 30, 25, 5, 5, 0, 96,
TRUE },
1987 {
"wine_vdmx", 31,
FW_NORMAL, 31, 26, 5, 5, 0, 96,
TRUE },
1988 {
"wine_vdmx", 32,
FW_NORMAL, 32, 27, 5, 6, 0, 96,
FALSE },
1989 {
"wine_vdmx", 48,
FW_NORMAL, 48, 40, 8, 8, 0, 96,
TRUE },
1990 {
"wine_vdmx", 64,
FW_NORMAL, 64, 53, 11, 11, 0, 96,
TRUE },
1991 {
"wine_vdmx", 96,
FW_NORMAL, 96, 80, 16, 17, 0, 96,
FALSE },
1992 {
"wine_vdmx", -10,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
1993 {
"wine_vdmx", -11,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
1994 {
"wine_vdmx", -12,
FW_NORMAL, 14, 12, 2, 2, 0, 96,
TRUE },
1995 {
"wine_vdmx", -13,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
1996 {
"wine_vdmx", -14,
FW_NORMAL, 17, 14, 3, 3, 0, 96,
TRUE },
1997 {
"wine_vdmx", -15,
FW_NORMAL, 18, 15, 3, 3, 0, 96,
TRUE },
1998 {
"wine_vdmx", -16,
FW_NORMAL, 19, 16, 3, 3, 0, 96,
TRUE },
1999 {
"wine_vdmx", -17,
FW_NORMAL, 21, 17, 4, 4, 0, 96,
TRUE },
2000 {
"wine_vdmx", -18,
FW_NORMAL, 22, 18, 4, 4, 0, 96,
TRUE },
2001 {
"wine_vdmx", -19,
FW_NORMAL, 23, 19, 4, 4, 0, 96,
TRUE },
2002 {
"wine_vdmx", -20,
FW_NORMAL, 24, 20, 4, 4, 0, 96,
TRUE },
2003 {
"wine_vdmx", -21,
FW_NORMAL, 25, 21, 4, 4, 0, 96,
TRUE },
2004 {
"wine_vdmx", -22,
FW_NORMAL, 27, 22, 5, 5, 0, 96,
TRUE },
2005 {
"wine_vdmx", -23,
FW_NORMAL, 28, 23, 5, 5, 0, 96,
TRUE },
2006 {
"wine_vdmx", -24,
FW_NORMAL, 29, 24, 5, 5, 0, 96,
TRUE },
2007 {
"wine_vdmx", -25,
FW_NORMAL, 30, 25, 5, 5, 0, 96,
TRUE },
2008 {
"wine_vdmx", -26,
FW_NORMAL, 31, 26, 5, 5, 0, 96,
TRUE },
2009 {
"wine_vdmx", -27,
FW_NORMAL, 33, 27, 6, 6, 0, 96,
TRUE },
2010 {
"wine_vdmx", -28,
FW_NORMAL, 34, 28, 6, 6, 0, 96,
TRUE },
2011 {
"wine_vdmx", -29,
FW_NORMAL, 35, 29, 6, 6, 0, 96,
TRUE },
2012 {
"wine_vdmx", -30,
FW_NORMAL, 36, 30, 6, 6, 0, 96,
TRUE },
2013 {
"wine_vdmx", -31,
FW_NORMAL, 37, 31, 6, 6, 0, 96,
TRUE },
2014 {
"wine_vdmx", -32,
FW_NORMAL, 39, 32, 7, 7, 0, 96,
TRUE },
2015 {
"wine_vdmx", -48,
FW_NORMAL, 58, 48, 10, 10, 0, 96,
TRUE },
2016 {
"wine_vdmx", -64,
FW_NORMAL, 77, 64, 13, 13, 0, 96,
TRUE },
2017 {
"wine_vdmx", -96,
FW_NORMAL, 116, 96, 20, 20, 0, 96,
TRUE },
2018 {
"", 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2021 static const struct font_data charset_1[] =
2023 {
"wine_vdmx", 10,
FW_NORMAL, 10, 8, 2, 2, 0, 96,
TRUE },
2024 {
"wine_vdmx", 11,
FW_NORMAL, 11, 9, 2, 2, 0, 96,
TRUE },
2025 {
"wine_vdmx", 12,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
2026 {
"wine_vdmx", 13,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2027 {
"wine_vdmx", 14,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2028 {
"wine_vdmx", 15,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2029 {
"wine_vdmx", 16,
FW_NORMAL, 16, 13, 3, 4, 0, 96,
TRUE },
2030 {
"wine_vdmx", 17,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2031 {
"wine_vdmx", 18,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2032 {
"wine_vdmx", 19,
FW_NORMAL, 19, 15, 4, 5, 0, 96,
TRUE },
2033 {
"wine_vdmx", 20,
FW_NORMAL, 20, 16, 4, 5, 0, 96,
TRUE },
2034 {
"wine_vdmx", 21,
FW_NORMAL, 21, 17, 4, 5, 0, 96,
TRUE },
2035 {
"wine_vdmx", 22,
FW_NORMAL, 22, 18, 4, 5, 0, 96,
TRUE },
2036 {
"wine_vdmx", 23,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2037 {
"wine_vdmx", 24,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2038 {
"wine_vdmx", 25,
FW_NORMAL, 25, 21, 4, 6, 0, 96,
TRUE },
2039 {
"wine_vdmx", 26,
FW_NORMAL, 26, 22, 4, 6, 0, 96,
TRUE },
2040 {
"wine_vdmx", 27,
FW_NORMAL, 27, 23, 4, 6, 0, 96,
TRUE },
2041 {
"wine_vdmx", 28,
FW_NORMAL, 27, 23, 4, 5, 0, 96,
TRUE },
2042 {
"wine_vdmx", 29,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2043 {
"wine_vdmx", 30,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2044 {
"wine_vdmx", 31,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2045 {
"wine_vdmx", 32,
FW_NORMAL, 32, 26, 6, 8, 0, 96,
TRUE },
2046 {
"wine_vdmx", 48,
FW_NORMAL, 48, 40, 8, 10, 0, 96,
TRUE },
2047 {
"wine_vdmx", 64,
FW_NORMAL, 64, 54, 10, 13, 0, 96,
TRUE },
2048 {
"wine_vdmx", 96,
FW_NORMAL, 95, 79, 16, 18, 0, 96,
TRUE },
2049 {
"wine_vdmx", -10,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
2050 {
"wine_vdmx", -11,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2051 {
"wine_vdmx", -12,
FW_NORMAL, 16, 13, 3, 4, 0, 96,
TRUE },
2052 {
"wine_vdmx", -13,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2053 {
"wine_vdmx", -14,
FW_NORMAL, 19, 15, 4, 5, 0, 96,
TRUE },
2054 {
"wine_vdmx", -15,
FW_NORMAL, 20, 16, 4, 5, 0, 96,
TRUE },
2055 {
"wine_vdmx", -16,
FW_NORMAL, 21, 17, 4, 5, 0, 96,
TRUE },
2056 {
"wine_vdmx", -17,
FW_NORMAL, 22, 18, 4, 5, 0, 96,
TRUE },
2057 {
"wine_vdmx", -18,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2058 {
"wine_vdmx", -19,
FW_NORMAL, 25, 21, 4, 6, 0, 96,
TRUE },
2059 {
"wine_vdmx", -20,
FW_NORMAL, 26, 22, 4, 6, 0, 96,
TRUE },
2060 {
"wine_vdmx", -21,
FW_NORMAL, 27, 23, 4, 6, 0, 96,
TRUE },
2061 {
"wine_vdmx", -22,
FW_NORMAL, 27, 23, 4, 5, 0, 96,
TRUE },
2062 {
"wine_vdmx", -23,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2063 {
"wine_vdmx", -24,
FW_NORMAL, 32, 26, 6, 8, 0, 96,
TRUE },
2064 {
"wine_vdmx", -25,
FW_NORMAL, 32, 26, 6, 7, 0, 96,
TRUE },
2065 {
"wine_vdmx", -26,
FW_NORMAL, 33, 27, 6, 7, 0, 96,
TRUE },
2066 {
"wine_vdmx", -27,
FW_NORMAL, 35, 29, 6, 8, 0, 96,
TRUE },
2067 {
"wine_vdmx", -28,
FW_NORMAL, 36, 30, 6, 8, 0, 96,
TRUE },
2068 {
"wine_vdmx", -29,
FW_NORMAL, 36, 30, 6, 7, 0, 96,
TRUE },
2069 {
"wine_vdmx", -30,
FW_NORMAL, 38, 32, 6, 8, 0, 96,
TRUE },
2070 {
"wine_vdmx", -31,
FW_NORMAL, 39, 33, 6, 8, 0, 96,
TRUE },
2071 {
"wine_vdmx", -32,
FW_NORMAL, 40, 33, 7, 8, 0, 96,
TRUE },
2072 {
"wine_vdmx", -48,
FW_NORMAL, 60, 50, 10, 12, 0, 96,
TRUE },
2073 {
"wine_vdmx", -64,
FW_NORMAL, 81, 67, 14, 17, 0, 96,
TRUE },
2074 {
"wine_vdmx", -96,
FW_NORMAL, 119, 99, 20, 23, 0, 96,
TRUE },
2075 {
"", 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2078 static const struct vdmx_data
2085 { 0, 0, charset_0 },
2086 { 0, 1, charset_1 },
2087 { 1, 0, charset_0 },
2108 ratio_rec = (
BYTE *)&vdmx_header[3];
2109 ratio_rec[0] =
data[
i].bCharSet;
2116 if (!
num)
win_skip(
"Unable to add ttf font resource\n");
2131 static const struct font_data tahoma[] =
2133 {
"Tahoma", -12,
FW_NORMAL, 14, 12, 2, 2, 0, 96,
TRUE },
2134 {
"Tahoma", -24,
FW_NORMAL, 29, 24, 5, 5, 0, 96,
TRUE },
2135 {
"Tahoma", -48,
FW_NORMAL, 58, 48, 10, 10, 0, 96,
TRUE },
2136 {
"Tahoma", -96,
FW_NORMAL, 116, 96, 20, 20, 0, 96,
TRUE },
2137 {
"Tahoma", -192,
FW_NORMAL, 232, 192, 40, 40, 0, 96,
TRUE },
2138 {
"Tahoma", 12,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
2139 {
"Tahoma", 24,
FW_NORMAL, 24, 20, 4, 4, 0, 96,
TRUE },
2140 {
"Tahoma", 48,
FW_NORMAL, 48, 40, 8, 8, 0, 96,
TRUE },
2141 {
"Tahoma", 96,
FW_NORMAL, 96, 80, 16, 17, 0, 96,
FALSE },
2142 {
"Tahoma", 192,
FW_NORMAL, 192, 159, 33, 33, 0, 96,
TRUE },
2143 {
"", 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2146 ok(
hdc !=
NULL,
"failed to create hdc\n");
2157 HFONT
hfont, hfont_old;
2186 HFONT
hfont, hfont_old;
2193 memset(&lf, 0,
sizeof(lf));
2199 ok((fsSelection & (1 << 5)) == 0,
"got 0x%x\n", fsSelection);
2204 ok((fsSelection & (1 << 5)) != 0,
"got 0x%x\n", fsSelection);
2207 memset(&lf, 0,
sizeof(lf));
2216 ok((fsSelection & 1) == 0,
"got 0x%x\n", fsSelection);
2221 ok((fsSelection & 1) == 1,
"got 0x%x\n", fsSelection);
2225 skip(
"Arial is not installed\n");
2231 memset(&lf, 0,
sizeof(lf));
2245 memset(otm, 0xAA, otm_size);
2255 memset(otm, 0xAA, otm_size);
2265 memset(otm, 0xAA, otm_size);
2266 memset(&unset_ptr, 0xAA,
sizeof(unset_ptr));
2268 otm->
otmSize =
sizeof(*otm) -
sizeof(
char*);
2293 areaWidth = clientArea->
right - clientArea->
left,
2295 const char *pFirstChar, *pLastChar;
2302 int GetTextExtentExPointWWidth;
2306 y = clientArea->
top;
2309 while (*
str ==
tm.tmBreakChar)
str++;
2316 if (*
str ==
'\0')
break;
2318 while (*
str !=
'\0' && *
str++ !=
tm.tmBreakChar);
2322 }
while ((
int)
size.cx < areaWidth);
2326 while (*(pLastChar - 1) ==
tm.tmBreakChar)
2332 if (*
str ==
'\0' || breakCount <= 0) pLastChar =
str;
2338 if (*
str !=
'\0' && breakCount > 0)
2344 error[nErrors].start = pFirstChar;
2345 error[nErrors].len = pLastChar - pFirstChar;
2346 error[nErrors].GetTextExtentExPointWWidth =
size.cx;
2353 }
while (*
str && y < clientArea->
bottom);
2355 for (
e = 0;
e < nErrors;
e++)
2359 ok(
error[
e].GetTextExtentExPointWWidth == areaWidth ||
2361 "%s: GetTextExtentPointW() for \"%.*s\" should have returned a width of %d, not %d.\n",
2376 static const char testText[] =
2377 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
2378 "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut "
2379 "enim ad minim veniam, quis nostrud exercitation ullamco laboris "
2380 "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in "
2381 "reprehenderit in voluptate velit esse cillum dolore eu fugiat "
2382 "nulla pariatur. Excepteur sint occaecat cupidatat non proident, "
2383 "sunt in culpa qui officia deserunt mollit anim id est laborum.";
2385 hwnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0, 400,400, 0, 0, 0,
NULL);
2391 skip(
"Times New Roman is not installed\n");
2395 memset(&lf, 0,
sizeof lf);
2444 for (
i = 0;
i < 10;
i++)
2452 for (
i = 0;
i < 10;
i++)
2466 for (
i = 0;
i < 10;
i++)
2482 HFONT
hfont, hfont_old;
2491 memset(&lf, 0,
sizeof(lf));
2512 ok(
strcmp(
"Arial",
name),
"face name should NOT be Arial\n");
2513 ok(
fs.fsCsb[0] & (1u << 31),
"symbol encoding should be available\n");
2518 ok(!(
fs.fsCsb[0] & (1u << 31)),
"symbol encoding should NOT be available\n");
2523 trace(
"Can't find codepage for charset %d\n",
cs);
2531 skip(
"Font code page %ld, looking for code page %d\n",
2540 WCHAR unicode_buf[128];
2548 ok(
ret ==
count,
"GetGlyphIndicesW expected %d got %ld, error %lu\n",
2559 ok(
ret ==
count,
"GetGlyphIndicesA expected %d got %ld, error %lu\n",
2590 { 254,
CP_UTF8, { {0}, { 0x04000000 }}},
2598 for (
i = 0;
i < 65536;
i++)
2600 memset( &csi, 0xcc,
sizeof(csi) );
2606 if (
tests[
j].ciACP !=
i)
continue;
2608 "%lu: wrong info %u %u %08lx %08lx %08lx %08lx %08lx %08lx\n",
i,
2615 else ok( !
ret,
"%lu: TranslateCharsetInfo succeeded\n",
i );
2619 for (
i = 0;
i < 256;
i++)
2621 memset( &csi, 0xcc,
sizeof(csi) );
2627 if (
tests[
j].ciCharset !=
i)
continue;
2629 "%lu: wrong info %u %u %08lx %08lx %08lx %08lx %08lx %08lx\n",
i,
2636 else ok( !
ret,
"%lu: TranslateCharsetInfo succeeded\n",
i );
2640 for (
i = 0;
i < 64;
i++)
2642 DWORD csb[2] = { 0, 0 };
2643 csb[
i / 32] = 1 << (
i % 32);
2644 memset( &csi, 0xcc,
sizeof(csi) );
2650 if (
tests[
j].
fs.fsCsb[0] != csb[0])
continue;
2652 "%lu: wrong info %u %u %08lx %08lx %08lx %08lx %08lx %08lx\n",
i,
2659 else ok( !
ret,
"%lu: TranslateCharsetInfo succeeded\n",
i );
2665 static struct charset_data
2669 WORD font_idxA[128], font_idxW[128];
2680 skip(
"Arial is not installed\n");
2690 skip(
"Symbol or Wingdings is not installed\n");
2696 ok(!
memcmp(
cd[
i].font_idxA,
cd[
i].font_idxW, 128*
sizeof(
WORD)),
"%d: indices don't match\n",
i);
2699 ok(
memcmp(
cd[0].font_idxW,
cd[1].font_idxW, 128*
sizeof(
WORD)),
"0 vs 1: indices shouldn't match\n");
2702 ok(
memcmp(
cd[0].font_idxW,
cd[2].font_idxW, 128*
sizeof(
WORD)),
"0 vs 2: indices shouldn't match\n");
2703 ok(
memcmp(
cd[1].font_idxW,
cd[2].font_idxW, 128*
sizeof(
WORD)),
"1 vs 2: indices shouldn't match\n");
2706 skip(
"Symbol or Wingdings is not installed\n");
2711 static const struct _matching_data
2713 UINT current_codepage;
2716 UINT expected_codepage;
2717 } matching_data[] = {
2750 if (!pGdiGetCodePage)
2752 win_skip(
"GdiGetCodePage not available on this platform\n");
2761 if (matching_data[
i].current_codepage != acp)
2766 skip(
"%s is not installed\n", matching_data[
i].lfFaceName);
2772 memset(&lf, 0,
sizeof(lf));
2781 ok(
codepage == matching_data[
i].expected_codepage,
2782 "GdiGetCodePage should have returned %d, got %ld\n", matching_data[
i].expected_codepage,
codepage);
2807 HFONT
hfont, hfont_old;
2811 memset(&lf, 0,
sizeof(lf));
2819 ok(!
size,
"GetFontUnicodeRanges succeeded unexpectedly\n");
2822 ok(
size,
"GetFontUnicodeRanges failed unexpectedly\n");
2827 ok(
size,
"GetFontUnicodeRanges failed\n");
2828 ok(
gs->cRanges,
"Unexpected ranges count.\n");
2876 if (!efd->
lf)
return 0;
2898 if (!efd->
lf)
return 0;
2906 int *ansi_charset,
int *symbol_charset,
2907 int *russian_charset)
2912 *symbol_charset = 0;
2913 *russian_charset = 0;
2923 (*symbol_charset)++;
2926 (*russian_charset)++;
2933 int *ansi_charset,
int *symbol_charset,
2934 int *russian_charset)
2939 *symbol_charset = 0;
2940 *russian_charset = 0;
2950 (*symbol_charset)++;
2953 (*russian_charset)++;
2965 int i,
ret, ansi_charset, symbol_charset, russian_charset;
2969 skip(
"%s is not installed\n", font_name);
2972 memset( &efd, 0,
sizeof(efd) );
2973 memset( &efdw, 0,
sizeof(efdw) );
2993 ok(efdw.total > 0,
"fonts enumerated: NULL\n");
2994 ok(ansi_charset > 0,
"NULL family should enumerate ANSI_CHARSET\n");
2995 ok(symbol_charset > 0,
"NULL family should enumerate SYMBOL_CHARSET\n");
2996 ok(russian_charset > 0,
"NULL family should enumerate RUSSIAN_CHARSET\n");
3006 ok(efdw.total > 0,
"fonts enumerated: NULL\n");
3007 ok(ansi_charset > 0,
"NULL family should enumerate ANSI_CHARSET\n");
3008 ok(symbol_charset > 0,
"NULL family should enumerate SYMBOL_CHARSET\n");
3009 ok(russian_charset > 0,
"NULL family should enumerate RUSSIAN_CHARSET\n");
3019 ok(efd.
total > 0,
"no fonts enumerated: %s\n", font_name);
3021 ok(!efd.
total,
"no fonts should be enumerated for empty font_name\n");
3042 ok(efd.
total == 0,
"no fonts should be enumerated: %s ANSI_CHARSET\n", font_name);
3044 ok(efd.
total > 0,
"no fonts enumerated: %s\n", font_name);
3048 ok(efd.
total > 0,
"no fonts enumerated: %s ANSI_CHARSET\n", font_name);
3067 ok(efd.
total > 0,
"no fonts enumerated: %s DEFAULT_CHARSET\n", font_name);
3076 switch (font_charset)
3079 ok(ansi_charset > 0,
3080 "ANSI_CHARSET should enumerate ANSI_CHARSET for %s\n", font_name);
3082 "ANSI_CHARSET should NOT enumerate SYMBOL_CHARSET for %s\n", font_name);
3083 ok(russian_charset > 0,
3084 "ANSI_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", font_name);
3088 "SYMBOL_CHARSET should NOT enumerate ANSI_CHARSET for %s\n", font_name);
3090 "SYMBOL_CHARSET should enumerate SYMBOL_CHARSET for %s\n", font_name);
3091 ok(!russian_charset,
3092 "SYMBOL_CHARSET should NOT enumerate RUSSIAN_CHARSET for %s\n", font_name);
3095 ok(ansi_charset > 0,
3096 "DEFAULT_CHARSET should enumerate ANSI_CHARSET for %s\n", font_name);
3097 ok(symbol_charset > 0,
3098 "DEFAULT_CHARSET should enumerate SYMBOL_CHARSET for %s\n", font_name);
3099 ok(russian_charset > 0,
3100 "DEFAULT_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", font_name);
3106 ok(ansi_charset > 0,
3107 "DEFAULT_CHARSET should enumerate ANSI_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3108 ok(symbol_charset > 0,
3109 "DEFAULT_CHARSET should enumerate SYMBOL_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3110 ok(russian_charset > 0,
3111 "DEFAULT_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3123 ok(efd.
total == 0,
"no fonts should be enumerated: %s SYMBOL_CHARSET\n", font_name);
3126 ok(efd.
total > 0,
"no fonts enumerated: %s SYMBOL_CHARSET\n", font_name);
3136 "SYMBOL_CHARSET should NOT enumerate ANSI_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3137 ok(symbol_charset > 0,
3138 "SYMBOL_CHARSET should enumerate SYMBOL_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3139 ok(!russian_charset,
3140 "SYMBOL_CHARSET should NOT enumerate RUSSIAN_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3153 const DWORD valid_bits = 0x003f01ff;
3180 if (!efd->
lf)
return 0;
3197 if (!efnd->
elf)
return 0;
3214 if (!efnd->
elf)
return 0;
3231 skip(
"TranslateCharsetInfo failed for code page %u.\n", acp);
3236 memset(&enum_font, 0,
sizeof(enum_font));
3238 target.lfFaceName[0] =
'\0';
3241 if (
target.lfFaceName[0] ==
'\0') {
3242 skip(
"suitable font isn't found for charset %d.\n", enum_font.lfCharSet);
3245 if (acp == 874 || acp == 1255 || acp == 1256) {
3250 memset(&efd, 0,
sizeof(efd));
3251 memset(&enum_font, 0,
sizeof(enum_font));
3258 ok(0,
"EnumFontFamilies is broken. Expected >= 2, got %d.\n", efd.
total);
3261 "(%s) got charset %d expected %d\n",
3270 HFONT
hfont, hfont_prev;
3296 memset(&gm1, 0xab,
sizeof(gm1));
3311 memset(&gm2, 0xbb,
sizeof(gm2));
3325 "gm1=%d,%d,%ld,%ld,%d,%d gm2=%d,%d,%ld,%ld,%d,%d\n",
3333#include "pshpack2.h"
3385#define TT_OS2_V0_SIZE (FIELD_OFFSET(TT_OS2_V4, ulCodePageRange1))
3442 "%s: expected family %02x got %02x. panose %d-%d-%d-%d-...\n",
3454 for(
i = 0;
i < 256;
i++)
3481 for(
i = 0;
i < seg_count;
i++)
3569#define TT_PLATFORM_APPLE_UNICODE 0
3570#define TT_PLATFORM_MACINTOSH 1
3571#define TT_PLATFORM_MICROSOFT 3
3572#define TT_APPLE_ID_DEFAULT 0
3573#define TT_APPLE_ID_ISO_10646 2
3574#define TT_APPLE_ID_UNICODE_2_0 3
3575#define TT_MS_ID_SYMBOL_CS 0
3576#define TT_MS_ID_UNICODE_CS 1
3577#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
3578#define TT_NAME_ID_FONT_FAMILY 1
3579#define TT_NAME_ID_FONT_SUBFAMILY 2
3580#define TT_NAME_ID_UNIQUE_ID 3
3581#define TT_NAME_ID_FULL_NAME 4
3582#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
3691 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3692 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3765 if (name_lang ==
lang)
res += 30;
3773 struct sfnt_name_header
3786 int res, best_lang = 0, best_index = -1;
3807 skip(
"number records out of range: %d\n",
header->number_of_record);
3812 skip(
"storage_offset %u > size %lu\n",
header->storage_offset,
size);
3817 for (
i = 0;
i <
header->number_of_record;
i++)
3821 if (
res > best_lang)
3832 skip(
"entry %d is out of range\n", best_index);
3837 skip(
"buffer too small for entry %d\n", best_index);
3856 HFONT
hfont, hfont_old;
3861 DWORD cmap_first = 0, cmap_last = 0;
3862 UINT ascent, descent, cell_height;
3864 BOOL sys_lang_non_english;
3878 trace(
"OS/2 chunk was not found\n");
3881 if (
size >
sizeof(tt_os2))
3883 trace(
"got too large OS/2 chunk of size %lu\n",
size);
3884 size =
sizeof(tt_os2);
3887 memset(&tt_os2, 0,
sizeof(tt_os2));
3898 skip(
"%s is not a Windows font, OS/2 metrics may be invalid.\n",font_name);
3902 USHORT expect_first_A, expect_last_A, expect_break_A, expect_default_A;
3903 USHORT expect_first_W, expect_last_W, expect_break_W, expect_default_W;
3904 UINT os2_first_char, os2_last_char, default_char, break_char;
3910 cell_height = ascent + descent;
3911 ok(ntm->
ntmCellHeight == cell_height,
"%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n",
3912 font_name, ntm->
ntmCellHeight, cell_height, ascent, descent);
3915#define SCALE_NTM(value) (MulDiv(ntm->tmHeight, (value), cell_height))
3917 ok(ntm->
tmHeight ==
size,
"%s: ntm->tmHeight %ld != %ld (%u/%u)\n",
3923 ok(ntm->
tmAscent ==
size,
"%s: ntm->tmAscent %ld != %ld (%u/%u,%ld)\n",
3926 ok(ntm->
tmDescent ==
size,
"%s: ntm->tmDescent %ld != %ld (%u/%u,%ld)\n",
3941 trace(
"font %s charset %u: %x-%x (%lx-%lx) default %x break %x OS/2 version %u vendor %4.4s\n",
3942 font_name, lf->
lfCharSet, os2_first_char, os2_last_char, cmap_first, cmap_last,
3951 expect_last_W = 0xf896;
3954 expect_last_W = 0xf8fd;
3957 expect_last_W = 0xf0ff;
3959 expect_break_W = 0x20;
3960 expect_default_W = expect_break_W - 1;
3961 expect_first_A = 0x1e;
3962 expect_last_A =
min(os2_last_char - os2_first_char + 0x20, 0xff);
3966 expect_first_W = cmap_first;
3967 expect_last_W = cmap_last;
3968 if(os2_first_char <= 1)
3969 expect_break_W = os2_first_char + 2;
3970 else if(os2_first_char > 0xff)
3971 expect_break_W = 0x20;
3973 expect_break_W = os2_first_char;
3974 expect_default_W = expect_break_W - 1;
3975 expect_first_A = expect_default_W - 1;
3976 expect_last_A =
min(os2_last_char, 0xff);
3978 expect_break_A = expect_break_W;
3979 expect_default_A = expect_default_W;
3984 "A: tmFirstChar for %s got %02x expected %02x\n", font_name, tmA.
tmFirstChar, expect_first_A);
3987 "A: tmLastChar for %s got %02x expected %02x\n", font_name, tmA.
tmLastChar, expect_last_A);
3989 skip(
"tmLastChar is DBCS lead byte\n");
3990 ok(tmA.
tmBreakChar == expect_break_A,
"A: tmBreakChar for %s got %02x expected %02x\n",
3993 "A: tmDefaultChar for %s got %02x expected %02x\n",
4005 ok(tmW.
tmFirstChar == expect_first_W,
"W: tmFirstChar for %s got %02x expected %02x\n",
4010 ok(tmW.
tmLastChar == expect_last_W,
"W: tmLastChar for %s got %02x expected %02x\n",
4012 ok(tmW.
tmBreakChar == expect_break_W,
"W: tmBreakChar for %s got %02x expected %02x\n",
4015 "W: tmDefaultChar for %s got %02x expected %02x\n",
4113 memset(&lf, 0,
sizeof(lf));
4126 ok(
tm.tmHeight <= 20,
"Got unexpected tmHeight %ld\n",
tm.tmHeight);
4141 {
"Times New Roman Baltic", 186 },
4142 {
"Times New Roman CE", 238 },
4143 {
"Times New Roman CYR", 204 },
4144 {
"Times New Roman Greek", 161 },
4145 {
"Times New Roman TUR", 162 }
4153 {
"MS Shell Dlg", 186 },
4154 {
"MS Shell Dlg", 238 },
4155 {
"MS Shell Dlg", 204 },
4156 {
"MS Shell Dlg", 161 },
4157 {
"MS Shell Dlg", 162 }
4169 skip(
"TranslateCharsetInfo failed for code page %d\n", expected_cs);
4173 trace(
"ACP %d -> charset %d\n",
GetACP(), expected_cs);
4180 ok(
ret,
"%s should be enumerated\n", shell_subst[
i].
name);
4182 ok(
ret,
"%s should be enumerated\n", shell_subst[
i].
name);
4184 memset(&lf, 0,
sizeof(lf));
4197 memset(&lf, 0,
sizeof(lf));
4214 skip(
"Arial or Times New Roman not installed\n");
4218 memset(&lf, 0,
sizeof(lf));
4232 memset(&lf, 0,
sizeof(lf));
4247 memset(&lf, 0,
sizeof(lf));
4259 memset(&lf, 0,
sizeof(lf));
4275 ok(
ret,
"%s should be enumerated\n", font_subst[
i].
name);
4278 ok(
ret,
"%s should be enumerated\n", font_subst[
i].
name);
4280 memset(&lf, 0,
sizeof(lf));
4287 if (font_subst[
i].
charset == expected_cs)
4289 ok(
cs == expected_cs,
"expected %d, got %d for font %s\n", expected_cs,
cs, font_subst[
i].
name);
4301 memset(&lf, 0,
sizeof(lf));
4311 "got %s for font %s\n",
buf, font_subst[
i].
name);
4340 struct realization_info_t
4350 HFONT
hfont, hfont_old;
4359 if(!pGdiRealizationInfo)
4361 win_skip(
"GdiRealizationInfo not available\n");
4368 r = pGdiRealizationInfo(
hdc,
info);
4369 ok(
r != 0,
"ret 0\n");
4370 ok((
info[0] & 0xf) == 1,
"info[0] = %lx for the system font\n",
info[0]);
4371 ok(
info[3] == 0xcccccccc,
"structure longer than 3 dwords\n");
4375 skip(
"skipping GdiRealizationInfo with truetype font\n");
4379 memset(&lf, 0,
sizeof(lf));
4388 r = pGdiRealizationInfo(
hdc,
info);
4389 ok(
r != 0,
"ret 0\n");
4390 ok((
info[0] & 0xf) == 3,
"info[0] = %lx for arial\n",
info[0]);
4391 ok(
info[3] == 0xcccccccc,
"structure longer than 3 dwords\n");
4393 if (pGetFontRealizationInfo)
4396 struct realization_info_t *ri = (
struct realization_info_t*)
info;
4406 memset(info2, 0xcc,
sizeof(info2));
4408 r = pGetFontRealizationInfo(
hdc, info2);
4409 ok(
r != 0,
"ret 0\n");
4412 ok(fri->
size == 16 || fri->
size == 24,
"got %ld\n", info2[0]);
4413 ok(fri->
flags == ri->flags,
"flags mismatch\n");
4414 ok(fri->
cache_num == ri->cache_num,
"cache_num mismatch\n");
4415 ok(fri->
instance_id == ri->instance_id,
"instance id mismatch\n");
4416 ok(info2[6] == 0xcccccccc,
"got wrong dword 6, 0x%08lx\n", info2[6]);
4418 memset(info2, 0xcc,
sizeof(info2));
4420 r = pGetFontRealizationInfo(
hdc, info2);
4423 memset(info2, 0xcc,
sizeof(info2));
4425 r = pGetFontRealizationInfo(
hdc, info2);
4426 ok(
r != 0,
"ret 0\n");
4428 ok(fri->
flags == ri->flags,
"flags mismatch\n");
4429 ok(fri->
cache_num == ri->cache_num,
"cache_num mismatch\n");
4430 ok(fri->
instance_id == ri->instance_id,
"instance id mismatch\n");
4433 ok(info2[6] == 0xcccccccc,
"structure longer than 6 dwords\n");
4443 ok(
r != 0,
"Failed to get font file info, error %ld.\n",
GetLastError());
4447 ok(needed > 0 && needed <
sizeof(
file_info),
"Unexpected required size.\n");
4486 static const char faceA[] =
"Tahoma";
4487 static const WCHAR faceW[] =
L"Tahoma";
4498 skip(
"Tahoma is not installed so skipping this test\n");
4505 ok(
f !=
NULL,
"CreateFontIndirectA failed\n");
4510 ok(
n ==
sizeof faceA - 1,
"GetTextFaceA returned %d\n",
n);
4511 ok(
lstrcmpA(faceA, bufA) == 0,
"GetTextFaceA\n");
4516 ok(
n == 0,
"GetTextFaceA returned %d\n",
n);
4517 ok(bufA[0] ==
'x',
"GetTextFaceA buf[0] == %d\n", bufA[0]);
4521 ok(
n == 0,
"GetTextFaceA returned %d\n",
n);
4522 ok(bufA[0] ==
'\0',
"GetTextFaceA buf[0] == %d\n", bufA[0]);
4524 bufA[0] =
'x'; bufA[1] =
'y';
4526 ok(
n == 1,
"GetTextFaceA returned %d\n",
n);
4527 ok(bufA[0] == faceA[0] && bufA[1] ==
'\0',
"GetTextFaceA didn't copy\n");
4530 ok(
n ==
sizeof faceA,
"GetTextFaceA returned %d\n",
n);
4541 win_skip(
"CreateFontIndirectW is not implemented\n");
4544 ok(
f !=
NULL,
"CreateFontIndirectW failed\n");
4550 ok(
lstrcmpW(faceW, bufW) == 0,
"GetTextFaceW\n");
4555 ok(
n == 0,
"GetTextFaceW returned %d\n",
n);
4556 ok(bufW[0] ==
'x',
"GetTextFaceW buf[0] == %d\n", bufW[0]);
4560 ok(
n == 1,
"GetTextFaceW returned %d\n",
n);
4561 ok(bufW[0] ==
'\0',
"GetTextFaceW buf[0] == %d\n", bufW[0]);
4563 bufW[0] =
'x'; bufW[1] =
'y';
4565 ok(
n == 2,
"GetTextFaceW returned %d\n",
n);
4566 ok(bufW[0] == faceW[0] && bufW[1] ==
'\0',
"GetTextFaceW didn't copy\n");
4577 static const char test_str[11] =
"Test String";
4580 HFONT
hfont, old_hfont;
4585 skip(
"Arial is not installed\n");
4590 memset(&lf, 0,
sizeof(lf));
4608 HFONT
hfont, old_hfont;
4689 HFONT
hfont, old_hfont;
4710 skip(
"Tahoma is not installed\n");
4715 memset(&lf, 0,
sizeof(lf));
4723 memset(&gm, 0,
sizeof(gm));
4728 memset(&gm, 0,
sizeof(gm));
4734 memset(&gm, 0,
sizeof(gm));
4740 memset(&gm, 0,
sizeof(gm));
4750 memset(&gm, 0,
sizeof(gm));
4755 ok(
ret == 0,
"GetGlyphOutlineW should return 0 buffer size for space char\n");
4762 memset(&gm, 0,
sizeof(gm));
4767 ok(
ret ==
GDI_ERROR,
"GetGlyphOutlineW should return GDI_ERROR\n");
4777 ok(
ret ==
GDI_ERROR,
"GetGlyphOutlineW should return an error when the buffer size is too small.\n");
4783 memset(&gm, 0xab,
sizeof(gm));
4791 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4797 memset(&gm, 0xab,
sizeof(gm));
4805 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4811 memset(&gm, 0xab,
sizeof(gm));
4819 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4825 memset(&gm, 0xab,
sizeof(gm));
4838 memset(&gm2, 0xab,
sizeof(gm2));
4840 "%2d:GLYPHMETRICS shouldn't be touched on error\n",
fmt[
i]);
4850 static const MAT2 rotate_mat = {{0, 0}, {0, -1}, {0, 1}, {0, 0}};
4858 skip(
"TrueType font for charset %u is not installed\n",
c[
i].
cs);
4867 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
"%d %d\n",
ret, ret2);
4870 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
4871 "Expected to ignore superfluous bytes, got %d %d\n",
ret, ret2);
4876 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
4877 "Expected to ignore superfluous bytes, got %d %d\n",
ret, ret2);
4881 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
"%d %d\n",
ret, ret2);
4885 skip(
"Fixed-pitch TrueType font for charset %u is not available\n",
c[
i].
cs);
4903 "expected %ld, got %d (%s:%d)\n",
4909 "expected %ld, got %d (%s:%d)\n",
4921 "expected %ld, got %d (%s:%d)\n",
4932 "expected %ld, got %d (%s:%d)\n",
4952 skip(
"%s is not installed\n", fontname);
4956 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
4962 ok( hf !=
NULL,
"CreateFontA(%s, %d) failed\n", fontname, font_height);
4967 ave_width =
tm.tmAveCharWidth;
4971 for (
width = ave_width * 2; ;
width += ave_width)
4976 ok(hf != 0,
"CreateFont failed\n");
4991 ok(ratio >= 90 && ratio <= 110,
"expected width/height ratio 90-110, got %d\n", ratio);
5003 ok(!!
hdc,
"CreateCompatibleDC failed\n");
5008 result.lpGlyphs = glyphs;
5014 ok(
size,
"GetCharacterPlacementA failed!\n");
5015 ok(
result.nGlyphs == 9,
"Unexpected number of glyphs %u\n",
result.nGlyphs);
5016 ok(glyphs[0] ==
'W',
"Unexpected first glyph %s\n",
wine_dbgstr_wn(glyphs, 1));
5017 ok(
pos[0] == 0,
"Unexpected caret position %d\n",
pos[0]);
5023 ok(!size2,
"Expected GetCharacterPlacementA to fail\n");
5024 ok(
result.nGlyphs == 20,
"Unexpected number of glyphs %u\n",
result.nGlyphs);
5025 ok(glyphs[0] ==
'!',
"Unexpected first glyph %s\n",
wine_dbgstr_wn(glyphs, 1));
5026 ok(
pos[0] == -1,
"Unexpected caret position %d\n",
pos[0]);
5029 ok(size2,
"GetCharacterPlacementA failed!\n");
5030 ok(
size == size2,
"GetCharacterPlacementA returned different result: %lu vs %lu\n", size2,
size);
5033 ok(size2,
"GetCharacterPlacementA failed!\n");
5034 ok(
size == size2,
"GetCharacterPlacementA returned different result: %lu vs %lu\n", size2,
size);
5040 ok(
size,
"GetCharacterPlacementA failed!\n");
5041 ok(
size == size2,
"GetCharacterPlacementA returned different result: %lu vs %lu\n", size2,
size);
5042 ok(
result.nGlyphs == 9,
"Unexpected number of glyphs %u\n",
result.nGlyphs);
5043 ok(glyphs[0] ==
'W',
"Unexpected first glyph %s\n",
wine_dbgstr_wn(glyphs, 1));
5054 char TestName[][16] = {
"Arial",
"Arial Bold",
"Arial Italic",
"Arial Baltic"};
5056 memset(&lf, 0,
sizeof(lf));
5069 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5087 skip(
"Arial is not installed\n");
5096 memset(&lfex, 0,
sizeof(lfex));
5099 ok(
hfont != 0,
"CreateFontIndirectEx failed\n");
5109 HFONT
hfont, hfont_prev;
5116 if (!pGetFontRealizationInfo)
5119 memset(&lf, 0,
sizeof(lf));
5129 ok(hfont_prev !=
NULL,
"Failed to select font.\n");
5134 ok(
ret != 0,
"Unexpected return value %d.\n",
ret);
5136 ok((
info.flags & 0xf) == 0x3,
"Unexpected flags %#lx.\n",
info.flags);
5137 ok(
info.cache_num != 0,
"Unexpected cache num %lu.\n",
info.cache_num);
5138 ok(
info.instance_id != 0,
"Unexpected instance id %lu.\n",
info.instance_id);
5139 ok(
info.simulations == 0,
"Unexpected simulations %#x.\n",
info.simulations);
5140 ok(
info.face_index == 0,
"Unexpected face index %u.\n",
info.face_index);
5147 ret = pGetFontFileInfo(
info.instance_id, 0,
NULL, 0, &needed);
5179 ok(*(
WORD *)(
data + 4) == 0x0e00,
"Unexpected table count %#x.\n", *(
WORD *)(
data + 4));
5202 ret = pGetFontFileData(
info.instance_id, 0, 16,
data, 0);
5218 DWORD font_size, num_fonts;
5224 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5226 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5231 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5233 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5238 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5240 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5245 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5247 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5252 ok(bRet,
"Failed to create test font file.\n");
5255 ok(
font !=
NULL,
"Failed to map font file.\n");
5258 ok(!bRet,
"Font wine_test should not be enumerated.\n");
5263 ok(num_fonts == 1,
"Unexpected number of fonts %lu.\n", num_fonts);
5267 ok(!bRet,
"Font wine_test should not be enumerated.\n");
5282 skip(
"Unable to locate and load font sserife.fon\n");
5288 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5290 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5295 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5297 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5300 num_fonts = 0xdeadbeef;
5303 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5305 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5307 ok(num_fonts == 0xdeadbeef,
"number of loaded fonts should be 0xdeadbeef\n");
5309 num_fonts = 0xdeadbeef;
5312 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5314 "Expected GetLastError() to return 0xdeadbeef, got %lu\n",
5316 ok(num_fonts == 0xdeadbeef,
"number of loaded fonts should be 0xdeadbeef\n");
5318 num_fonts = 0xdeadbeef;
5322 ok(num_fonts != 0xdeadbeef,
"number of loaded fonts should not be 0xdeadbeef\n");
5323 ok(num_fonts != 0,
"number of loaded fonts should not be 0\n");
5333 ok(
font !=
NULL,
"Unable to locate and load font sserife.fon\n");
5337 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5339 "Expected GetLastError() to return 0xdeadbeef, got %lu\n",
5344 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5346 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n",
5396 skip(
"Arial is not installed\n");
5403 skip(
"User locale is not English, skipping the test\n");
5411 ok(
ret == 0xcafe,
"got %08x\n",
ret);
5414 ok(!
ret,
"font Arial is not enumerated\n");
5421 ok(!
ret,
"font Arial is not enumerated\n");
5427 ok(!
ret,
"font Arial Bold is not enumerated\n");
5434 ok(
ret,
"font Arial Bold should not be enumerated\n");
5437 ok(!
ret,
"font Arial Bold Italic is not enumerated\n");
5444 ok(
ret,
"font Arial Bold Italic should not be enumerated\n");
5447 ok(
ret,
"font Arial Italic Bold should not be enumerated\n");
5451 ok(
ret,
"font Arial Italic Bold should not be enumerated\n");
5461 trace(
"enumed font \"%s\", charset %d, height %ld, weight %ld, italic %d\n",
5471 if (!efnd->
elf)
return 0;
5482 trace(
"enumed font \"%s\", charset %d, height %ld, weight %ld, italic %d\n",
5492 if (!efnd->
elf)
return 0;
5506 ok(
ret,
"MS Shell Dlg should be enumerated\n");
5508 ok(
ret,
"MS Shell Dlg should be enumerated as a TrueType font\n");
5511 ok(
ret,
"MS Shell Dlg 2 should be enumerated\n");
5513 ok(
ret,
"MS Shell Dlg 2 should be enumerated as a TrueType font\n");
5517 memset(&efnd, 0,
sizeof(efnd));
5519 ok(
ret,
"MS Shell Dlg should not be enumerated\n");
5520 ok(!efnd.
total,
"MS Shell Dlg should not be enumerated\n");
5522 memset(&lf, 0,
sizeof(lf));
5528 ok(!
ret,
"MS Shell Dlg should be enumerated\n");
5529 ok(efnd.
total > 0,
"MS Shell Dlg should be enumerated\n");
5535 ok(
ret,
"did not expect MS Shell Dlg\n");
5540 ok(
ret,
"MS Shell Dlg 2 should not be enumerated\n");
5541 ok(!efnd.
total,
"MS Shell Dlg 2 should not be enumerated\n");
5546 ok(!
ret,
"MS Shell Dlg 2 should be enumerated\n");
5547 ok(efnd.
total > 0,
"MS Shell Dlg 2 should be enumerated\n");
5553 ok(
ret,
"did not expect MS Shell Dlg 2\n");
5584 static const char *
TestName[] = {
"Lucida Sans Demibold Roman",
"Lucida Sans Italic",
"Lucida Sans Regular"};
5594 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
5596 memset(&lf, 0,
sizeof(lf));
5615 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5621 ok(
ret,
"face full name could not be read\n");
5642 char *FamilyName, *FaceName, *StyleName, *otmStr;
5652 BOOL want_vertical, get_vertical;
5653 want_vertical = (
Family[0] ==
'@' );
5656 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
5658 memset(&lf, 0,
sizeof(lf));
5667 memset(&efnd, 0,
sizeof(efnd));
5669 if (efnd.
total == 0)
5678 get_vertical = ( FamilyName[0] ==
'@' );
5679 ok(get_vertical == want_vertical,
"Vertical flags don't match: %s %s\n",
Family, FamilyName);
5683 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5687 ok(buf_size !=
GDI_ERROR,
"no name table found\n");
5695 memset(otm, 0, otm_size);
5697 ok(
ret != 0,
"GetOutlineTextMetrics fails!\n");
5698 if (
ret == 0)
continue;
5704 ok(
ret,
"%s: FAMILY (family name) could not be read\n", FamilyName);
5707 ok(!
lstrcmpA(FamilyName, bufA),
"font family names don't match: returned %s, expect %s\n", FamilyName, bufA);
5709 ok(!
lstrcmpA(FamilyName, otmStr),
"FamilyName %s doesn't match otmpFamilyName %s\n", FamilyName, otmStr);
5715 ok(
ret,
"FULL_NAME (face name) could not be read\n");
5718 ok(!
lstrcmpA(FaceName, bufA),
"%s: font face names don't match: returned %s, expect %s\n", FamilyName, FaceName, bufA);
5720 ok(!
lstrcmpA(FaceName, otmStr),
"%s: FaceName %s doesn't match otmpFaceName %s\n", FamilyName, FaceName, otmStr);
5726 ok(
ret,
"%s: SUBFAMILY (style name) could not be read\n", FamilyName);
5728 ok(!
lstrcmpA(StyleName, bufA),
"%s: style names don't match: returned %s, expect %s\n", FamilyName, StyleName, bufA);
5730 ok(!
lstrcmpA(StyleName, otmStr),
"%s: StyleName %s doesn't match otmpStyleName %s\n", FamilyName, StyleName, otmStr);
5736 ok(
ret,
"%s: UNIQUE_ID (full name) could not be read\n", FamilyName);
5739 ok(!
lstrcmpA(otmStr, bufA),
"%s: UNIQUE ID (full name) doesn't match: returned %s, expect %s\n", FamilyName, otmStr, bufA);
5797 HFONT
hfont, hfont_prev;
5803 memset(&lf, 0,
sizeof(lf));
5813 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5816 ok(
ret == 228,
"GetGlyphOutline returned %ld, expected 228\n",
ret);
5820 ok(
ret == 228,
"GetGlyphOutline returned %ld, expected 228\n",
ret);
5821 ok(
header->cb == 36,
"header->cb = %ld, expected 36\n",
header->cb);
5824 ok(
header->cb == 96,
"header->cb = %ld, expected 96\n",
header->cb);
5826 ok(
header->cb == 96,
"header->cb = %ld, expected 96\n",
header->cb);
5837 HFONT
hfont, hfont_prev;
5843 memset(&lf, 0,
sizeof(lf));
5854 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5862 "Glyph top(%ld) exceeds ascent(%ld)\n",
5866 "Glyph bottom(%ld) exceeds descent(%ld)\n",
5881 HFONT
hfont, hfont_old;
5886 char test_chars[] = {
'A',
'D',
'!',
'\0' };
5889 memset(&lf, 0,
sizeof(lf));
5899 ok(hfont_old !=
NULL,
"SelectObject failed\n");
5902 ok(
ret !=
GDI_ERROR,
"GetGlyphOutlineW failed to default to .notdef for character 'Z'\n");
5904 for (current_char = test_chars; *current_char !=
'\0'; current_char++)
5907 ok(
ret !=
GDI_ERROR,
"GetGlyphOutlineW failed for '%c'\n", *current_char);
5908 ok(
memcmp(&gm1, &gmn,
sizeof(gmn)) != 0,
"the test character '%c' matches .notdef\n", *current_char);
5911 ok(
ret !=
GDI_ERROR,
"GetGlyphOutlineW failed for 0x10000 + '%c'\n", *current_char);
5912 ok(
memcmp(&gm1, &gm2,
sizeof(gmn)) == 0,
"GetGlyphOutlineW returned wrong metrics for character 0x10000 + '%c'\n", *current_char);
5916 ok(
ret !=
GDI_ERROR,
"GetGlyphOutlineW failed for glyph index 0x3\n");
5919 ok(
ret ==
GDI_ERROR,
"GetGlyphOutlineW for nonexistent glyph index 0xFFFF has succeeded\n");
5922 ok(
ret !=
GDI_ERROR,
"GetGlyphOutlineW for index 0x10003 has failed\n");
5923 ok(
memcmp(&gm1, &gm2,
sizeof(gmn)) == 0,
"GetGlyphOutlineW returned wrong metrics for glyph 0x10003\n");
5934 HFONT
hfont, hfont_prev;
5939 memset(&lf, 0,
sizeof(lf));
5950 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5980 skip(
"Failed to create ttf file for testing\n");
5984 trace(
"created %s\n", ttf_name);
5987 ok(!
ret,
"font wine_test should not be enumerated\n");
5999 ok(!
ret,
"CreateScalableFontResource() should fail\n");
6004 ok(!
ret,
"CreateScalableFontResource() should fail\n");
6007 file_part =
strrchr(ttf_name,
'\\');
6010 ok(!
ret,
"CreateScalableFontResource() should fail\n");
6015 ok(!
ret,
"CreateScalableFontResource() should fail\n");
6020 ok(!
ret,
"CreateScalableFontResource() should fail\n");
6027 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
6035 ok(!
ret,
"font wine_test should not be enumerated\n");
6042 ok(
ret,
"font wine_test should be enumerated\n");
6050 ok(!
ret,
"RemoveFontResourceEx() with not matching flags should fail\n");
6057 ok(!
ret,
"font wine_test should not be enumerated\n");
6060 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
6063 for (
i = 0;
i < 5;
i++)
6069 for (
i = 0;
i < 5;
i++)
6076 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
6086 ok(!
ret,
"font wine_test should not be enumerated\n");
6094 ok(!
ret,
"font wine_test should not be enumerated\n");
6102 ok(!
ret,
"font wine_test should not be enumerated\n");
6105 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
6114 HFONT
hfont, hfont_prev;
6118 static const WCHAR str[] = { 0x2025 };
6138 ok(
hfont !=
NULL,
"CreateFontIndirectA failed\n");
6143 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
6146 ok(
ret,
"GetTextFaceA failed\n");
6152 memset(gm, 0,
sizeof *gm);
6165 HFONT
hfont, hfont_prev;
6173 USHORT numOfLongVerMetrics;
6177 memset(&lf, 0,
sizeof(lf));
6187 ok(
ret,
"GetCharABCWidthsW failed\n");
6190 memset(&lf, 0,
sizeof(lf));
6200 ok(
ret,
"GetCharABCWidthsW failed\n");
6206 "expected %d, got %d\n",
6209 memset(&otm, 0,
sizeof(otm));
6212 ok(
ret != 0,
"GetOutlineTextMetricsA failed\n");
6215 &numOfLongVerMetrics,
sizeof(numOfLongVerMetrics)) !=
GDI_ERROR) {
6217 SHORT topSideBearing;
6220 ok(
ret != 0,
"GetGlyphIndicesW failed\n");
6221 numOfLongVerMetrics =
GET_BE_WORD(numOfLongVerMetrics);
6222 if (numOfLongVerMetrics >
idx)
6225 offset = numOfLongVerMetrics * 2 + (
idx - numOfLongVerMetrics);
6227 &topSideBearing,
sizeof(
SHORT));
6232 "expected %d, got %ld\n",
6238 "got %ld, expected rgm.origin.x(%ld) + vgm.cellIncX(%d) + descent(%d)\n",
6243 "got %d, expected abcA(%d) + abcB(%u) + descent(%d)\n",
6257 const char* face_list[] = {
6258 "@WineTestVertical",
6265 skip(
"Failed to create ttf file for testing\n");
6270 ok(
num == 2,
"AddFontResourceExA should add 2 fonts from vertical.ttf\n");
6273 ok(installed,
"WineTestVertical is not installed\n");
6274 ok(
selected,
"WineTestVertical is not selected\n");
6276 "gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n",
6280 ok(installed,
"@WineTestVertical is not installed\n");
6281 ok(
selected,
"@WineTestVertical is not selected\n");
6283 "gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n",
6286 ok(hgi != vgi,
"same glyph h:%u v:%u\n", hgi, vgi);
6289 const char*
face = face_list[
i];
6291 skip(
"%s is not installed\n",
face);
6328 memset(&lf, 0,
sizeof lf);
6334 skip(
"Vertical font for charset %u is not installed\n",
charset[
i]);
6340 memset(face_name, 0,
sizeof face_name);
6342 ok(
ret && face_name[0] !=
'@',
6343 "expected non-vertical face for charset %u, got %s\n",
charset[
i], face_name);
6346 memset(&lf, 0,
sizeof lf);
6351 memset(face_name, 0,
sizeof face_name);
6353 ok(
ret && face_name[0] ==
'@',
6354 "expected vertical face for charset %u, got %s\n",
charset[
i], face_name);
6368 ok(
hfont != 0,
"CreateFontIndirect failed\n");
6372 ok(
ret,
"GetTextMetrics failed\n");
6373 ret =
tm.tmDigitizedAspectX;
6384 static const int font[] =
6455 ok(
hfont != 0,
"%d: GetStockObject(%d) failed\n",
i,
font[
i]);
6458 ok(
ret ==
sizeof(lf),
"%d: GetObject returned %d instead of sizeof(LOGFONT)\n",
i,
ret);
6460 for (
j = 0; td[
i][
j].face_name[0] != 0;
j++)
6472 trace(
"%d(%d): font %s %d dpi doesn't match test data %d\n",
6480 ((!
strcmp(td[
i][
j].face_name,
"MS Sans Serif") && td[
i][
j].
height == 12) ||
6483 ok(
height == td[
i][
j].height_pixels,
"%d(%d): expected height %d, got %d\n",
i,
j, td[
i][
j].height_pixels,
height);
6487 if (td[
i][
j].face_name[0] ==
'?')
6507 HFONT
hfont, hfont_old;
6510 LONG invalid_height[] = { -65536, -123456, 123456 };
6513 memset(&tm1, 0,
sizeof(tm1));
6514 memset(&lf, 0,
sizeof(lf));
6524 ok(
r,
"GetTextMetrics failed\n");
6535 ok(
r,
"GetTextMetrics failed\n");
6537 "expected greater than 1 ppem value (%ld), got %ld\n", tm1.
tmHeight,
tm.tmHeight);
6539 "expected greater than 1 ppem value (%ld), got %ld\n", tm1.
tmAveCharWidth,
tm.tmAveCharWidth);
6552 ok(
r,
"GetTextMetrics failed\n");
6554 "expected 1 ppem value (%ld), got %ld\n", tm1.
tmHeight,
tm.tmHeight);
6556 "expected 1 ppem value (%ld), got %ld\n", tm1.
tmAveCharWidth,
tm.tmAveCharWidth);
6574 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
6584 memset( &efd, 0,
sizeof(efd) );
6593 ok(
i >
j,
"Found vertical font %s before its horizontal version\n", efd.
lf[
i].
lfFaceName);
6621 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6623 ok(
ret,
"GetCharWidth32A should have succeeded\n");
6624 ok (bufferA == bufferW,
"Widths should be the same\n");
6625 ok (bufferA > 0,
" Width should be greater than zero\n");
6643 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6644 ok (bufferW > 0,
" Width should be greater than zero\n");
6648 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6649 ok (bufferW > 0,
" Width should be greater than zero\n");
6652 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6653 ok (bufferW > 0,
" Width should be greater than zero\n");
6657 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6658 ok (bufferW > 0,
" Width should be greater than zero\n");
6661 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6662 ok (bufferW > 0,
" Width should be greater than zero\n");
6674 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6675 ok (bufferW > 0,
" Width should be greater than zero\n");
6679 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6680 ok (bufferW > 0,
" Width should be greater than zero\n");
6683 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6684 ok (bufferW > 0,
" Width should be greater than zero\n");
6688 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6689 ok (bufferW > 0,
" Width should be greater than zero\n");
6692 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6693 ok (bufferW > 0,
" Width should be greater than zero\n");
6702 static const MAT2 x2_mat = { {0,2}, {0,0}, {0,0}, {0,2} };
6716 memset(&lf, 0,
sizeof(lf));
6722 for (
i = 0;
i <= 1;
i++)
6724 HFONT
hfont, hfont_old;
6745 "expected %ld, got %ld\n",
data[0].tm.tmHeight,
data[1].tm.tmHeight);
6747 "expected %ld, got %ld\n",
data[0].tm.tmAscent,
data[1].tm.tmAscent);
6749 "expected %ld, got %ld\n",
data[0].tm.tmDescent,
data[1].tm.tmDescent);
6750 ok(
data[0].
tm.tmAveCharWidth + 1 ==
data[1].tm.tmAveCharWidth,
6751 "expected %ld, got %ld\n",
data[0].tm.tmAveCharWidth + 1,
data[1].tm.tmAveCharWidth);
6752 ok(
data[0].
tm.tmMaxCharWidth + 1 ==
data[1].tm.tmMaxCharWidth,
6753 "expected %ld, got %ld\n",
data[0].tm.tmMaxCharWidth + 1,
data[1].tm.tmMaxCharWidth);
6755 "expected %ld, got %ld\n",
data[0].tm.tmOverhang,
data[1].tm.tmOverhang);
6757 "expected %d, got %d\n",
data[0].
w + 1,
data[1].
w);
6759 ok(
data[0].gm.gmCellIncX + 1 ==
data[1].gm.gmCellIncX,
6760 "expected %d, got %d\n",
data[0].gm.gmCellIncX + 1,
data[1].gm.gmCellIncX);
6761 ok(
data[0].gm.gmCellIncY ==
data[1].gm.gmCellIncY,
6762 "expected %d, got %d\n",
data[0].gm.gmCellIncY,
data[1].gm.gmCellIncY);
6766 memset(&lf, 0,
sizeof(lf));
6772 for (
i = 0;
i < 4;
i++)
6774 HFONT
hfont, hfont_old;
6792 for (
i = 0;
i < 4;
i+=2)
6797 skip(
"TrueType font is selected (expected a bitmap one)\n");
6801 "expected %ld, got %ld\n",
data[
i].tm.tmHeight,
data[
i+1].tm.tmHeight);
6803 "expected %ld, got %ld\n",
data[
i].tm.tmAscent,
data[
i+1].tm.tmAscent);
6805 "expected %ld, got %ld\n",
data[
i].tm.tmDescent,
data[
i+1].tm.tmDescent);
6806 ok(
data[
i+1].
tm.tmAveCharWidth -
data[
i].tm.tmAveCharWidth == diff,
6807 "expected %d, got %ld\n", diff,
data[
i+1].tm.tmAveCharWidth -
data[
i].tm.tmAveCharWidth);
6808 ok(
data[
i+1].
tm.tmMaxCharWidth -
data[
i].tm.tmMaxCharWidth == diff,
6809 "expected %d, got %ld\n", diff,
data[
i+1].tm.tmMaxCharWidth -
data[
i].tm.tmMaxCharWidth);
6811 "expected 0, got %ld\n",
data[
i].tm.tmOverhang);
6813 "expected 1, got %ld\n",
data[
i+1].tm.tmOverhang);
6825 } bitmap_font_list[] = {
6846 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
6848 memset(&bmi, 0,
sizeof(bmi));
6857 memset(&lf, 0,
sizeof(lf));
6864 ok(
ret,
"GetTextMetric failed\n");
6866 ok(
ret,
"GetTextFace failed\n");
6868 skip(
"TrueType font (%s) was selected for \"%s\"\n", facename, bitmap_font_list[
i].
face);
6876 for (
j = 0;
j < 2;
j++) {
6879 ok(hBmp[
j] !=
NULL,
"Can't create DIB\n");
6890 ok(
ret,
"GetGlyphIndices failed\n");
6892 "Glyph indices and text are different for %s:%d\n", lf.
lfFaceName,
tm.tmCharSet);
6898 ok(
ret,
"ExtTextOutW failed\n");
6904 "Images are different (%s:%d)\n", lf.
lfFaceName,
tm.tmCharSet);
6912 skip(
"High-ascii character is not defined in codepage %d\n", ci.
ciACP);
6916 for (
j = 0;
j < 2;
j++) {
6926 ok(
ret,
"GetGlyphIndices failed\n");
6931 ok(
ret,
"ExtTextOutA failed\n");
6936 "Images are different (%s:%d)\n", lf.
lfFaceName,
tm.tmCharSet);
6938 for (
j = 0;
j < 2;
j++)
6949 static const char *teststr =
"wine ";
6950 HFONT
hfont, prev_hfont;
6961 memset(&lf, 0,
sizeof(lf));
6972 ok(nb ==
len,
"\n");
6974 memset(abc, 0xcc,
sizeof(abc));
6976 ok(
ret,
"GetCharABCWidthsI failed\n");
6978 memset(&abc1, 0xcc,
sizeof(abc1));
6980 ok(
ret,
"GetCharABCWidthsI failed\n");
6981 ok(!
memcmp(&abc1, abc,
sizeof(abc1)),
"unexpected abc1\n");
6983 memset(widths, 0xcc,
sizeof(widths));
6985 ok(
ret,
"GetCharWidthI failed\n");
6989 ok(
ret,
"GetCharWidthI failed\n");
6990 ok(
width == widths[0],
"unexpected width %u\n",
width);
6992 for (
i = 0;
i <
len;
i++)
6993 ok(widths[
i] == abc[
i].abcA + abc[
i].abcB + abc[
i].abcC,
"%u, glyph %u, got width %d\n",
6994 i, glyphs[
i], widths[
i]);
7018 skip(
"Failed to create ttf file for testing\n");
7025 ok(
ret,
"AddFontResourceEx() failed\n");
7027 strcpy(
font.lfFaceName,
"wine_3_this_is_a_very_long_name");
7030 ok(found_font ==
TRUE,
"EnumFontFamiliesExA didn't find font.\n");
7032 strcpy(
font.lfFaceName,
"wine_2_this_is_a_very_long_name");
7035 ok(found_font ==
TRUE,
"EnumFontFamiliesExA didn't find font.\n");
7037 strcpy(
font.lfFaceName,
"wine_1_this_is_a_very_long_name");
7040 ok(found_font ==
FALSE,
"EnumFontFamiliesExA must not find font.\n");
7043 ok(handle_font !=
NULL,
"CreateFontIndirectA failed\n");
7047 ok(
ret,
"RemoveFontResourceEx() failed\n");
7064 skip(
"Failed to create ttf file for testing\n");
7070 skip(
"Failed to create ttf file for testing\n");
7076 ok(
ret,
"AddFontResourceEx() failed\n");
7079 ok(
ret,
"AddFontResourceEx() failed\n");
7083 strcpy(
font.lfFaceName,
"Wine_TTF_Names_Long_Family1_Con");
7084 memset(&efnd, 0,
sizeof(efnd));
7086 ok(efnd.
total == 0,
"EnumFontFamiliesExA must not find font.\n");
7089 strcpy(
font.lfFaceName,
"Wine TTF Names Long Family1");
7090 memset(&efnd, 0,
sizeof(efnd));
7092 ok(efnd.
total == 0,
"EnumFontFamiliesExA must not find font.\n");
7094 strcpy(
font.lfFaceName,
"Wine TTF Names Long Family1 Ext");
7095 memset(&efnd, 0,
sizeof(efnd));
7097 ok(efnd.
total == 2,
"EnumFontFamiliesExA found %d fonts, expected 2.\n", efnd.
total);
7099 strcpy(
font.lfFaceName,
"Wine TTF Names Long Family1 Con");
7100 memset(&efnd, 0,
sizeof(efnd));
7102 ok(efnd.
total == 2,
"EnumFontFamiliesExA found %d fonts, expected 2.\n", efnd.
total);
7105 ok(handle_font !=
NULL,
"CreateFontIndirectA failed\n");
7109 ok(
ret,
"RemoveFontResourceEx() failed\n");
7114 ok(
ret,
"RemoveFontResourceEx() failed\n");
7122 static const WCHAR name_cond_ja_w[] =
L"\x30d5\x30a9\x30f3\x30c8\x540d Cond (ja)";
7123 static const WCHAR name_cond_ja_reg_w[] =
L"\x30d5\x30a9\x30f3\x30c8\x540d Cond (ja) Reg";
7124 static const WCHAR name_cond_ja_reg_ja_w[] =
L"\x30d5\x30a9\x30f3\x30c8\x540d Cond (ja) Reg (ja)";
7125 static const WCHAR name_wws_ja_w[] =
L"\x30d5\x30a9\x30f3\x30c8\x540d WWS (ja)";
7134 const WCHAR *primary_family, *primary_fullname;
7138 skip(
"Primary language is neither English nor Japanese, skipping test\n" );
7144 skip(
"Failed to create ttf file for testing\n" );
7150 skip(
"Failed to create ttf file for testing\n" );
7157 skip(
"Failed to create ttf file for testing\n" );
7164 ok(
ret,
"AddFontResourceEx() failed\n" );
7170 primary_family =
L"Wine Lang Cond (en)";
7171 primary_fullname =
L"Wine Lang Cond Reg (en)";
7175 primary_family = name_cond_ja_w;
7176 primary_fullname = name_cond_ja_reg_w;
7179 for (
i = 0;
i < 3; ++
i)
7184 memset( &efnd, 0,
sizeof(efnd) );
7186 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7188 strcpy(
font.lfFaceName,
"Wine Lang Condensed Bold (ko)" );
7189 memset( &efnd, 0,
sizeof(efnd) );
7191 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7194 memset( &efnd_w, 0,
sizeof(efnd_w) );
7196 ok( efnd_w.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd_w.total );
7198 strcpy(
font.lfFaceName,
"Reg WWS (zh-tw)" );
7199 memset( &efnd, 0,
sizeof(efnd) );
7201 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7203 strcpy(
font.lfFaceName,
"Wine Lang (en) Reg WWS (en)" );
7204 memset( &efnd, 0,
sizeof(efnd) );
7206 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7208 strcpy(
font.lfFaceName,
"WineLangNamesRegular" );
7209 memset( &efnd, 0,
sizeof(efnd) );
7211 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7216 memset( &efnd_w, 0,
sizeof(efnd_w) );
7218 ok( efnd_w.total ==
min( 2,
i + 1 ),
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd_w.total );
7223 memset( &efnd_w, 0,
sizeof(efnd_w) );
7225 ok( efnd_w.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd_w.total );
7230 strcpy(
font.lfFaceName,
"Wine_Lang_Names" );
7231 memset( &efnd, 0,
sizeof(efnd) );
7234 ok( efnd.total == 1,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7236 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7241 memset( &efnd_w, 0,
sizeof(efnd_w) );
7243 ok( efnd_w.total == 1,
"%d: EnumFontFamiliesExW unexpected count %u.\n",
i, efnd_w.total );
7245 if (efnd_w.total >= 1)
7247 ok( !
wcscmp( (
WCHAR *)efnd_w.elf[0].elfLogFont.lfFaceName, primary_family ),
7248 "%d: (%d) unexpected lfFaceName %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[0].elfLogFont.lfFaceName) );
7249 ok( !
wcscmp( (
WCHAR *)efnd_w.elf[0].elfFullName, primary_fullname ),
7250 "%d: (%d) unexpected elfFullName %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[0].elfFullName) );
7252 "%d: (%d) unexpected elfStyle %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[0].elfStyle) );
7258 memset( &efnd_w, 0,
sizeof(efnd_w) );
7260 ok( efnd_w.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd_w.total );
7264 memset( &efnd_w, 0,
sizeof(efnd_w) );
7266 ok( efnd_w.total ==
i,
"%d: EnumFontFamiliesExW unexpected count %u.\n",
i, efnd_w.total );
7268 while (efnd_w.total--)
7270 ok( !
wcscmp( (
WCHAR *)efnd_w.elf[efnd_w.total].elfLogFont.lfFaceName, efnd_w.total == 1 ?
L"Wine_Lang_Names" : primary_family ),
7271 "%d: (%d) unexpected lfFaceName %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[efnd_w.total].elfLogFont.lfFaceName) );
7272 ok( !
wcscmp( (
WCHAR *)efnd_w.elf[efnd_w.total].elfFullName,
L"Wine_Lang_Names_Regular" ),
7273 "%d: (%d) unexpected elfFullName %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[efnd_w.total].elfFullName) );
7275 ok( !
wcscmp( (
WCHAR *)efnd_w.elf[efnd_w.total].elfStyle, efnd_w.total == 1 ?
L"Regular" :
L"Reg (en)" ),
7276 "%d: (%d) unexpected elfStyle %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[efnd_w.total].elfStyle) );
7279 "%d: (%d) unexpected elfStyle %s\n",
i, efnd_w.total,
debugstr_w((
WCHAR *)efnd_w.elf[0].elfStyle) );
7285 memset( &efnd_w, 0,
sizeof(efnd_w) );
7287 ok( efnd_w.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd_w.total );
7294 strcpy(
font.lfFaceName,
"Wine Lang Cond (zh-tw)" );
7295 memset( &efnd, 0,
sizeof(efnd) );
7298 ok( efnd.total ==
min( 2,
i + 1 ),
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7300 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7302 strcpy(
font.lfFaceName,
"Wine Lang Cond (en)" );
7303 memset( &efnd, 0,
sizeof(efnd) );
7306 ok( efnd.total ==
min( 2,
i + 1 ),
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7309 memset( &efnd_w, 0,
sizeof(efnd_w) );
7312 if (
i == 2)
ok( efnd_w.total == 1,
"%d: EnumFontFamiliesExW unexpected count %u.\n",
i, efnd_w.total );
7313 else ok( efnd_w.total == 0,
"%d: EnumFontFamiliesExW unexpected count %u.\n",
i, efnd_w.total );
7319 memset( &efnd_w, 0,
sizeof(efnd_w) );
7321 ok( efnd_w.total == 1,
"%d: EnumFontFamiliesExW unexpected count %u.\n",
i, efnd_w.total );
7324 strcpy(
font.lfFaceName,
"Wine Lang Cond (ko)" );
7325 memset( &efnd, 0,
sizeof(efnd) );
7327 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7331 strcpy(
font.lfFaceName,
"Wine Lang Cond Reg (zh-tw)" );
7332 memset( &efnd, 0,
sizeof(efnd) );
7334 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7336 strcpy(
font.lfFaceName,
"Wine Lang Cond Reg (fr)" );
7337 memset( &efnd, 0,
sizeof(efnd) );
7339 ok( efnd.total == 0,
"%d: EnumFontFamiliesExA unexpected count %u.\n",
i, efnd.total );
7344 ok(
ret,
"AddFontResourceEx() failed\n" );
7349 ok(
ret,
"AddFontResourceEx() failed\n" );
7354 ok(
ret,
"RemoveFontResourceEx() failed\n" );
7359 ok(
ret,
"RemoveFontResourceEx() failed\n" );
7364 ok(
ret,
"RemoveFontResourceEx() failed\n" );
7392 HFONT
hfont, hfont_prev;
7402 SHORT minLeftSideBearing, minRightSideBearing;
7404 const char* face_list[] = {
"Symbol",
"Ume Gothic",
"MS Gothic" };
7406 if (!pGetCharWidthInfo)
7408 win_skip(
"GetCharWidthInfo is unavailable\n");
7419 ok(
info.lsb == 0,
"expected 0, got %d\n",
info.lsb);
7420 ok(
info.rsb == 0,
"expected 0, got %d\n",
info.rsb);
7421 ok(
info.unk == 0,
"expected 0, got %d\n",
info.unk);
7424 memset(&lf, 0,
sizeof(lf));
7430 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
7433 ok(
ret != 0,
"GetOutlineTextMetricsA failed\n");
7440 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
7443 ok(
ret ==
sizeof(hhea),
"got %lu\n",
ret);
7449 ok(
r,
"GetCharWidthInfo failed\n");
7450 ok(
info.lsb == minLeftSideBearing,
"expected %d, got %d\n", minLeftSideBearing,
info.lsb);
7451 ok(
info.rsb == minRightSideBearing,
"expected %d, got %d\n", minRightSideBearing,
info.rsb);
7459 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
7461 memset(&info2, 0xaa,
sizeof(info2));
7462 r = pGetCharWidthInfo(
hdc, &info2);
7463 ok(
r,
"pGetCharWidthInfo failed\n");
7464 ok(info2.lsb ==
info.lsb/3,
"expected %d, got %d\n",
info.lsb/3, info2.lsb);
7465 ok(info2.rsb ==
info.rsb/3,
"expected %d, got %d\n",
info.rsb/3, info2.rsb);
7480 memset(&lf, 0,
sizeof(lf));
7487 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
7489 memset(&info2, 0xaa,
sizeof(info2));
7490 r = pGetCharWidthInfo(
hdc, &info2);
7491 ok(
r,
"GetCharWidthInfo failed\n");
7495 ok(
pt[0].
x == info2.lsb,
"expected %ld, got %d\n",
pt[0].x, info2.lsb);
7496 ok(
pt[1].
x == info2.rsb,
"expected %ld, got %d\n",
pt[1].x, info2.rsb);
7505 const char*
face = face_list[
i];
7508 skip(
"%s is not installed\n",
face);
7511 memset(&lf, 0,
sizeof(lf));
7522 ok(
r,
"%s: GetCharWidthInfo failed\n",
face);
7530 memset(&info2, 0xaa,
sizeof(info2));
7531 r = pGetCharWidthInfo(
hdc, &info2);
7532 ok(
r,
"%s: GetCharWidthInfo failed\n",
face);
7533 ok(
info.lsb == info2.lsb,
"%s: expected %d, got %d\n",
face,
info.lsb, info2.lsb);
7534 ok(
info.rsb == info2.rsb,
"%s: expected %d, got %d\n",
face,
info.rsb, info2.rsb);
7542 memset(&info2, 0xaa,
sizeof(info2));
7543 r = pGetCharWidthInfo(
hdc, &info2);
7544 ok(
r,
"%s: GetCharWidthInfo failed\n",
face);
7581 ok(
i == i32,
"%s: mismatched widths %d/%d\n", lf->
lfFaceName,
i, i32);
7582 ok((
float)
i / 16.0f ==
f,
"%s: mismatched widths %d/%.8e\n", lf->
lfFaceName,
i,
f);
7587 skip(
"broken Noto Color Emoji font");
7610 HFONT
hfont, hfont_old;
7616 int kern[30],
pos[30], pos_kern[30],
dx[30], dx_kern[30], kern_amount;
7620 skip(
"Arial is not installed, skipping the test\n");
7626 memset(&lf, 0,
sizeof(lf));
7643 if (kp[
i].wFirst >=
'A' && kp[
i].wFirst <=
'z' &&
7644 kp[
i].wSecond >=
'A' && kp[
i].wSecond <=
'z')
7666 ok(
ret,
"GetCharacterPlacement failed\n");
7672 result.lpCaretPos = pos_kern;
7676 ok(
ret,
"GetCharacterPlacement failed\n");
7680 if (
width == width_kern)
7682 win_skip(
"GCP_USEKERNING is broken on this platform\n");
7686 ok(
width + kern_amount == width_kern,
"%ld + %d != %ld\n",
width, kern_amount, width_kern);
7688 kern_amount =
idx = 0;
7691 ok(
pos[
i] + kern_amount == pos_kern[
i],
"%ld: %d + %d != %d\n",
i,
pos[
i], kern_amount, pos_kern[
i]);
7692 kern_amount += kern[
idx];
7693 ok(
pos[
i+1] + kern_amount == pos_kern[
i+1],
"%ld: %d + %d != %d\n",
i,
pos[
i+1], kern_amount, pos_kern[
i+1]);
7694 ok(
pos[
i+2] + kern_amount == pos_kern[
i+2],
"%ld: %d + %d != %d\n",
i,
pos[
i+2], kern_amount, pos_kern[
i+2]);
7696 ok(
dx[
i] + kern[
idx] == dx_kern[
i],
"%ld: %d + %d != %d\n",
i,
dx[
i], kern[
idx], dx_kern[
i]);
7697 ok(
dx[
i+1] == dx_kern[
i+1],
"%ld: %d != %d\n",
i,
dx[
i+1], dx_kern[
i+1]);
7698 ok(
dx[
i+2] == dx_kern[
i+2],
"%ld: %d != %d\n",
i,
dx[
i+2], dx_kern[
i+2]);
7709 HFONT
hfont, old_font;
7712 memset(&lf, 0,
sizeof lf);
7726 ok(!old_font,
"SelectObject returned %p\n", old_font);
7737 HFONT
hfont, hfont_old;
7745 skip(
"MS Shell Dlg is not installed\n");
7750 memset(&lf, 0,
sizeof(lf));
7759 ok(
ret,
"GetTextFace failed\n");
7765 ok(
ret != 0,
"GetOutlineTextMetrics failed\n");
7782 int *called = (
int *)
lparam;
7795 HFONT hfont1, hfont2, old;
7805 ok(bret,
"Failed to create test font file.\n");
7812 memset(&lf, 0,
sizeof(lf));
7820 ok(enum_called,
"font not found.\n");
7825 ok(enum_called,
"font not found.\n");
7833 memset(&tm1, 0,
sizeof(tm1));
7836 memset(&tm2, 0,
sizeof(tm2));
7850 static const char *test_names[] =
7852 "AddFontMemResource",
7875 skip(
"FIXME: ReactOS does not support bitmap (raster) fonts at this time\n");
7912 skip(
"Arial Black or Symbol/Wingdings is not installed\n");
7960 ok(
CreateProcessA(
NULL,
path_name,
NULL,
NULL,
FALSE, 0,
NULL,
NULL, &
startup, &
info),
7961 "CreateProcess failed.\n");
static void startup(void)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
_Out_opt_ UINT * code_page
#define ERROR_INSUFFICIENT_BUFFER
static char selected[MAX_PATH+1]
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static const WCHAR version[]
#define TT_APPLE_ID_ISO_10646
static WORD get_mac_code_page(const tt_name_record *name)
#define TT_MAC_ID_SIMPLIFIED_CHINESE
#define TT_MS_ID_UNICODE_CS
#define TT_PLATFORM_MICROSOFT
#define TT_APPLE_ID_DEFAULT
#define TT_APPLE_ID_UNICODE_2_0
#define TT_PLATFORM_MACINTOSH
#define TT_MS_ID_SYMBOL_CS
static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
static int match_name_table_language(const tt_name_record *name, LANGID lang)
#define TT_PLATFORM_APPLE_UNICODE
static const LANGID mac_langid_table[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
LANGID WINAPI GetSystemDefaultLangID(void)
BOOL WINAPI IsValidCodePage(UINT codepage)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI IsDBCSLeadByteEx(UINT codepage, BYTE testchar)
LANGID WINAPI GetUserDefaultLangID(void)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
_ACRTIMP char *__cdecl strrchr(const char *, int)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
static char * path_name(DOS_FILE *file)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum GLenum mapping
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static struct test_info tests[]
static void test_height(void)
static void get_charset_stats(struct enum_font_data *efd, int *ansi_charset, int *symbol_charset, int *russian_charset)
static void test_GetGlyphOutline(void)
static void test_GetCharacterPlacement_kerning(void)
static void test_lang_names(void)
static void test_nonexistent_font(void)
static INT CALLBACK arial_enum_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam)
#define TT_NAME_ID_FULL_NAME
static void test_GetTextFace(void)
static WCHAR * prepend_at(WCHAR *family)
static void test_east_asian_font_selection(void)
static void test_GetGlyphOutline_character(void)
static void test_GdiGetCharDimensions(void)
static void test_GetTextMetrics(void)
static void test_font_weight(void)
static void test_GetGlyphOutline_empty_contour(void)
static INT CALLBACK is_truetype_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
#define TT_MS_LANGID_ENGLISH_UNITED_STATES
static INT CALLBACK enum_font_data_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void * get_res_data(const char *fontname, DWORD *rsrc_size)
static void *static DWORD *static DWORD *static void SIZE_T *static UINT64
static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
static void test_GetGlyphIndices(void)
static void test_GetCharWidthInfo(void)
static INT CALLBACK has_vertical_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void test_fstype_fixup(void)
static void * load_font(const char *font_name, DWORD *font_size)
static int CALLBACK get_char_width_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM ctx)
static void check_font(const char *test, const LOGFONTA *lf, HFONT hfont)
static void test_GetCharacterPlacement(void)
static BOOL write_ttf_file(const char *fontname, char *tmp_name)
static void test_font_charset(void)
static void * get_cmap(cmap_header *header, USHORT plat_id, USHORT enc_id)
static void get_seg4(cmap_format_4 *cmap, USHORT seg_num, cmap_format_4_seg *seg)
static WORD system_lang_id
static INT CALLBACK enum_fullname_data_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static INT CALLBACK enum_fullname_data_proc_w(const LOGFONTW *lf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
static void test_EnumFontFamilies(const char *font_name, INT font_charset)
static void test_logfont(void)
static BOOL is_font_installed_fullname(const char *family, const char *fullname)
static void get_charset_statsW(struct enum_font_dataW *efd, int *ansi_charset, int *symbol_charset, int *russian_charset)
static INT CALLBACK enum_truetype_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static HFONT create_font(const char *test, const LOGFONTA *lf)
static BOOL get_first_last_from_cmap4(void *ptr, DWORD *first, DWORD *last, DWORD limit)
static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size, LCID language_id)
static LPTEXTMETRICW lptm
static void test_select_object(void)
static void test_orientation(void)
static void test_GetOutlineTextMetrics_subst(void)
static INT CALLBACK enum_with_magic_retval_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
static void test_max_height(void)
static void test_fake_bold_font(void)
static void test_CreateFontIndirect(void)
static void test_height_selection_vdmx(HDC hdc)
static void test_GdiGetCodePage(void)
static INT CALLBACK long_enum_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM lparam)
static void test_GetFontUnicodeRanges(void)
static void *static DWORD *static DWORD *static void SIZE_T
static void test_EnumFonts_subst(void)
static void test_ttf_names(void)
static void test_RealizationInfo(void)
static void test_EnumFonts(void)
static INT CALLBACK enum_ms_shell_dlg_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void test_fullname2_helper(const char *Family)
static void * find_ttf_table(void *ttf, DWORD size, DWORD tag)
static void test_TranslateCharsetInfo(void)
static void test_AddFontMemResource(void)
static void test_GetGlyphOutline_metric_clipping(void)
#define match_off_by_1(a, b, exact)
static void test_negative_width(HDC hdc, const LOGFONTA *lf)
static void test_outline_font(void)
static void test_height_selection(void)
static int CALLBACK create_fixed_pitch_font_proc(const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
static void check_vertical_metrics(const char *face)
#define TT_NAME_ID_UNIQUE_ID
static int CALLBACK create_font_proc(const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
static void test_CreateFontIndirectEx(void)
static INT CALLBACK enum_ms_shell_dlg2_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void test_GetCharWidthI(void)
static void testJustification(const char *context, HDC hdc, PCSTR str, RECT *clientArea)
#define expect(expected, got)
static INT CALLBACK test_font_weight_enum(const LOGFONTW *lf, const TEXTMETRICW *tm, DWORD type, LPARAM lparam)
static INT CALLBACK font_enum_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
#define TT_NAME_ID_FONT_FAMILY
static INT CALLBACK arial_enum_procw(const LOGFONTW *lf, const TEXTMETRICW *tm, DWORD type, LPARAM lParam)
static INT CALLBACK enum_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
static void test_oemcharset(void)
static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V4 *os2, WORD family, const char *name)
static void ABCWidths_helper(const char *description, HDC hdc, WORD *glyphs, const ABC *base_abci, const ABC *base_abcw, const ABCFLOAT *base_abcf)
static INT CALLBACK is_font_installed_fullname_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static void test_fullname2(void)
static void test_GetOutlineTextMetrics(void)
static BOOL is_truetype_font_installed(const char *name)
static BOOL get_glyph_indices(INT charset, UINT code_page, WORD *idx, UINT count, BOOL unicode)
static void free_font(void *font)
static void test_bitmap_font_metrics(void)
static void test_SetTextJustification(void)
static void test_text_extents(void)
static BOOL get_first_last_from_cmap(HDC hdc, DWORD *first, DWORD *last, cmap_type *cmap_type)
static void test_realization_info(const char *name, DWORD size, BOOL is_memory_resource)
static void test_stock_fonts(void)
static BOOL get_first_last_from_cmap0(void *ptr, DWORD *first, DWORD *last)
static UINT get_font_fsselection(LOGFONTA *lf)
static void check_vertical_font(const char *name, BOOL *installed, BOOL *selected, GLYPHMETRICS *gm, WORD *gi)
static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
static void test_long_names(void)
static void compare_tm(const TEXTMETRICA *tm, const TEXTMETRICA *otm)
static BOOL match_off_by_n(int a, int b, unsigned int n)
static void test_bitmap_font(void)
static void test_GetTextMetrics2(const char *fontname, int font_height)
static void test_EnumFontFamiliesEx_default_charset(void)
static BOOL is_font_installed(const char *name)
static void test_GetCharABCWidths(void)
static INT CALLBACK enum_multi_charset_font_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam)
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
static void test_bitmap_font_glyph_index(void)
static void test_vertical_order(void)
static void test_fullname(void)
static void test_CreateScalableFontResource(void)
static void test_char_width(void)
static void test_GetCharWidth32(void)
static int get_font_dpi(const LOGFONTA *lf, int *height)
static void test_vertical_font(void)
static BOOL write_tmp_file(const void *data, DWORD *size, char *tmp_name)
static void test_GetKerningPairs(void)
#define TT_NAME_ID_FONT_SUBFAMILY
static void test_font_metrics(void)
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static const char * testtext
unsigned __int3264 UINT_PTR
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define LANG_SCOTTISH_GAELIC
_Out_opt_ int _Out_opt_ int * cy
static unsigned __int64 next
#define SUBLANG_DUTCH_BELGIAN
#define LANG_CHINESE_SIMPLIFIED
#define LANG_CHINESE_TRADITIONAL
#define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA
#define SUBLANG_AZERI_CYRILLIC
#define SUBLANG_IRISH_IRELAND
#define SUBLANG_AZERI_LATIN
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
USHORT usLowerOpticalPointSize
SHORT ySuperscriptXOffset
SHORT ySuperscriptYOffset
USHORT usUpperOpticalPointSize
TEXTMETRICA otmTextMetrics
TEXTMETRICW otmTextMetrics
const char face_name[LF_FACESIZE]
BITMAPINFOHEADER bmiHeader
BYTE elfStyle[LF_FACESIZE]
BYTE elfFullName[LF_FULLFACESIZE]
ENUMLOGFONTEXA elfEnumLogfontEx
CHAR lfFaceName[LF_FACESIZE]
T1_FIELD_DICT_FONTDICT family_name
#define FIELD_OFFSET(t, f)
#define INVALID_FILE_ATTRIBUTES
static const WCHAR lang[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
DWORD WINAPI GetFontData(HDC hdc, DWORD dwTable, DWORD dwOffset, LPVOID lpvBuffer, DWORD cbData)
BOOL WINAPI RemoveFontResourceExA(_In_ LPCSTR lpFileName, _In_ DWORD fl, _In_opt_ PVOID pdv)
BOOL WINAPI RemoveFontMemResourceEx(HANDLE fh)
DWORD WINAPI GetLastError(void)
#define ERROR_FILE_EXISTS
#define ERROR_CAN_NOT_COMPLETE
BOOL WINAPI GetTextExtentExPointI(_In_ HDC hdc, _In_reads_(cwchString) LPWORD lpwszString, _In_ int cwchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cwchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
int WINAPI SetMapMode(_In_ HDC, _In_ int)
BOOL WINAPI GetCharABCWidthsFloatA(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPABCFLOAT lpABC)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
#define PAN_FAMILY_TEXT_DISPLAY
#define PAN_PROP_MONOSPACED
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI GetCharABCWidthsA(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)
BOOL WINAPI GetCharWidthFloatA(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) PFLOAT lpBuffer)
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
UINT WINAPI GetOutlineTextMetricsA(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICA potm)
int WINAPI GetTextCharsetInfo(_In_ HDC, _Out_opt_ LPFONTSIGNATURE, _In_ DWORD)
#define PAN_SERIF_NORMAL_SANS
BOOL WINAPI GetCharWidthI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPINT piWidths)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI SetGraphicsMode(_In_ HDC, _In_ int)
#define OUT_TT_ONLY_PRECIS
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetCharABCWidthsFloatW(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPABCFLOAT lpABC)
DWORD WINAPI GetCharacterPlacementW(_In_ HDC hdc, _In_reads_(nCount) LPCWSTR lpString, _In_ int nCount, _In_ int nMexExtent, _Inout_ LPGCP_RESULTSW lpResults, _In_ DWORD dwFlags)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
#define PAN_SERIF_OBTUSE_SANS
BOOL WINAPI GetTextExtentExPointA(_In_ HDC hdc, _In_reads_(cchString) LPCSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
#define PAN_FAMILY_PICTORIAL
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
#define TRUETYPE_FONTTYPE
#define PAN_SERIF_TRIANGLE
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
BOOL WINAPI LPtoDP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
int WINAPI EnumFontFamiliesExA(_In_ HDC, _In_ PLOGFONTA, _In_ FONTENUMPROCA, _In_ LPARAM, _In_ DWORD)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI SetTextCharacterExtra(_In_ HDC, _In_ int)
int WINAPI GetTextFaceA(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPSTR lpName)
int WINAPI EnumFontFamiliesW(_In_ HDC, _In_opt_ LPCWSTR, _In_ FONTENUMPROCW, _In_ LPARAM)
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
int WINAPI GetTextCharset(_In_ HDC)
BOOL WINAPI SetTextJustification(_In_ HDC, _In_ int, _In_ int)
#define PAN_SERIF_SQUARE_COVE
BOOL WINAPI ExtTextOutA(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define PAN_SERIF_OBTUSE_SQUARE_COVE
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
#define CHINESEBIG5_CHARSET
#define PAN_SERIF_EXAGGERATED
#define OUT_DEFAULT_PRECIS
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define PAN_SERIF_ROUNDED
BOOL WINAPI GetCharABCWidthsI(_In_ HDC hdc, _In_ UINT giFirst, _In_ UINT cgi, _In_reads_opt_(cgi) LPWORD pgi, _Out_writes_(cgi) LPABC pabc)
#define CLIP_DEFAULT_PRECIS
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
BOOL WINAPI GetCharWidth32A(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
#define PAN_FAMILY_DECORATIVE
#define PAN_SERIF_PERP_SANS
BOOL WINAPI GetTextExtentExPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
#define VIETNAMESE_CHARSET
DWORD WINAPI GetGlyphIndicesA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
DWORD WINAPI GetKerningPairsW(_In_ HDC hdc, _In_ DWORD nPairs, _Out_writes_to_opt_(nPairs, return) LPKERNINGPAIR lpKernPair)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI SetWorldTransform(_In_ HDC, _In_ const XFORM *)
BOOL WINAPI CreateScalableFontResourceA(_In_ DWORD, _In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPCSTR)
#define PAN_FAMILY_SCRIPT
DWORD WINAPI GetCharacterPlacementA(_In_ HDC hdc, _In_reads_(nCount) LPCSTR lpString, _In_ int nCount, _In_ int nMexExtent, _Inout_ LPGCP_RESULTSA lpResults, _In_ DWORD dwFlags)
BOOL WINAPI DeleteDC(_In_ HDC)
INT WINAPI AddFontResourceExA(_In_ LPCSTR pszFilename, _In_ DWORD fl, _Reserved_ PVOID pvReserved)
#define PAN_SERIF_OBTUSE_COVE
BOOL WINAPI GetTextExtentPointA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
BOOL WINAPI GetCharWidth32W(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
#define DEVICE_DEFAULT_FONT
BOOL WINAPI GetTextExtentPoint32A(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
DWORD WINAPI GetGlyphOutlineW(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)
#define GGI_MARK_NONEXISTING_GLYPHS
#define EASTEUROPE_CHARSET
BOOL WINAPI GetCharWidthA(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
HFONT WINAPI CreateFontIndirectExA(const ENUMLOGFONTEXDVA *)
DWORD WINAPI GetGlyphOutlineA(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)
BOOL WINAPI GetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)