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)
66static const MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} };
70#define GET_BE_WORD(x) (x)
71#define GET_BE_DWORD(x) (x)
73#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
74#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x)));
77#define MS_MAKE_TAG(ch0, ch1, ch2, ch3) \
78 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
79 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
80#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2')
81#define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p')
82#define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e')
155 if (!rsrc)
return NULL;
158 if (!rsrc_data)
return NULL;
161 if (!*rsrc_size)
return NULL;
190 if (!rsrc_data)
return FALSE;
214 "lfWidth: expect %08x got %08x\n", lf->
lfWidth, getobj_lf.
lfWidth);
240 ok(
hfont != 0,
"%s: CreateFontIndirect failed\n",
test);
251 memset(&lf, 0,
sizeof lf);
264 memset(&lf,
'A',
sizeof(lf));
266 ok(
hfont != 0,
"CreateFontIndirectA with strange LOGFONT failed\n");
310 LONG lfWidth,
const char *test_str,
312 const SIZE *size_orig,
INT width_of_A_orig,
333 ok(
ret ==
sizeof(otm)/2 ||
334 ret == 1 ,
"expected sizeof(otm)/2, got %u\n",
ret);
336 memset(&otm, 0x1,
sizeof(otm));
339 ok(
ret ==
sizeof(otm) ||
340 ret == 1 ,
"expected sizeof(otm), got %u\n",
ret);
344 ok(
ret,
"GetTextMetricsA failed\n");
348 ok(0,
"tm != otm\n");
359 ok(otm.
otmDescent < 0,
"otm.otmDescent should be < 0\n");
361 ok(
tm.tmDescent > 0,
"tm.tmDescent should be > 0\n");
368 ok(
ret,
"GetTextMetricsA failed\n");
373 ok(
cx == scale_x &&
cy == scale_y,
"height %d: expected scale_x %d, scale_y %d, got cx %d, cy %d\n",
374 lfHeight, scale_x, scale_y,
cx,
cy);
375 ok(
tm.tmHeight == tm_orig->
tmHeight * scale_y,
"height %d != %d\n",
tm.tmHeight, tm_orig->
tmHeight * scale_y);
376 ok(
tm.tmAscent == tm_orig->
tmAscent * scale_y,
"ascent %d != %d\n",
tm.tmAscent, tm_orig->
tmAscent * scale_y);
393 ok(
size.cy == size_orig->
cy * scale_y,
"cy %d != %d\n",
size.cy, size_orig->
cy * scale_y);
397 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);
403 static const char test_str[11] =
"Test String";
418 trace(
"no bitmap fonts were found, skipping the test\n");
439 test_font_metrics(
hdc,
hfont, 0, 4, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 1, 1);
447 for (
i = 1;
i <= height_orig * 6;
i++)
453 scale = (
i + height_orig - 1) / height_orig;
454 nearest_height =
scale * height_orig;
456 if (
scale > 2 && nearest_height -
i > height_orig / 4)
scale--;
459 else if(
scale == 2 && nearest_height -
i == (height_orig / 4))
continue;
460 else if(
scale == 2 && nearest_height -
i > (height_orig / 4 - 1))
scale--;
462 test_font_metrics(
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 1,
scale);
468 bitmap_lf.
lfHeight = height_orig * 2;
472 test_font_metrics(
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 2);
477 bitmap_lf.
lfHeight = height_orig * 3;
481 test_font_metrics(
hdc,
hfont, bitmap_lf.
lfHeight, 0, test_str,
sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 3);
491 static const char test_str[11] =
"Test String";
497 INT width_orig, height_orig, lfWidth;
500 MAT2 mat2 = { {0x8000,0}, {0,0}, {0,0}, {0x8000,0} };
506 skip(
"Arial is not installed\n");
512 memset(&lf, 0,
sizeof(lf));
522 test_font_metrics(
hdc,
hfont, lf.
lfHeight, otm.
otmTextMetrics.
tmAveCharWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
546 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 3, 2);
555 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 3, 3);
564 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
573 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
576 memset(&gm, 0,
sizeof(gm));
584 memset(&gm, 0,
sizeof(gm));
598 test_font_metrics(hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
603 test_font_metrics(hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
611 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 2, 1);
613 test_font_metrics(hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
620 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 2, 1);
622 test_font_metrics(hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
628 test_font_metrics(hdc_2,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
638 skip(
"GM_ADVANCED is not supported on this platform\n");
653 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
656 memset(&gm, 0,
sizeof(gm));
661 pt.x = width_orig;
pt.y = 0;
667 memset(&gm, 0,
sizeof(gm));
672 pt.x = width_orig;
pt.y = 0;
682 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
685 memset(&gm, 0,
sizeof(gm));
690 pt.x = width_orig;
pt.y = 0;
695 memset(&gm, 0,
sizeof(gm));
700 pt.x = width_orig;
pt.y = 0;
709 test_font_metrics(
hdc,
hfont, lf.
lfHeight, lf.
lfWidth, test_str,
sizeof(test_str), &otm.
otmTextMetrics, &size_orig, width_orig, 1, 1);
712 memset(&gm, 0,
sizeof(gm));
717 pt.x = width_orig;
pt.y = 0;
723 memset(&gm, 0,
sizeof(gm));
728 pt.x = width_orig;
pt.y = 0;
756#define FH_SCALE 0x80000000
764 int ave_char_width, max_char_width,
dpi;
767 const WORD *skip_lang_id;
771 {
"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 },
772 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
773 {
"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 },
774 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
775 {
"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 },
776 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
777 {
"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 },
778 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 13 },
779 {
"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 },
780 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
782 {
"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 },
783 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 6, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
784 {
"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 },
785 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 8, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
786 {
"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 },
787 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 10, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
788 {
"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 },
789 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 14, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
790 {
"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 },
791 {
"MS Sans Serif",
FW_NORMAL,
FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC, 0, 16 },
793 {
"MS Sans Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
794 {
"MS Sans Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
795 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
796 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
797 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
798 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN2 },
799 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 16, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
800 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 19, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
801 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 24, 96, 0x20, 0xff, 0x81, 0x40,
FS_LATIN2 },
802 {
"MS Sans Serif",
FW_NORMAL, 24, 19, 5, 6, 0, 9, 20, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
803 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
804 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN2 },
805 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 25, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
806 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 },
807 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x81, 0x40,
FS_LATIN2 },
808 {
"MS Sans Serif",
FW_NORMAL, 37, 29, 8, 5, 0, 16, 32, 96, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
810 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
811 {
"MS Sans Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
812 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
813 {
"MS Sans Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 17, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
814 {
"MS Sans Serif",
FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
815 {
"MS Sans Serif",
FW_NORMAL, 25, 20, 5, 5, 0, 10, 21, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
816 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 6, 0, 12, 24, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
817 {
"MS Sans Serif",
FW_NORMAL, 29, 23, 6, 5, 0, 12, 24, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
818 {
"MS Sans Serif",
FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
819 {
"MS Sans Serif",
FW_NORMAL, 36, 29, 7, 6, 0, 15, 30, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
820 {
"MS Sans Serif",
FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x81, 0x20,
FS_LATIN1 |
FS_LATIN2 },
821 {
"MS Sans Serif",
FW_NORMAL, 46, 37, 9, 6, 0, 20, 40, 120, 0x20, 0xff, 0x7f, 0x20,
FS_CYRILLIC },
823 {
"MS Serif",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
824 {
"MS Serif",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
825 {
"MS Serif",
FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
826 {
"MS Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
827 {
"MS Serif",
FW_NORMAL, 13, 11, 2, 2, 0, 5, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
828 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
829 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 16, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
830 {
"MS Serif",
FW_NORMAL, 19, 15, 4, 3, 0, 8, 18, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
831 {
"MS Serif",
FW_NORMAL, 19, 15, 4, 3, 0, 8, 19, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
832 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 17, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
833 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 22, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
834 {
"MS Serif",
FW_NORMAL, 21, 16, 5, 3, 0, 9, 23, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
835 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 23, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
836 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 26, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
837 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 3, 0, 12, 27, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
838 {
"MS Serif",
FW_NORMAL, 35, 27, 8, 3, 0, 16, 33, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
839 {
"MS Serif",
FW_NORMAL, 35, 27, 8, 3, 0, 16, 34, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
841 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 14, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
842 {
"MS Serif",
FW_NORMAL, 16, 13, 3, 3, 0, 6, 13, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
843 {
"MS Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 18, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
844 {
"MS Serif",
FW_NORMAL, 20, 16, 4, 4, 0, 8, 15, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
845 {
"MS Serif",
FW_NORMAL, 23, 18, 5, 3, 0, 10, 21, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_CYRILLIC },
846 {
"MS Serif",
FW_NORMAL, 23, 18, 5, 3, 0, 10, 19, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 },
847 {
"MS Serif",
FW_NORMAL, 27, 21, 6, 4, 0, 12, 23, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
848 {
"MS Serif",
FW_MEDIUM, 27, 22, 5, 2, 0, 12, 30, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
849 {
"MS Serif",
FW_NORMAL, 33, 26, 7, 3, 0, 14, 30, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
850 {
"MS Serif",
FW_MEDIUM, 32, 25, 7, 2, 0, 14, 32, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
851 {
"MS Serif",
FW_NORMAL, 43, 34, 9, 3, 0, 19, 39, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
853 {
"Courier",
FW_NORMAL, 13, 11, 2, 0, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
854 {
"Courier",
FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
855 {
"Courier",
FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
857 {
"Courier",
FW_NORMAL, 16, 13, 3, 0, 0, 9, 9, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
858 {
"Courier",
FW_NORMAL, 20, 16, 4, 0, 0, 12, 12, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
859 {
"Courier",
FW_NORMAL, 25, 20, 5, 0, 0, 15, 15, 120, 0x20, 0xff, 0x40, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC },
861 {
"System",
FW_BOLD, 16, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
862 {
"System",
FW_BOLD, 16, 13, 3, 3, 0, 7, 15, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
863 {
"System",
FW_NORMAL, 18, 16, 2, 0, 2, 8, 16, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
865 {
"System",
FW_BOLD, 20, 16, 4, 4, 0, 9, 14, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
866 {
"System",
FW_BOLD, 20, 16, 4, 4, 0, 9, 17, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
868 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 },
869 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
870 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 2, 4, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
871 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
872 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 1, 0, 2, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
873 {
"Small Fonts",
FW_NORMAL, 5, 4, 1, 0, 0, 3, 6, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
874 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
875 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
876 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
877 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 0, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
878 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1, skip_rtl},
879 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
880 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
881 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 0, 0, 5, 10, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
882 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2, skip_rtl},
883 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
884 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 4, 9, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
885 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
886 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC, skip_rtl},
887 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 2, 0, 4, 10, 96, 0x00, 0xff, 0x60, 0x00,
FS_ARABIC },
888 {
"Small Fonts",
FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20,
FS_JISJAPAN },
890 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
891 {
"Small Fonts",
FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
892 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 5, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
893 {
"Small Fonts",
FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
894 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_JISJAPAN },
895 {
"Small Fonts",
FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN2 |
FS_CYRILLIC },
896 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 9, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
897 {
"Small Fonts",
FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
898 {
"Small Fonts",
FW_NORMAL, 12, 10, 2, 2, 0, 5, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
899 {
"Small Fonts",
FW_NORMAL, 12, 10, 2, 2, 0, 6, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
900 {
"Small Fonts",
FW_NORMAL, 13, 11, 2, 2, 0, 6, 12, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_JISJAPAN },
901 {
"Small Fonts",
FW_NORMAL, 13, 11, 2, 2, 0, 6, 11, 120, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
903 {
"Fixedsys",
FW_NORMAL, 15, 12, 3, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 },
904 {
"Fixedsys",
FW_NORMAL, 16, 12, 4, 3, 0, 8, 8, 96, 0x20, 0xff, 0x80, 0x20,
FS_CYRILLIC },
905 {
"FixedSys",
FW_NORMAL, 18, 16, 2, 0, 0, 8, 16, 96, 0x20, 0xff, 0xa0, 0x20,
FS_JISJAPAN },
907 {
"Fixedsys",
FW_NORMAL, 20, 16, 4, 2, 0, 10, 10, 120, 0x20, 0xff, 0x80, 0x20,
FS_LATIN1 |
FS_LATIN2 |
FS_CYRILLIC }
911 static const int font_log_pixels[] = { 96, 120 };
916 INT ret,
i, expected_cs, screen_log_pixels, diff, font_res;
925 skip(
"TranslateCharsetInfo failed for code page %d\n", expected_cs);
929 trace(
"ACP %d -> charset %d\n",
GetACP(), expected_cs);
932 ok(
hdc !=
NULL,
"failed to create hdc\n");
940 for (
i = 0;
i <
sizeof(font_log_pixels)/
sizeof(font_log_pixels[0]);
i++)
942 int new_diff =
abs(font_log_pixels[
i] - screen_log_pixels);
946 font_res = font_log_pixels[
i];
949 trace(
"best font resolution is %d\n", font_res);
951 for (
i = 0;
i <
sizeof(
fd)/
sizeof(
fd[0]);
i++)
955 memset(&lf, 0,
sizeof(lf));
961 for(bit = 0; bit < 32; bit++)
969 if((
fd[
i].ansi_bitfield &
fs[0]) == 0)
continue;
975 ok(
ret,
"scaled font height %d should not be enumerated\n",
height);
978 if (font_res ==
fd[
i].
dpi && lf.lfCharSet == expected_cs)
981 ok(!
ret,
"%s height %d charset %d dpi %d should be enumerated\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet,
fd[
i].dpi);
994 if (
strcmp(face_name,
fd[
i].face_name) != 0)
997 ok(
ret != expected_cs,
"font charset %d should not be %d\n",
ret, expected_cs);
1003 memset(&gm, 0,
sizeof(gm));
1007 ok(
ret ==
GDI_ERROR,
"GetGlyphOutline should fail for a bitmap font\n");
1019 ok(
ret == expected_cs,
"got charset %d, expected %d\n",
ret, expected_cs);
1021 trace(
"created %s, height %d charset %x dpi %d\n", face_name,
tm.tmHeight,
tm.tmCharSet,
tm.tmDigitizedAspectX);
1022 trace(
"expected %s, height %d scaled_height %d, dpi %d\n",
fd[
i].face_name,
height,
fd[
i].scaled_height,
fd[
i].
dpi);
1024 if(
fd[
i].
dpi ==
tm.tmDigitizedAspectX)
1027 trace(
"matched %s, height %d charset %x dpi %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet,
fd[
i].dpi);
1028 if (
fd[
i].skip_lang_id)
1032 while(!skipme &&
fd[
i].skip_lang_id[si])
1038 ok(
tm.tmWeight ==
fd[
i].weight,
"%s(%d): tm.tmWeight %d != %d\n",
fd[
i].face_name,
height,
tm.tmWeight,
fd[
i].weight);
1040 ok(
tm.tmHeight ==
fd[
i].scaled_height,
"%s(%d): tm.tmHeight %d != %d\n",
fd[
i].face_name,
height,
tm.tmHeight,
fd[
i].scaled_height);
1042 ok(
tm.tmHeight ==
fd[
i].height,
"%s(%d): tm.tmHeight %d != %d\n",
fd[
i].face_name,
fd[
i].height,
tm.tmHeight,
fd[
i].height);
1043 ok(
tm.tmAscent ==
fd[
i].ascent,
"%s(%d): tm.tmAscent %d != %d\n",
fd[
i].face_name,
height,
tm.tmAscent,
fd[
i].ascent);
1044 ok(
tm.tmDescent ==
fd[
i].descent,
"%s(%d): tm.tmDescent %d != %d\n",
fd[
i].face_name,
height,
tm.tmDescent,
fd[
i].descent);
1045 ok(
tm.tmInternalLeading ==
fd[
i].int_leading,
"%s(%d): tm.tmInternalLeading %d != %d\n",
fd[
i].face_name,
height,
tm.tmInternalLeading,
fd[
i].int_leading);
1046 ok(
tm.tmExternalLeading ==
fd[
i].ext_leading,
"%s(%d): tm.tmExternalLeading %d != %d\n",
fd[
i].face_name,
height,
tm.tmExternalLeading,
fd[
i].ext_leading);
1047 ok(
tm.tmAveCharWidth ==
fd[
i].ave_char_width,
"%s(%d): tm.tmAveCharWidth %d != %d\n",
fd[
i].face_name,
height,
tm.tmAveCharWidth,
fd[
i].ave_char_width);
1048 ok(
tm.tmFirstChar ==
fd[
i].first_char,
"%s(%d): tm.tmFirstChar = %02x\n",
fd[
i].face_name,
height,
tm.tmFirstChar);
1049 ok(
tm.tmLastChar ==
fd[
i].last_char,
"%s(%d): tm.tmLastChar = %02x\n",
fd[
i].face_name,
height,
tm.tmLastChar);
1052 if (
tm.tmCharSet == lf.lfCharSet)
1053 ok(
tm.tmDefaultChar ==
fd[
i].def_char,
"%s(%d): tm.tmDefaultChar = %02x\n",
fd[
i].face_name,
height,
tm.tmDefaultChar);
1054 ok(
tm.tmBreakChar ==
fd[
i].break_char,
"%s(%d): tm.tmBreakChar = %02x\n",
fd[
i].face_name,
height,
tm.tmBreakChar);
1055 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);
1059 if ((
strcmp(lf.lfFaceName,
"System") || lf.lfCharSet !=
ANSI_CHARSET) &&
tm.tmDigitizedAspectX == 96)
1060 ok(
tm.tmMaxCharWidth ==
fd[
i].max_char_width,
"%s(%d): tm.tmMaxCharWidth %d != %d\n",
fd[
i].face_name,
height,
tm.tmMaxCharWidth,
fd[
i].max_char_width);
1063 skip(
"Skipping font metrics test for system langid 0x%x\n",
1081 static const char szAlphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
1083 if (!pGdiGetCharDimensions)
1085 win_skip(
"GdiGetCharDimensions not available on this platform\n");
1092 avgwidth = ((
size.cx / 26) + 1) / 2;
1095 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth,
ret);
1096 ok(
height ==
tm.tmHeight,
"GdiGetCharDimensions should have set height to %d instead of %d\n",
tm.tmHeight,
height);
1099 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth,
ret);
1102 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth,
ret);
1106 ok(
ret == avgwidth,
"GdiGetCharDimensions should have returned width of %d instead of %d\n", avgwidth,
ret);
1107 ok(
height ==
size.cy,
"GdiGetCharDimensions should have set height to %d instead of %d\n",
size.cy,
height);
1143 ret = pGetCharABCWidthsW(
hdc,
'i',
'i',
abc);
1149 ret = pGetCharABCWidthsFloatW(
hdc,
'i',
'i', abcf);
1150 ok(
ret,
"%s: GetCharABCWidthsFloatW should have succeeded\n",
description);
1158 static const WCHAR str[] = {
'i',0};
1182 {0xffffff, 0xffffff},
1183 {0x1000000, 0x1000000},
1184 {0xffffff, 0x1000000},
1185 {0xffffffff, 0xffffffff},
1197 {
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1199 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1201 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1203 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}},
1205 {
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE,
TRUE}}
1209 if (!pGetCharABCWidthsA || !pGetCharABCWidthsW || !pGetCharABCWidthsFloatW || !pGetCharABCWidthsI)
1211 win_skip(
"GetCharABCWidthsA/W/I not available on this platform\n");
1215 memset(&lf, 0,
sizeof(lf));
1224 ok(nb == 1,
"GetGlyphIndicesW should have returned 1\n");
1227 ok(!
ret,
"GetCharABCWidthsI should have failed\n");
1230 ok(!
ret,
"GetCharABCWidthsI should have failed\n");
1233 ok(
ret,
"GetCharABCWidthsI should have succeeded\n");
1235 ret = pGetCharABCWidthsW(
NULL,
'a',
'a',
abc);
1236 ok(!
ret,
"GetCharABCWidthsW should have failed\n");
1238 ret = pGetCharABCWidthsW(
hdc,
'a',
'a',
NULL);
1239 ok(!
ret,
"GetCharABCWidthsW should have failed\n");
1241 ret = pGetCharABCWidthsW(
hdc,
'a',
'a',
abc);
1242 ok(!
ret,
"GetCharABCWidthsW should have failed\n");
1244 ret = pGetCharABCWidthsFloatW(
NULL,
'a',
'a', abcf);
1245 ok(!
ret,
"GetCharABCWidthsFloatW should have failed\n");
1247 ret = pGetCharABCWidthsFloatW(
hdc,
'a',
'a',
NULL);
1248 ok(!
ret,
"GetCharABCWidthsFloatW should have failed\n");
1250 ret = pGetCharABCWidthsFloatW(
hdc,
'a',
'a', abcf);
1251 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1256 for (
i = 0;
i <
sizeof c /
sizeof c[0]; ++
i)
1267 skip(
"TrueType font for charset %u is not installed\n",
c[
i].
cs);
1275 pGetCharABCWidthsW(
hdc,
c[
i].
w,
c[
i].
w + 1,
w) &&
1277 "GetCharABCWidthsA and GetCharABCWidthsW should return same widths. charset = %u\n",
c[
i].
cs);
1281 ok(
ret,
"GetCharABCWidthsA should have succeeded\n");
1282 memset(full, 0xcc,
sizeof full);
1283 ret = pGetCharABCWidthsA(
hdc, 0x00,
code, full);
1284 ok(
ret,
"GetCharABCWidthsA should have succeeded\n");
1286 "GetCharABCWidthsA info should match. codepage = %u\n",
c[
i].
cs);
1290 memset(full, 0xdd,
sizeof full);
1292 ok(
ret ==
c[
i].
r[
j],
"GetCharABCWidthsA %x - %x should have %s\n",
1299 "GetCharABCWidthsA %x should match. codepage = %u\n",
1308 memset(&lf, 0,
sizeof(lf));
1315 ret = pGetCharABCWidthsFloatW(
hdc,
' ',
' ', abcf);
1316 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1317 ok(abcf[0].abcfB == 1.0,
"got %f\n", abcf[0].abcfB);
1318 ret = pGetCharABCWidthsW(
hdc,
' ',
' ', abcw);
1319 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1320 ok(abcw[0].abcB == 1,
"got %u\n", abcw[0].abcB);
1323 ret = pGetCharABCWidthsW(
hdc,
'a',
'a', abcw);
1324 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1331 ret = pGetCharABCWidthsW(
hdc,
'a',
'a',
abc);
1332 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1336 "got %d, expected %d (A)\n",
abc[0].abcA, abcw[0].abcA);
1338 "got %d, expected %d (B)\n",
abc[0].abcB, abcw[0].abcB);
1340 "got %d, expected %d (C)\n",
abc[0].abcC, abcw[0].abcC);
1346 for (
i = 1;
i <= 2;
i++)
1351 memset(&lf, 0,
sizeof(lf));
1370 for (
j = 1;
j <= 80;
j++)
1379 ok(nb,
"GetGlyphOutlineA should have succeeded at width %d\n",
i);
1382 ok(
ret,
"GetCharABCWidthsA should have succeeded at width %d\n",
i);
1385 "abcA(%d) and gmptGlyphOrigin.x(%d) values are different at width %d\n",
1388 "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n",
1395 trace(
"ABC sign test for a variety of transforms:\n");
1396 memset(&lf, 0,
sizeof(lf));
1407 ok(nb == 1,
"GetGlyphIndicesW should have returned 1\n");
1410 ok(
ret,
"GetCharABCWidthsI should have succeeded\n");
1411 ret = pGetCharABCWidthsW(
hdc,
'i',
'i', abcw);
1412 ok(
ret,
"GetCharABCWidthsW should have succeeded\n");
1413 ret = pGetCharABCWidthsFloatW(
hdc,
'i',
'i', abcf);
1414 ok(
ret,
"GetCharABCWidthsFloatW should have succeeded\n");
1431 trace(
"RTL layout\n");
1457 static const WCHAR wt[] = {
'O',
'n',
'e',
'\n',
't',
'w',
'o',
' ',
'3',0};
1460 INT i,
len, fit1, fit2, extents2[3];
1469 memset(&lf, 0,
sizeof(lf));
1479 ok(sz.
cy ==
tm.tmHeight,
"cy %d tmHeight %d\n", sz.
cy,
tm.tmHeight);
1481 memset(&sz, 0xcc,
sizeof(sz));
1484 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %d, cy %d\n", sz.
cx, sz.
cy);
1486 memset(&sz, 0xcc,
sizeof(sz));
1489 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %d, cy %d\n", sz.
cx, sz.
cy);
1495 win_skip(
"Skipping remainder of text extents test on a Win9x platform\n");
1502 memset(&sz, 0xcc,
sizeof(sz));
1505 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %d, cy %d\n", sz.
cx, sz.
cy);
1507 memset(&sz, 0xcc,
sizeof(sz));
1510 ok(sz.
cx == 0 && sz.
cy == 0,
"cx %d, cy %d\n", sz.
cx, sz.
cy);
1519 "cy from GetTextExtentExPointW (%d) and GetTextExtentPointW (%d) differ\n", sz1.
cy, sz2.
cy);
1525 for (
i = 1;
i <
len; ++
i)
1526 ok(extents[
i-1] <= extents[
i],
1527 "GetTextExtentExPointW generated a non-increasing sequence of partial extents (at position %d)\n",
1529 ok(extents[
len-1] == sz1.
cx,
"GetTextExtentExPointW extents and size don't match\n");
1530 ok(0 <= fit1 && fit1 <=
len,
"GetTextExtentExPointW generated illegal value %d for fit\n", fit1);
1531 ok(0 < fit1,
"GetTextExtentExPointW says we can't even fit one letter in 32767 logical units\n");
1533 ok(sz1.
cx == sz2.
cx && sz1.
cy == sz2.
cy,
"GetTextExtentExPointW returned different sizes for the same string\n");
1534 ok(fit2 == 3,
"GetTextExtentExPointW extents isn't consistent with fit\n");
1536 ok(fit2 == 2,
"GetTextExtentExPointW extents isn't consistent with fit\n");
1538 ok(extents[0] == extents[2] && extents[1] == extents[3],
1539 "GetTextExtentExPointW with lpnFit == NULL returns incorrect results\n");
1542 "GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results\n");
1560 "fit = %d\n", fit1);
1563 ok(fit2 == 0,
"fit = %d\n", fit2);
1570 ok(fit1 == 3,
"fit = %d\n", fit1);
1573 ok(fit2 == 3,
"fit = %d\n", fit2);
1580 ok(fit1 == -215,
"fit = %d\n", fit1);
1583 ok(fit2 == 3,
"fit = %d\n", fit2);
1596 ok(sz.
cx == extents[2],
"got %d vs %d\n", sz.
cx, extents[2]);
1600 ok(fit1 == 2,
"got %d\n", fit1);
1601 ok(sz2.
cx == sz.
cx,
"got %d vs %d\n", sz2.
cx, sz.
cx);
1602 for(
i = 0;
i < 2;
i++)
1603 ok(extents2[
i] == extents[
i],
"%d: %d, %d\n",
i, extents2[
i], extents[
i]);
1623 if (!pGetGlyphIndicesW) {
1624 win_skip(
"GetGlyphIndicesW not available on platform\n");
1630 memset(&lf, 0,
sizeof(lf));
1636 ok(
hfont != 0,
"CreateFontIndirectEx failed\n");
1642 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount);
1643 ok((
glyphs[4] == 0x001f ||
glyphs[4] == 0xffff ),
"GetGlyphIndicesW should have returned a nonexistent char not %04x\n",
glyphs[4]);
1646 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount);
1652 skip(
"GetGlyphIndices System font tests only for ANSI_CHARSET\n");
1656 skip(
"Tahoma is not installed so skipping this test\n");
1659 memset(&lf, 0,
sizeof(lf));
1668 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount);
1669 ok(
glyphs[4] == 0xffff,
"GetGlyphIndicesW should have returned 0xffff char not %04x\n",
glyphs[4]);
1673 ok(charcount == 5,
"GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount);
1674 ok(
glyphs[0] == 0,
"GetGlyphIndicesW for tmDefaultChar should be 0 not %04x\n",
glyphs[0]);
1675 ok(
glyphs[4] == 0,
"GetGlyphIndicesW should have returned 0 not %04x\n",
glyphs[4]);
1681 static const struct kerning_data
1686 LONG tmHeight, tmAscent, tmDescent;
1691 UINT otmsCapEmHeight;
1696 UINT otmusMinimumPPEM;
1698 DWORD total_kern_pairs;
1702 {
"Arial", 12, 12, 9, 3,
1703 2048, 7, -2, 1, 5, 2, 8, -2, 0, 9,
1706 {
' ',
'A',-1},{
' ',
'T',0},{
' ',
'Y',0},{
'1',
'1',-1},
1707 {
'A',
' ',-1},{
'A',
'T',-1},{
'A',
'V',-1},{
'A',
'W',0},
1708 {
'A',
'Y',-1},{
'A',
'v',0},{
'A',
'w',0},{
'A',
'y',0},
1709 {
'F',
',',-1},{
'F',
'.',-1},{
'F',
'A',-1},{
'L',
' ',0},
1710 {
'L',
'T',-1},{
'L',
'V',-1},{
'L',
'W',-1},{
'L',
'Y',-1},
1711 {915,912,+1},{915,913,-1},{910,912,+1},{910,913,-1},
1712 {933,970,+1},{933,972,-1}
1715 {
"Arial", -34, 39, 32, 7,
1716 2048, 25, -7, 5, 17, 9, 31, -7, 1, 9,
1719 {
' ',
'A',-2},{
' ',
'T',-1},{
' ',
'Y',-1},{
'1',
'1',-3},
1720 {
'A',
' ',-2},{
'A',
'T',-3},{
'A',
'V',-3},{
'A',
'W',-1},
1721 {
'A',
'Y',-3},{
'A',
'v',-1},{
'A',
'w',-1},{
'A',
'y',-1},
1722 {
'F',
',',-4},{
'F',
'.',-4},{
'F',
'A',-2},{
'L',
' ',-1},
1723 {
'L',
'T',-3},{
'L',
'V',-3},{
'L',
'W',-3},{
'L',
'Y',-3},
1724 {915,912,+3},{915,913,-3},{910,912,+3},{910,913,-3},
1725 {933,970,+2},{933,972,-3}
1728 {
"Arial", 120, 120, 97, 23,
1729 2048, 79, -23, 16, 54, 27, 98, -23, 4, 9,
1732 {
' ',
'A',-6},{
' ',
'T',-2},{
' ',
'Y',-2},{
'1',
'1',-8},
1733 {
'A',
' ',-6},{
'A',
'T',-8},{
'A',
'V',-8},{
'A',
'W',-4},
1734 {
'A',
'Y',-8},{
'A',
'v',-2},{
'A',
'w',-2},{
'A',
'y',-2},
1735 {
'F',
',',-12},{
'F',
'.',-12},{
'F',
'A',-6},{
'L',
' ',-4},
1736 {
'L',
'T',-8},{
'L',
'V',-8},{
'L',
'W',-8},{
'L',
'Y',-8},
1737 {915,912,+9},{915,913,-10},{910,912,+9},{910,913,-8},
1738 {933,970,+6},{933,972,-10}
1742 {
"Arial", 1024 , 1024, 830, 194,
1743 2048, 668, -193, 137, 459, 229, 830, -194, 30, 9,
1746 {
' ',
'A',-51},{
' ',
'T',-17},{
' ',
'Y',-17},{
'1',
'1',-68},
1747 {
'A',
' ',-51},{
'A',
'T',-68},{
'A',
'V',-68},{
'A',
'W',-34},
1748 {
'A',
'Y',-68},{
'A',
'v',-17},{
'A',
'w',-17},{
'A',
'y',-17},
1749 {
'F',
',',-102},{
'F',
'.',-102},{
'F',
'A',-51},{
'L',
' ',-34},
1750 {
'L',
'T',-68},{
'L',
'V',-68},{
'L',
'W',-68},{
'L',
'Y',-68},
1751 {915,912,+73},{915,913,-84},{910,912,+76},{910,913,-68},
1752 {933,970,+54},{933,972,-83}
1772 win_skip(
"Skipping the GetKerningPairs test on a Win9x platform\n");
1777 for (
i = 0;
i <
sizeof(kd)/
sizeof(kd[0]);
i++)
1784 trace(
"%s is not installed so skipping this test\n", kd[
i].face_name);
1788 trace(
"testing font %s, height %d\n", kd[
i].face_name, kd[
i].
height);
1790 memset(&lf, 0,
sizeof(lf));
1794 ok(
hfont !=
NULL,
"failed to create a font, name %s\n", kd[
i].face_name);
1801 ok(uiRet ==
sizeof(otm),
"GetOutlineTextMetricsW error %d\n",
GetLastError());
1810 ok(kd[
i].otmEMSquare == otm.
otmEMSquare,
"expected %u, got %u\n",
1812 ok(kd[
i].otmAscent == otm.
otmAscent,
"expected %d, got %d\n",
1814 ok(kd[
i].otmDescent == otm.
otmDescent,
"expected %d, got %d\n",
1816 ok(kd[
i].otmLineGap == otm.
otmLineGap,
"expected %u, got %u\n",
1826 ok(kd[
i].otmsXHeight == otm.
otmsXHeight,
"expected %u, got %u\n",
1835 trace(
"total_kern_pairs %u\n", total_kern_pairs);
1844 "got error %u, expected ERROR_INVALID_PARAMETER\n",
GetLastError());
1845 ok(
ret == 0,
"got %u, expected 0\n",
ret);
1848 ok(
ret == total_kern_pairs,
"got %u, expected %u\n",
ret, total_kern_pairs);
1851 ok(
ret == total_kern_pairs/2,
"got %u, expected %u\n",
ret, total_kern_pairs/2);
1854 ok(
ret == total_kern_pairs,
"got %u, expected %u\n",
ret, total_kern_pairs);
1858 for (
n = 0;
n <
ret;
n++)
1862 if (0 && kern_pair[
n].wFirst < 127 && kern_pair[
n].wSecond < 127)
1863 trace(
"{'%c','%c',%d},\n",
1864 kern_pair[
n].wFirst, kern_pair[
n].wSecond, kern_pair[
n].iKernAmount);
1865 for (
j = 0;
j < kd[
i].total_kern_pairs;
j++)
1867 if (kern_pair[
n].wFirst == kd[
i].kern_pair[
j].wFirst &&
1868 kern_pair[
n].wSecond == kd[
i].kern_pair[
j].wSecond)
1870 ok(kern_pair[
n].iKernAmount == kd[
i].kern_pair[
j].iKernAmount,
1871 "pair %d:%d got %d, expected %d\n",
1872 kern_pair[
n].wFirst, kern_pair[
n].wSecond,
1873 kern_pair[
n].iKernAmount, kd[
i].kern_pair[
j].iKernAmount);
1879 ok(
matches == kd[
i].total_kern_pairs,
"got matches %u, expected %u\n",
1906 for (
i = 0;
fd[
i].face_name[0];
i++)
1910 skip(
"%s is not installed\n",
fd[
i].face_name);
1914 memset(&lf, 0,
sizeof(lf));
1920 ok(
hfont !=
NULL,
"failed to create a font, name %s\n",
fd[
i].face_name);
1925 if(
fd[
i].
dpi ==
tm.tmDigitizedAspectX)
1927 ok(
tm.tmWeight ==
fd[
i].weight,
"%s(%d): tm.tmWeight %d != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmWeight,
fd[
i].weight);
1931 ok(
match_off_by_1(
tm.tmInternalLeading,
fd[
i].int_leading,
fd[
i].exact),
"%s(%d): tm.tmInternalLeading %d != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmInternalLeading,
fd[
i].int_leading);
1932 ok(
tm.tmExternalLeading ==
fd[
i].ext_leading,
"%s(%d): tm.tmExternalLeading %d != %d\n",
fd[
i].face_name,
fd[
i].requested_height,
tm.tmExternalLeading,
fd[
i].ext_leading);
1947 for (
i = 0;
i < num_tables;
i++)
1958 static const struct font_data charset_0[] =
1960 {
"wine_vdmx", 10,
FW_NORMAL, 10, 8, 2, 2, 0, 96,
TRUE },
1961 {
"wine_vdmx", 11,
FW_NORMAL, 11, 9, 2, 2, 0, 96,
TRUE },
1962 {
"wine_vdmx", 12,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
1963 {
"wine_vdmx", 13,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
1964 {
"wine_vdmx", 14,
FW_NORMAL, 14, 12, 2, 2, 0, 96,
TRUE },
1965 {
"wine_vdmx", 15,
FW_NORMAL, 15, 12, 3, 3, 0, 96,
FALSE },
1966 {
"wine_vdmx", 16,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
1967 {
"wine_vdmx", 17,
FW_NORMAL, 17, 14, 3, 3, 0, 96,
TRUE },
1968 {
"wine_vdmx", 18,
FW_NORMAL, 18, 15, 3, 3, 0, 96,
TRUE },
1969 {
"wine_vdmx", 19,
FW_NORMAL, 19, 16, 3, 3, 0, 96,
TRUE },
1970 {
"wine_vdmx", 20,
FW_NORMAL, 20, 17, 3, 4, 0, 96,
FALSE },
1971 {
"wine_vdmx", 21,
FW_NORMAL, 21, 17, 4, 4, 0, 96,
TRUE },
1972 {
"wine_vdmx", 22,
FW_NORMAL, 22, 18, 4, 4, 0, 96,
TRUE },
1973 {
"wine_vdmx", 23,
FW_NORMAL, 23, 19, 4, 4, 0, 96,
TRUE },
1974 {
"wine_vdmx", 24,
FW_NORMAL, 24, 20, 4, 4, 0, 96,
TRUE },
1975 {
"wine_vdmx", 25,
FW_NORMAL, 25, 21, 4, 4, 0, 96,
TRUE },
1976 {
"wine_vdmx", 26,
FW_NORMAL, 26, 22, 4, 5, 0, 96,
FALSE },
1977 {
"wine_vdmx", 27,
FW_NORMAL, 27, 22, 5, 5, 0, 96,
TRUE },
1978 {
"wine_vdmx", 28,
FW_NORMAL, 28, 23, 5, 5, 0, 96,
TRUE },
1979 {
"wine_vdmx", 29,
FW_NORMAL, 29, 24, 5, 5, 0, 96,
TRUE },
1980 {
"wine_vdmx", 30,
FW_NORMAL, 30, 25, 5, 5, 0, 96,
TRUE },
1981 {
"wine_vdmx", 31,
FW_NORMAL, 31, 26, 5, 5, 0, 96,
TRUE },
1982 {
"wine_vdmx", 32,
FW_NORMAL, 32, 27, 5, 6, 0, 96,
FALSE },
1983 {
"wine_vdmx", 48,
FW_NORMAL, 48, 40, 8, 8, 0, 96,
TRUE },
1984 {
"wine_vdmx", 64,
FW_NORMAL, 64, 53, 11, 11, 0, 96,
TRUE },
1985 {
"wine_vdmx", 96,
FW_NORMAL, 96, 80, 16, 17, 0, 96,
FALSE },
1986 {
"wine_vdmx", -10,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
1987 {
"wine_vdmx", -11,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
1988 {
"wine_vdmx", -12,
FW_NORMAL, 14, 12, 2, 2, 0, 96,
TRUE },
1989 {
"wine_vdmx", -13,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
1990 {
"wine_vdmx", -14,
FW_NORMAL, 17, 14, 3, 3, 0, 96,
TRUE },
1991 {
"wine_vdmx", -15,
FW_NORMAL, 18, 15, 3, 3, 0, 96,
TRUE },
1992 {
"wine_vdmx", -16,
FW_NORMAL, 19, 16, 3, 3, 0, 96,
TRUE },
1993 {
"wine_vdmx", -17,
FW_NORMAL, 21, 17, 4, 4, 0, 96,
TRUE },
1994 {
"wine_vdmx", -18,
FW_NORMAL, 22, 18, 4, 4, 0, 96,
TRUE },
1995 {
"wine_vdmx", -19,
FW_NORMAL, 23, 19, 4, 4, 0, 96,
TRUE },
1996 {
"wine_vdmx", -20,
FW_NORMAL, 24, 20, 4, 4, 0, 96,
TRUE },
1997 {
"wine_vdmx", -21,
FW_NORMAL, 25, 21, 4, 4, 0, 96,
TRUE },
1998 {
"wine_vdmx", -22,
FW_NORMAL, 27, 22, 5, 5, 0, 96,
TRUE },
1999 {
"wine_vdmx", -23,
FW_NORMAL, 28, 23, 5, 5, 0, 96,
TRUE },
2000 {
"wine_vdmx", -24,
FW_NORMAL, 29, 24, 5, 5, 0, 96,
TRUE },
2001 {
"wine_vdmx", -25,
FW_NORMAL, 30, 25, 5, 5, 0, 96,
TRUE },
2002 {
"wine_vdmx", -26,
FW_NORMAL, 31, 26, 5, 5, 0, 96,
TRUE },
2003 {
"wine_vdmx", -27,
FW_NORMAL, 33, 27, 6, 6, 0, 96,
TRUE },
2004 {
"wine_vdmx", -28,
FW_NORMAL, 34, 28, 6, 6, 0, 96,
TRUE },
2005 {
"wine_vdmx", -29,
FW_NORMAL, 35, 29, 6, 6, 0, 96,
TRUE },
2006 {
"wine_vdmx", -30,
FW_NORMAL, 36, 30, 6, 6, 0, 96,
TRUE },
2007 {
"wine_vdmx", -31,
FW_NORMAL, 37, 31, 6, 6, 0, 96,
TRUE },
2008 {
"wine_vdmx", -32,
FW_NORMAL, 39, 32, 7, 7, 0, 96,
TRUE },
2009 {
"wine_vdmx", -48,
FW_NORMAL, 58, 48, 10, 10, 0, 96,
TRUE },
2010 {
"wine_vdmx", -64,
FW_NORMAL, 77, 64, 13, 13, 0, 96,
TRUE },
2011 {
"wine_vdmx", -96,
FW_NORMAL, 116, 96, 20, 20, 0, 96,
TRUE },
2012 {
"", 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2015 static const struct font_data charset_1[] =
2017 {
"wine_vdmx", 10,
FW_NORMAL, 10, 8, 2, 2, 0, 96,
TRUE },
2018 {
"wine_vdmx", 11,
FW_NORMAL, 11, 9, 2, 2, 0, 96,
TRUE },
2019 {
"wine_vdmx", 12,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
2020 {
"wine_vdmx", 13,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2021 {
"wine_vdmx", 14,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2022 {
"wine_vdmx", 15,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2023 {
"wine_vdmx", 16,
FW_NORMAL, 16, 13, 3, 4, 0, 96,
TRUE },
2024 {
"wine_vdmx", 17,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2025 {
"wine_vdmx", 18,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2026 {
"wine_vdmx", 19,
FW_NORMAL, 19, 15, 4, 5, 0, 96,
TRUE },
2027 {
"wine_vdmx", 20,
FW_NORMAL, 20, 16, 4, 5, 0, 96,
TRUE },
2028 {
"wine_vdmx", 21,
FW_NORMAL, 21, 17, 4, 5, 0, 96,
TRUE },
2029 {
"wine_vdmx", 22,
FW_NORMAL, 22, 18, 4, 5, 0, 96,
TRUE },
2030 {
"wine_vdmx", 23,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2031 {
"wine_vdmx", 24,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2032 {
"wine_vdmx", 25,
FW_NORMAL, 25, 21, 4, 6, 0, 96,
TRUE },
2033 {
"wine_vdmx", 26,
FW_NORMAL, 26, 22, 4, 6, 0, 96,
TRUE },
2034 {
"wine_vdmx", 27,
FW_NORMAL, 27, 23, 4, 6, 0, 96,
TRUE },
2035 {
"wine_vdmx", 28,
FW_NORMAL, 27, 23, 4, 5, 0, 96,
TRUE },
2036 {
"wine_vdmx", 29,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2037 {
"wine_vdmx", 30,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2038 {
"wine_vdmx", 31,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2039 {
"wine_vdmx", 32,
FW_NORMAL, 32, 26, 6, 8, 0, 96,
TRUE },
2040 {
"wine_vdmx", 48,
FW_NORMAL, 48, 40, 8, 10, 0, 96,
TRUE },
2041 {
"wine_vdmx", 64,
FW_NORMAL, 64, 54, 10, 13, 0, 96,
TRUE },
2042 {
"wine_vdmx", 96,
FW_NORMAL, 95, 79, 16, 18, 0, 96,
TRUE },
2043 {
"wine_vdmx", -10,
FW_NORMAL, 12, 10, 2, 2, 0, 96,
TRUE },
2044 {
"wine_vdmx", -11,
FW_NORMAL, 13, 11, 2, 2, 0, 96,
TRUE },
2045 {
"wine_vdmx", -12,
FW_NORMAL, 16, 13, 3, 4, 0, 96,
TRUE },
2046 {
"wine_vdmx", -13,
FW_NORMAL, 16, 13, 3, 3, 0, 96,
TRUE },
2047 {
"wine_vdmx", -14,
FW_NORMAL, 19, 15, 4, 5, 0, 96,
TRUE },
2048 {
"wine_vdmx", -15,
FW_NORMAL, 20, 16, 4, 5, 0, 96,
TRUE },
2049 {
"wine_vdmx", -16,
FW_NORMAL, 21, 17, 4, 5, 0, 96,
TRUE },
2050 {
"wine_vdmx", -17,
FW_NORMAL, 22, 18, 4, 5, 0, 96,
TRUE },
2051 {
"wine_vdmx", -18,
FW_NORMAL, 23, 19, 4, 5, 0, 96,
TRUE },
2052 {
"wine_vdmx", -19,
FW_NORMAL, 25, 21, 4, 6, 0, 96,
TRUE },
2053 {
"wine_vdmx", -20,
FW_NORMAL, 26, 22, 4, 6, 0, 96,
TRUE },
2054 {
"wine_vdmx", -21,
FW_NORMAL, 27, 23, 4, 6, 0, 96,
TRUE },
2055 {
"wine_vdmx", -22,
FW_NORMAL, 27, 23, 4, 5, 0, 96,
TRUE },
2056 {
"wine_vdmx", -23,
FW_NORMAL, 29, 24, 5, 6, 0, 96,
TRUE },
2057 {
"wine_vdmx", -24,
FW_NORMAL, 32, 26, 6, 8, 0, 96,
TRUE },
2058 {
"wine_vdmx", -25,
FW_NORMAL, 32, 26, 6, 7, 0, 96,
TRUE },
2059 {
"wine_vdmx", -26,
FW_NORMAL, 33, 27, 6, 7, 0, 96,
TRUE },
2060 {
"wine_vdmx", -27,
FW_NORMAL, 35, 29, 6, 8, 0, 96,
TRUE },
2061 {
"wine_vdmx", -28,
FW_NORMAL, 36, 30, 6, 8, 0, 96,
TRUE },
2062 {
"wine_vdmx", -29,
FW_NORMAL, 36, 30, 6, 7, 0, 96,
TRUE },
2063 {
"wine_vdmx", -30,
FW_NORMAL, 38, 32, 6, 8, 0, 96,
TRUE },
2064 {
"wine_vdmx", -31,
FW_NORMAL, 39, 33, 6, 8, 0, 96,
TRUE },
2065 {
"wine_vdmx", -32,
FW_NORMAL, 40, 33, 7, 8, 0, 96,
TRUE },
2066 {
"wine_vdmx", -48,
FW_NORMAL, 60, 50, 10, 12, 0, 96,
TRUE },
2067 {
"wine_vdmx", -64,
FW_NORMAL, 81, 67, 14, 17, 0, 96,
TRUE },
2068 {
"wine_vdmx", -96,
FW_NORMAL, 119, 99, 20, 23, 0, 96,
TRUE },
2069 {
"", 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2072 static const struct vdmx_data
2079 { 0, 0, charset_0 },
2080 { 0, 1, charset_1 },
2081 { 1, 0, charset_0 },
2092 if (!pAddFontResourceExA)
2094 win_skip(
"AddFontResourceExA unavailable\n");
2098 for (
i = 0;
i <
sizeof(
data) /
sizeof(
data[0]);
i++)
2108 ratio_rec = (
BYTE *)&vdmx_header[3];
2109 ratio_rec[0] =
data[
i].bCharSet;
2115 num = pAddFontResourceExA( ttf_name, FR_PRIVATE, 0 );
2116 if (!
num)
win_skip(
"Unable to add ttf font resource\n");
2121 pRemoveFontResourceExA( ttf_name, FR_PRIVATE, 0 );
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");
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));
2242 trace(
"otm buffer size %u (0x%x)\n", otm_size, otm_size);
2246 memset(otm, 0xAA, otm_size);
2261 memset(otm, 0xAA, otm_size);
2277 memset(otm, 0xAA, otm_size);
2278 memset(&unset_ptr, 0xAA,
sizeof(unset_ptr));
2310 areaWidth = clientArea->
right - clientArea->
left,
2312 const char *pFirstChar, *pLastChar;
2319 int GetTextExtentExPointWWidth;
2323 y = clientArea->
top;
2326 while (*
str ==
tm.tmBreakChar)
str++;
2333 if (*
str ==
'\0')
break;
2335 while (*
str !=
'\0' && *
str++ !=
tm.tmBreakChar);
2339 }
while ((
int)
size.cx < areaWidth);
2343 while (*(pLastChar - 1) ==
tm.tmBreakChar)
2349 if (*
str ==
'\0' || breakCount <= 0) pLastChar =
str;
2355 if (*
str !=
'\0' && breakCount > 0)
2359 if (
size.cx != areaWidth && nErrors <
sizeof(
error)/
sizeof(
error[0]) - 1)
2361 error[nErrors].start = pFirstChar;
2362 error[nErrors].len = pLastChar - pFirstChar;
2363 error[nErrors].GetTextExtentExPointWWidth =
size.cx;
2370 }
while (*
str && y < clientArea->
bottom);
2372 for (
e = 0;
e < nErrors;
e++)
2376 ok(
error[
e].GetTextExtentExPointWWidth == areaWidth,
2377 "GetTextExtentPointW() for \"%.*s\" should have returned a width of %d, not %d.\n",
2392 static const char testText[] =
2393 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
2394 "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut "
2395 "enim ad minim veniam, quis nostrud exercitation ullamco laboris "
2396 "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in "
2397 "reprehenderit in voluptate velit esse cillum dolore eu fugiat "
2398 "nulla pariatur. Excepteur sint occaecat cupidatat non proident, "
2399 "sunt in culpa qui officia deserunt mollit anim id est laborum.";
2401 hwnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0, 400,400, 0, 0, 0,
NULL);
2407 skip(
"Times New Roman is not installed\n");
2411 memset(&lf, 0,
sizeof lf);
2423 if (!pGetGlyphIndicesA || !pGetTextExtentExPointI)
goto done;
2424 pGetGlyphIndicesA(
hdc,
"A ", 2,
indices, 0 );
2461 for (
i = 0;
i < 10;
i++)
2469 for (
i = 0;
i < 10;
i++)
2483 for (
i = 0;
i < 10;
i++)
2509 memset(&lf, 0,
sizeof(lf));
2530 ok(
strcmp(
"Arial",
name),
"face name should NOT be Arial\n");
2531 ok(
fs.fsCsb[0] & (1u << 31),
"symbol encoding should be available\n");
2536 ok(!(
fs.fsCsb[0] & (1u << 31)),
"symbol encoding should NOT be available\n");
2541 trace(
"Can't find codepage for charset %d\n",
cs);
2549 skip(
"Font code page %d, looking for code page %d\n",
2558 WCHAR unicode_buf[128];
2566 ok(
ret ==
count,
"GetGlyphIndicesW expected %d got %d, error %u\n",
2577 ok(
ret ==
count,
"GetGlyphIndicesA expected %d got %d, error %u\n",
2591 static struct charset_data
2595 WORD font_idxA[128], font_idxW[128];
2604 if (!pGetGlyphIndicesA || !pGetGlyphIndicesW)
2606 win_skip(
"Skipping the font charset test on a Win9x platform\n");
2612 skip(
"Arial is not installed\n");
2616 for (
i = 0;
i <
sizeof(
cd)/
sizeof(
cd[0]);
i++)
2622 skip(
"Symbol or Wingdings is not installed\n");
2628 ok(!
memcmp(
cd[
i].font_idxA,
cd[
i].font_idxW, 128*
sizeof(
WORD)),
"%d: indices don't match\n",
i);
2631 ok(
memcmp(
cd[0].font_idxW,
cd[1].font_idxW, 128*
sizeof(
WORD)),
"0 vs 1: indices shouldn't match\n");
2634 ok(
memcmp(
cd[0].font_idxW,
cd[2].font_idxW, 128*
sizeof(
WORD)),
"0 vs 2: indices shouldn't match\n");
2635 ok(
memcmp(
cd[1].font_idxW,
cd[2].font_idxW, 128*
sizeof(
WORD)),
"1 vs 2: indices shouldn't match\n");
2638 skip(
"Symbol or Wingdings is not installed\n");
2643 static const struct _matching_data
2645 UINT current_codepage;
2648 UINT expected_codepage;
2649 } matching_data[] = {
2682 if (!pGdiGetCodePage)
2684 skip(
"GdiGetCodePage not available on this platform\n");
2690 for (
i = 0;
i <
sizeof(matching_data) /
sizeof(
struct _matching_data);
i++)
2693 if (matching_data[
i].current_codepage != acp)
2698 skip(
"%s is not installed\n", matching_data[
i].lfFaceName);
2704 memset(&lf, 0,
sizeof(lf));
2714 trace(
"acp=%d, lfFaceName=%s, lfCharSet=%d, GetTextCharset=%d, GdiGetCodePage=%d, expected codepage=%d\n",
2716 ok(
codepage == matching_data[
i].expected_codepage,
2717 "GdiGetCodePage should have returned %d, got %d\n", matching_data[
i].expected_codepage,
codepage);
2730 trace(
"acp=%d, lfFaceName=%s, lfCharSet=%d, GetTextCharset=%d, GdiGetCodePage=%d\n",
2750 if (!pGetFontUnicodeRanges)
2752 win_skip(
"GetFontUnicodeRanges not available before W2K\n");
2756 memset(&lf, 0,
sizeof(lf));
2764 ok(!
size,
"GetFontUnicodeRanges succeeded unexpectedly\n");
2767 ok(
size,
"GetFontUnicodeRanges failed unexpectedly\n");
2772 ok(
size,
"GetFontUnicodeRanges failed\n");
2775 for (
i = 0;
i <
gs->cRanges;
i++)
2776 trace(
"%03d wcLow %04x cGlyphs %u\n",
i,
gs->ranges[
i].wcLow,
gs->ranges[
i].cGlyphs);
2777 trace(
"found %u ranges\n",
gs->cRanges);
2817 trace(
"enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
2823 if (!efd->
lf)
return 0;
2843 trace(
"enumed font %s, charset %d, height %d, weight %d, italic %d\n",
2849 if (!efd->
lf)
return 0;
2857 int *ansi_charset,
int *symbol_charset,
2858 int *russian_charset)
2863 *symbol_charset = 0;
2864 *russian_charset = 0;
2874 (*symbol_charset)++;
2877 (*russian_charset)++;
2884 int *ansi_charset,
int *symbol_charset,
2885 int *russian_charset)
2890 *symbol_charset = 0;
2891 *russian_charset = 0;
2901 (*symbol_charset)++;
2904 (*russian_charset)++;
2916 int i,
ret, ansi_charset, symbol_charset, russian_charset;
2918 trace(
"Testing font %s, charset %d\n", *font_name ? font_name :
"<empty>", font_charset);
2922 skip(
"%s is not installed\n", font_name);
2925 memset( &efd, 0,
sizeof(efd) );
2926 memset( &efdw, 0,
sizeof(efdw) );
2946 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for NULL\n",
2947 ansi_charset, symbol_charset, russian_charset);
2948 ok(efdw.total > 0,
"fonts enumerated: NULL\n");
2949 ok(ansi_charset > 0,
"NULL family should enumerate ANSI_CHARSET\n");
2950 ok(symbol_charset > 0,
"NULL family should enumerate SYMBOL_CHARSET\n");
2951 ok(russian_charset > 0 ||
2952 broken(russian_charset == 0),
2953 "NULL family should enumerate RUSSIAN_CHARSET\n");
2963 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for NULL\n",
2964 ansi_charset, symbol_charset, russian_charset);
2965 ok(efdw.total > 0,
"fonts enumerated: NULL\n");
2966 ok(ansi_charset > 0,
"NULL family should enumerate ANSI_CHARSET\n");
2967 ok(symbol_charset > 0,
"NULL family should enumerate SYMBOL_CHARSET\n");
2968 ok(russian_charset > 0,
"NULL family should enumerate RUSSIAN_CHARSET\n");
2977 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for %s\n",
2978 ansi_charset, symbol_charset, russian_charset,
2979 *font_name ? font_name :
"<empty>");
2981 ok(efd.
total > 0,
"no fonts enumerated: %s\n", font_name);
2983 ok(!efd.
total,
"no fonts should be enumerated for empty font_name\n");
3001 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for %s ANSI_CHARSET\n",
3002 ansi_charset, symbol_charset, russian_charset,
3003 *font_name ? font_name :
"<empty>");
3007 ok(efd.
total == 0,
"no fonts should be enumerated: %s ANSI_CHARSET\n", font_name);
3009 ok(efd.
total > 0,
"no fonts enumerated: %s\n", font_name);
3013 ok(efd.
total > 0,
"no fonts enumerated: %s ANSI_CHARSET\n", font_name);
3032 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for %s DEFAULT_CHARSET\n",
3033 ansi_charset, symbol_charset, russian_charset,
3034 *font_name ? font_name :
"<empty>");
3035 ok(efd.
total > 0,
"no fonts enumerated: %s DEFAULT_CHARSET\n", font_name);
3044 switch (font_charset)
3047 ok(ansi_charset > 0,
3048 "ANSI_CHARSET should enumerate ANSI_CHARSET for %s\n", font_name);
3050 "ANSI_CHARSET should NOT enumerate SYMBOL_CHARSET for %s\n", font_name);
3051 ok(russian_charset > 0,
3052 "ANSI_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", font_name);
3056 "SYMBOL_CHARSET should NOT enumerate ANSI_CHARSET for %s\n", font_name);
3058 "SYMBOL_CHARSET should enumerate SYMBOL_CHARSET for %s\n", font_name);
3059 ok(!russian_charset,
3060 "SYMBOL_CHARSET should NOT enumerate RUSSIAN_CHARSET for %s\n", font_name);
3063 ok(ansi_charset > 0,
3064 "DEFAULT_CHARSET should enumerate ANSI_CHARSET for %s\n", font_name);
3065 ok(symbol_charset > 0,
3066 "DEFAULT_CHARSET should enumerate SYMBOL_CHARSET for %s\n", font_name);
3067 ok(russian_charset > 0,
3068 "DEFAULT_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", font_name);
3074 ok(ansi_charset > 0,
3075 "DEFAULT_CHARSET should enumerate ANSI_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3076 ok(symbol_charset > 0,
3077 "DEFAULT_CHARSET should enumerate SYMBOL_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3078 ok(russian_charset > 0,
3079 "DEFAULT_CHARSET should enumerate RUSSIAN_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3090 trace(
"enumerated ansi %d, symbol %d, russian %d fonts for %s SYMBOL_CHARSET\n",
3091 ansi_charset, symbol_charset, russian_charset,
3092 *font_name ? font_name :
"<empty>");
3094 ok(efd.
total == 0,
"no fonts should be enumerated: %s SYMBOL_CHARSET\n", font_name);
3097 ok(efd.
total > 0,
"no fonts enumerated: %s SYMBOL_CHARSET\n", font_name);
3107 "SYMBOL_CHARSET should NOT enumerate ANSI_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3108 ok(symbol_charset > 0,
3109 "SYMBOL_CHARSET should enumerate SYMBOL_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3110 ok(!russian_charset,
3111 "SYMBOL_CHARSET should NOT enumerate RUSSIAN_CHARSET for %s\n", *font_name ? font_name :
"<empty>");
3124 const DWORD valid_bits = 0x003f01ff;
3151 if (!efd->
lf)
return 0;
3168 if (!efnd->
elf)
return 0;
3185 skip(
"TranslateCharsetInfo failed for code page %u.\n", acp);
3190 memset(&enum_font, 0,
sizeof(enum_font));
3192 target.lfFaceName[0] =
'\0';
3195 if (
target.lfFaceName[0] ==
'\0') {
3196 skip(
"suitable font isn't found for charset %d.\n", enum_font.lfCharSet);
3199 if (acp == 874 || acp == 1255 || acp == 1256) {
3204 memset(&efd, 0,
sizeof(efd));
3205 memset(&enum_font, 0,
sizeof(enum_font));
3213 ok(0,
"EnumFontFamilies is broken. Expected >= 2, got %d.\n", efd.
total);
3216 "(%s) got charset %d expected %d\n",
3231 if(!pGetGlyphIndicesA)
3254 memset(&gm1, 0xab,
sizeof(gm1));
3269 memset(&gm2, 0xbb,
sizeof(gm2));
3283 "gm1=%d,%d,%d,%d,%d,%d gm2=%d,%d,%d,%d,%d,%d\n",
3291#include "pshpack2.h"
3343#define TT_OS2_V0_SIZE (FIELD_OFFSET(TT_OS2_V4, ulCodePageRange1))
3400 "%s: expected family %02x got %02x. panose %d-%d-%d-%d-...\n",
3412 for(
i = 0;
i < 256;
i++)
3439 for(
i = 0;
i < seg_count;
i++)
3527#define TT_PLATFORM_APPLE_UNICODE 0
3528#define TT_PLATFORM_MACINTOSH 1
3529#define TT_PLATFORM_MICROSOFT 3
3530#define TT_APPLE_ID_DEFAULT 0
3531#define TT_APPLE_ID_ISO_10646 2
3532#define TT_APPLE_ID_UNICODE_2_0 3
3533#define TT_MS_ID_SYMBOL_CS 0
3534#define TT_MS_ID_UNICODE_CS 1
3535#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
3536#define TT_NAME_ID_FONT_FAMILY 1
3537#define TT_NAME_ID_FONT_SUBFAMILY 2
3538#define TT_NAME_ID_UNIQUE_ID 3
3539#define TT_NAME_ID_FULL_NAME 4
3540#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
3649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3723 if (name_lang ==
lang)
res += 30;
3731 struct sfnt_name_header
3744 int res, best_lang = 0, best_index = -1;
3765 trace(
"number records out of range: %d\n",
header->number_of_record);
3775 for (
i = 0;
i <
header->number_of_record;
i++)
3779 if (
res > best_lang)
3790 trace(
"entry %d is out of range\n", best_index);
3795 trace(
"buffer too small for entry %d\n", best_index);
3819 DWORD cmap_first = 0, cmap_last = 0;
3820 UINT ascent, descent, cell_height;
3822 BOOL sys_lang_non_english;
3836 trace(
"OS/2 chunk was not found\n");
3839 if (
size >
sizeof(tt_os2))
3841 trace(
"got too large OS/2 chunk of size %u\n",
size);
3842 size =
sizeof(tt_os2);
3845 memset(&tt_os2, 0,
sizeof(tt_os2));
3856 skip(
"%s is not a Windows font, OS/2 metrics may be invalid.\n",font_name);
3860 USHORT expect_first_A, expect_last_A, expect_break_A, expect_default_A;
3861 USHORT expect_first_W, expect_last_W, expect_break_W, expect_default_W;
3862 UINT os2_first_char, os2_last_char, default_char, break_char;
3868 cell_height = ascent + descent;
3869 ok(ntm->
ntmCellHeight == cell_height,
"%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n",
3870 font_name, ntm->
ntmCellHeight, cell_height, ascent, descent);
3880 trace(
"font %s charset %u: %x-%x (%x-%x) default %x break %x OS/2 version %u vendor %4.4s\n",
3881 font_name, lf->
lfCharSet, os2_first_char, os2_last_char, cmap_first, cmap_last,
3890 expect_last_W = 0xf896;
3893 expect_last_W = 0xf8fd;
3896 expect_last_W = 0xf0ff;
3898 expect_break_W = 0x20;
3899 expect_default_W = expect_break_W - 1;
3900 expect_first_A = 0x1e;
3901 expect_last_A =
min(os2_last_char - os2_first_char + 0x20, 0xff);
3905 expect_first_W = cmap_first;
3906 expect_last_W = cmap_last;
3907 if(os2_first_char <= 1)
3908 expect_break_W = os2_first_char + 2;
3909 else if(os2_first_char > 0xff)
3910 expect_break_W = 0x20;
3912 expect_break_W = os2_first_char;
3913 expect_default_W = expect_break_W - 1;
3914 expect_first_A = expect_default_W - 1;
3915 expect_last_A =
min(expect_last_W, 0xff);
3917 expect_break_A = expect_break_W;
3918 expect_default_A = expect_default_W;
3924 "A: tmFirstChar for %s got %02x expected %02x\n", font_name, tmA.
tmFirstChar, expect_first_A);
3928 "A: tmLastChar for %s got %02x expected %02x\n", font_name, tmA.
tmLastChar, expect_last_A);
3930 skip(
"tmLastChar is DBCS lead byte\n");
3931 ok(tmA.
tmBreakChar == expect_break_A,
"A: tmBreakChar for %s got %02x expected %02x\n",
3934 "A: tmDefaultChar for %s got %02x expected %02x\n",
3946 ok(tmW.
tmFirstChar == expect_first_W,
"W: tmFirstChar for %s got %02x expected %02x\n",
3951 ok(tmW.
tmLastChar == expect_last_W,
"W: tmLastChar for %s got %02x expected %02x\n",
3953 ok(tmW.
tmBreakChar == expect_break_W,
"W: tmBreakChar for %s got %02x expected %02x\n",
3956 "W: tmDefaultChar for %s got %02x expected %02x\n",
4050 if(!pGetGlyphIndicesA)
4051 win_skip(
"GetGlyphIndicesA is unavailable, negative width will not be checked\n");
4055 memset(&lf, 0,
sizeof(lf));
4059 trace(
"Tested metrics of %d truetype fonts\n", enumed);
4072 {
"Times New Roman Baltic", 186 },
4073 {
"Times New Roman CE", 238 },
4074 {
"Times New Roman CYR", 204 },
4075 {
"Times New Roman Greek", 161 },
4076 {
"Times New Roman TUR", 162 }
4084 {
"MS Shell Dlg", 186 },
4085 {
"MS Shell Dlg", 238 },
4086 {
"MS Shell Dlg", 204 },
4087 {
"MS Shell Dlg", 161 },
4088 {
"MS Shell Dlg", 162 }
4100 skip(
"TranslateCharsetInfo failed for code page %d\n", expected_cs);
4104 trace(
"ACP %d -> charset %d\n",
GetACP(), expected_cs);
4108 for (
i = 0;
i <
sizeof(shell_subst)/
sizeof(shell_subst[0]);
i++)
4115 memset(&lf, 0,
sizeof(lf));
4128 memset(&lf, 0,
sizeof(lf));
4145 skip(
"Arial or Times New Roman not installed\n");
4149 memset(&lf, 0,
sizeof(lf));
4163 memset(&lf, 0,
sizeof(lf));
4179 memset(&lf, 0,
sizeof(lf));
4192 memset(&lf, 0,
sizeof(lf));
4204 for (
i = 0;
i <
sizeof(font_subst)/
sizeof(font_subst[0]);
i++)
4209 "%s should be enumerated\n", font_subst[
i].
name);
4213 "%s should be enumerated\n", font_subst[
i].
name);
4215 memset(&lf, 0,
sizeof(lf));
4222 if (font_subst[
i].
charset == expected_cs)
4224 ok(
cs == expected_cs,
"expected %d, got %d for font %s\n", expected_cs,
cs, font_subst[
i].
name);
4237 memset(&lf, 0,
sizeof(lf));
4248 "got %s for font %s\n",
buf, font_subst[
i].
name);
4259 struct font_realization_info {
4269 struct realization_info_t
4293 if(!pGdiRealizationInfo)
4295 win_skip(
"GdiRealizationInfo not available\n");
4302 r = pGdiRealizationInfo(
hdc,
info);
4303 ok(
r != 0,
"ret 0\n");
4304 ok((
info[0] & 0xf) == 1,
"info[0] = %x for the system font\n",
info[0]);
4305 ok(
info[3] == 0xcccccccc,
"structure longer than 3 dwords\n");
4309 skip(
"skipping GdiRealizationInfo with truetype font\n");
4313 memset(&lf, 0,
sizeof(lf));
4322 r = pGdiRealizationInfo(
hdc,
info);
4323 ok(
r != 0,
"ret 0\n");
4324 ok((
info[0] & 0xf) == 3,
"info[0] = %x for arial\n",
info[0]);
4325 ok(
info[3] == 0xcccccccc,
"structure longer than 3 dwords\n");
4327 if (pGetFontRealizationInfo)
4329 struct font_realization_info *fri = (
struct font_realization_info*)info2;
4330 struct realization_info_t *ri = (
struct realization_info_t*)
info;
4340 memset(info2, 0xcc,
sizeof(info2));
4342 r = pGetFontRealizationInfo(
hdc, info2);
4343 ok(
r != 0,
"ret 0\n");
4346 ok(fri->size == 16 || fri->size == 24,
"got %d\n", info2[0]);
4347 ok(fri->flags == ri->flags,
"flags mismatch\n");
4348 ok(fri->cache_num == ri->cache_num,
"cache_num mismatch\n");
4349 ok(fri->instance_id == ri->instance_id,
"instance id mismatch\n");
4350 ok(info2[6] == 0xcccccccc,
"got wrong dword 6, 0x%08x\n", info2[6]);
4352 memset(info2, 0xcc,
sizeof(info2));
4354 r = pGetFontRealizationInfo(
hdc, info2);
4357 memset(info2, 0xcc,
sizeof(info2));
4359 r = pGetFontRealizationInfo(
hdc, info2);
4360 ok(
r != 0,
"ret 0\n");
4361 ok(fri->size == 24,
"got %d\n", fri->size);
4362 ok(fri->flags == ri->flags,
"flags mismatch\n");
4363 ok(fri->cache_num == ri->cache_num,
"cache_num mismatch\n");
4364 ok(fri->instance_id == ri->instance_id,
"instance id mismatch\n");
4365 ok(fri->simulations == 0x2,
"got simulations flags 0x%04x\n", fri->simulations);
4366 ok(fri->face_index == 0,
"got wrong face index %u\n", fri->face_index);
4367 ok(info2[6] == 0xcccccccc,
"structure longer than 6 dwords\n");
4381 ok(needed > 0 && needed <
sizeof(
file_info),
"got needed size %u\n", needed);
4398 r = pGetFontFileInfo(fri->instance_id, 0, &
file_info, needed - 1, &needed);
4402 if (pGetFontFileData) {
4404 r = pGetFontFileData(fri->instance_id, 0, 2,
data,
sizeof(
data));
4410 win_skip(
"GetFontFileInfo() failed, skipping\n");
4426 static const char faceA[] =
"Tahoma";
4427 static const WCHAR faceW[] = {
'T',
'a',
'h',
'o',
'm',
'a', 0};
4438 skip(
"Tahoma is not installed so skipping this test\n");
4445 ok(
f !=
NULL,
"CreateFontIndirectA failed\n");
4450 ok(
n ==
sizeof faceA - 1,
"GetTextFaceA returned %d\n",
n);
4451 ok(
lstrcmpA(faceA, bufA) == 0,
"GetTextFaceA\n");
4456 ok(
n == 0,
"GetTextFaceA returned %d\n",
n);
4457 ok(bufA[0] ==
'x',
"GetTextFaceA buf[0] == %d\n", bufA[0]);
4461 ok(
n == 0,
"GetTextFaceA returned %d\n",
n);
4462 ok(bufA[0] ==
'\0',
"GetTextFaceA buf[0] == %d\n", bufA[0]);
4464 bufA[0] =
'x'; bufA[1] =
'y';
4466 ok(
n == 1,
"GetTextFaceA returned %d\n",
n);
4467 ok(bufA[0] == faceA[0] && bufA[1] ==
'\0',
"GetTextFaceA didn't copy\n");
4470 ok(
n ==
sizeof faceA ||
4472 "GetTextFaceA returned %d\n",
n);
4483 win_skip(
"CreateFontIndirectW is not implemented\n");
4486 ok(
f !=
NULL,
"CreateFontIndirectW failed\n");
4491 ok(
n ==
sizeof faceW /
sizeof faceW[0],
"GetTextFaceW returned %d\n",
n);
4492 ok(
lstrcmpW(faceW, bufW) == 0,
"GetTextFaceW\n");
4497 ok(
n == 0,
"GetTextFaceW returned %d\n",
n);
4498 ok(bufW[0] ==
'x',
"GetTextFaceW buf[0] == %d\n", bufW[0]);
4502 ok(
n == 1,
"GetTextFaceW returned %d\n",
n);
4503 ok(bufW[0] ==
'\0',
"GetTextFaceW buf[0] == %d\n", bufW[0]);
4505 bufW[0] =
'x'; bufW[1] =
'y';
4507 ok(
n == 2,
"GetTextFaceW returned %d\n",
n);
4508 ok(bufW[0] == faceW[0] && bufW[1] ==
'\0',
"GetTextFaceW didn't copy\n");
4511 ok(
n ==
sizeof faceW /
sizeof faceW[0],
"GetTextFaceW returned %d\n",
n);
4519 static const char test_str[11] =
"Test String";
4527 skip(
"Arial is not installed\n");
4532 memset(&lf, 0,
sizeof(lf));
4652 skip(
"Tahoma is not installed\n");
4657 memset(&lf, 0,
sizeof(lf));
4665 memset(&gm, 0,
sizeof(gm));
4670 memset(&gm, 0,
sizeof(gm));
4678 memset(&gm, 0,
sizeof(gm));
4684 memset(&gm, 0,
sizeof(gm));
4694 memset(&gm, 0,
sizeof(gm));
4699 ok(
ret == 0,
"GetGlyphOutlineW should return 0 buffer size for space char\n");
4705 memset(&gm, 0,
sizeof(gm));
4710 ok(
ret ==
GDI_ERROR,
"GetGlyphOutlineW should return GDI_ERROR\n");
4720 ok(
ret ==
GDI_ERROR,
"GetGlyphOutlineW should return an error when the buffer size is too small.\n");
4722 for (
i = 0;
i <
sizeof(
fmt) /
sizeof(
fmt[0]); ++
i)
4726 memset(&gm, 0xab,
sizeof(gm));
4734 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4739 memset(&gm, 0xab,
sizeof(gm));
4747 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4752 memset(&gm, 0xab,
sizeof(gm));
4760 ok(
ret == 0,
"%2d:GetGlyphOutlineW should return 0, got %d\n",
fmt[
i],
ret);
4765 memset(&gm, 0xab,
sizeof(gm));
4778 memset(&gm2, 0xab,
sizeof(gm2));
4780 "%2d:GLYPHMETRICS shouldn't be touched on error\n",
fmt[
i]);
4788 for (
i = 0;
i <
sizeof c /
sizeof c[0]; ++
i)
4790 static const MAT2 rotate_mat = {{0, 0}, {0, -1}, {0, 1}, {0, 0}};
4798 skip(
"TrueType font for charset %u is not installed\n",
c[
i].
cs);
4807 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
"%d %d\n",
ret, ret2);
4810 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
4811 "Expected to ignore superfluous bytes, got %d %d\n",
ret, ret2);
4816 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
4817 "Expected to ignore superfluous bytes, got %d %d\n",
ret, ret2);
4821 ok(
ret == ret2 &&
memcmp(&gm, &gm2,
sizeof gm) == 0,
"%d %d\n",
ret, ret2);
4825 skip(
"Fixed-pitch TrueType font for charset %u is not available\n",
c[
i].
cs);
4842 trace(
"Tests with height=%d,avg=%d,full=%d,face=%s,charset=%d\n",
4845 "expected %d, got %d (%s:%d)\n",
4851 "expected %d, got %d (%s:%d)\n",
4863 "expected %d, got %d (%s:%d)\n",
4874 "expected %d, got %d (%s:%d)\n",
4894 skip(
"%s is not installed\n", fontname);
4898 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
4909 ave_width =
tm.tmAveCharWidth;
4913 trace(
"height %d, ave width %d\n",
height, ave_width);
4915 for (
width = ave_width * 2; ;
width += ave_width)
4920 ok(hf != 0,
"CreateFont failed\n");
4936 trace(
"max width/height ratio (%d / %d) %d, max width scale (%d / %d) %d\n",
4939 ok(ratio >= 90 && ratio <= 110,
"expected width/height ratio 90-110, got %d\n", ratio);
4950 ok(!!
hdc,
"CreateCompatibleDC failed\n");
4958 ok(
size,
"GetCharacterPlacementA failed!\n");
4961 ok(size2,
"GetCharacterPlacementA failed!\n");
4962 ok(
size == size2,
"GetCharacterPlacementA returned different result: %u vs %u\n", size2,
size);
4965 ok(size2,
"GetCharacterPlacementA failed!\n");
4966 ok(
size == size2,
"GetCharacterPlacementA returned different result: %u vs %u\n", size2,
size);
4969 ok(
size,
"GetCharacterPlacementA failed!\n");
4970 ok(
size == size2,
"GetCharacterPlacementA returned different result: %u vs %u\n", size2,
size);
4978 char TestName[][16] = {
"Arial",
"Arial Bold",
"Arial Italic",
"Arial Baltic"};
4980 memset(&lf, 0,
sizeof(lf));
4993 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5013 if (!pCreateFontIndirectExA)
5015 win_skip(
"CreateFontIndirectExA is not available\n");
5021 skip(
"Arial is not installed\n");
5030 memset(&lfex, 0,
sizeof(lfex));
5032 hfont = pCreateFontIndirectExA(&lfex);
5033 ok(
hfont != 0,
"CreateFontIndirectEx failed\n");
5076 DWORD font_size, num_fonts;
5080 if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx)
5082 win_skip(
"AddFontMemResourceEx is not available on this platform\n");
5089 skip(
"Unable to locate and load font sserife.fon\n");
5095 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5097 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5102 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5104 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5108 ret = pAddFontMemResourceEx(
NULL, 0,
NULL, &num_fonts);
5109 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5111 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5115 ret = pAddFontMemResourceEx(
NULL, 10,
NULL, &num_fonts);
5116 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5118 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5123 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5125 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5130 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5132 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5135 num_fonts = 0xdeadbeef;
5137 ret = pAddFontMemResourceEx(
font, 0,
NULL, &num_fonts);
5138 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5140 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5142 ok(num_fonts == 0xdeadbeef,
"number of loaded fonts should be 0xdeadbeef\n");
5146 num_fonts = 0xdeadbeef;
5148 ret = pAddFontMemResourceEx(
font, 10,
NULL, &num_fonts);
5149 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5151 "Expected GetLastError() to return 0xdeadbeef, got %u\n",
5153 ok(num_fonts == 0xdeadbeef,
"number of loaded fonts should be 0xdeadbeef\n");
5156 num_fonts = 0xdeadbeef;
5158 ret = pAddFontMemResourceEx(
font, font_size,
NULL, &num_fonts);
5160 ok(num_fonts != 0xdeadbeef,
"number of loaded fonts should not be 0xdeadbeef\n");
5161 ok(num_fonts != 0,
"number of loaded fonts should not be 0\n");
5166 bRet = pRemoveFontMemResourceEx(
ret);
5171 ok(
font !=
NULL,
"Unable to locate and load font sserife.fon\n");
5174 ret = pAddFontMemResourceEx(
font, font_size,
NULL, (
void *)0xdeadbeef);
5175 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5177 "Expected GetLastError() to return 0xdeadbeef, got %u\n",
5182 ok(!
ret,
"AddFontMemResourceEx should fail\n");
5184 "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
5234 skip(
"Arial is not installed\n");
5241 skip(
"User locale is not English, skipping the test\n");
5249 ok(
ret == 0xcafe,
"got %08x\n",
ret);
5252 ok(!
ret,
"font Arial is not enumerated\n");
5259 ok(!
ret,
"font Arial is not enumerated\n");
5265 ok(!
ret,
"font Arial Bold is not enumerated\n");
5272 ok(
ret,
"font Arial Bold should not be enumerated\n");
5275 ok(!
ret,
"font Arial Bold Italic is not enumerated\n");
5282 ok(
ret,
"font Arial Bold Italic should not be enumerated\n");
5285 ok(
ret,
"font Arial Italic Bold should not be enumerated\n");
5289 ok(
ret,
"font Arial Italic Bold should not be enumerated\n");
5299 trace(
"enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
5309 if (!efnd->
elf)
return 0;
5320 trace(
"enumed font \"%s\", charset %d, height %d, weight %d, italic %d\n",
5330 if (!efnd->
elf)
return 0;
5344 ok(
ret,
"MS Shell Dlg should be enumerated\n");
5346 ok(
ret,
"MS Shell Dlg should be enumerated as a TrueType font\n");
5349 ok(
ret,
"MS Shell Dlg 2 should be enumerated\n");
5351 ok(
ret,
"MS Shell Dlg 2 should be enumerated as a TrueType font\n");
5355 memset(&efnd, 0,
sizeof(efnd));
5357 ok(
ret,
"MS Shell Dlg should not be enumerated\n");
5358 ok(!efnd.
total,
"MS Shell Dlg should not be enumerated\n");
5360 memset(&lf, 0,
sizeof(lf));
5366 ok(!
ret,
"MS Shell Dlg should be enumerated\n");
5367 ok(efnd.
total > 0,
"MS Shell Dlg should be enumerated\n");
5373 ok(
ret,
"did not expect MS Shell Dlg\n");
5378 ok(
ret,
"MS Shell Dlg 2 should not be enumerated\n");
5379 ok(!efnd.
total,
"MS Shell Dlg 2 should not be enumerated\n");
5384 ok(!
ret,
"MS Shell Dlg 2 should be enumerated\n");
5385 ok(efnd.
total > 0,
"MS Shell Dlg 2 should be enumerated\n");
5391 ok(
ret,
"did not expect MS Shell Dlg 2\n");
5422 static const char *
TestName[] = {
"Lucida Sans Demibold Roman",
"Lucida Sans Italic",
"Lucida Sans Regular"};
5432 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
5434 memset(&lf, 0,
sizeof(lf));
5453 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5459 ok(
ret,
"face full name could not be read\n");
5480 char *FamilyName, *FaceName, *StyleName, *otmStr;
5490 BOOL want_vertical, get_vertical;
5491 want_vertical = (
Family[0] ==
'@' );
5494 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
5496 memset(&lf, 0,
sizeof(lf));
5505 memset(&efnd, 0,
sizeof(efnd));
5507 if (efnd.
total == 0)
5516 get_vertical = ( FamilyName[0] ==
'@' );
5517 ok(get_vertical == want_vertical,
"Vertical flags don't match: %s %s\n",
Family, FamilyName);
5521 ok(
hfont != 0,
"CreateFontIndirectA failed\n");
5525 ok(buf_size !=
GDI_ERROR,
"no name table found\n");
5533 memset(otm, 0, otm_size);
5535 ok(
ret != 0,
"GetOutlineTextMetrics fails!\n");
5536 if (
ret == 0)
continue;
5542 ok(
ret,
"%s: FAMILY (family name) could not be read\n", FamilyName);
5545 ok(!
lstrcmpA(FamilyName, bufA),
"font family names don't match: returned %s, expect %s\n", FamilyName, bufA);
5547 ok(!
lstrcmpA(FamilyName, otmStr),
"FamilyName %s doesn't match otmpFamilyName %s\n", FamilyName, otmStr);
5553 ok(
ret,
"FULL_NAME (face name) could not be read\n");
5556 ok(!
lstrcmpA(FaceName, bufA),
"%s: font face names don't match: returned %s, expect %s\n", FamilyName, FaceName, bufA);
5558 ok(!
lstrcmpA(FaceName, otmStr),
"%s: FaceName %s doesn't match otmpFaceName %s\n", FamilyName, FaceName, otmStr);
5564 ok(
ret,
"%s: SUBFAMILY (style name) could not be read\n", FamilyName);
5566 ok(!
lstrcmpA(StyleName, bufA),
"%s: style names don't match: returned %s, expect %s\n", FamilyName, StyleName, bufA);
5568 ok(!
lstrcmpA(StyleName, otmStr),
"%s: StyleName %s doesn't match otmpStyleName %s\n", FamilyName, StyleName, otmStr);
5574 ok(
ret,
"%s: UNIQUE_ID (full name) could not be read\n", FamilyName);
5577 ok(!
lstrcmpA(otmStr, bufA),
"%s: UNIQUE ID (full name) doesn't match: returned %s, expect %s\n", FamilyName, otmStr, bufA);
5640 memset(&lf, 0,
sizeof(lf));
5650 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5653 ok(
ret == 228,
"GetGlyphOutline returned %d, expected 228\n",
ret);
5657 ok(
ret == 228,
"GetGlyphOutline returned %d, expected 228\n",
ret);
5658 ok(
header->cb == 36,
"header->cb = %d, expected 36\n",
header->cb);
5661 ok(
header->cb == 96,
"header->cb = %d, expected 96\n",
header->cb);
5663 ok(
header->cb == 96,
"header->cb = %d, expected 96\n",
header->cb);
5680 memset(&lf, 0,
sizeof(lf));
5691 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5699 "Glyph top(%d) exceeds ascent(%d)\n",
5703 "Glyph bottom(%d) exceeds descent(%d)\n",
5725 memset(&lf, 0,
sizeof(lf));
5736 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5764 if (!pAddFontResourceExA || !pRemoveFontResourceExA)
5766 win_skip(
"AddFontResourceExA is not available on this platform\n");
5772 skip(
"Failed to create ttf file for testing\n");
5776 trace(
"created %s\n", ttf_name);
5779 ok(!
ret,
"font wine_test should not be enumerated\n");
5791 ok(!
ret,
"CreateScalableFontResource() should fail\n");
5796 ok(!
ret,
"CreateScalableFontResource() should fail\n");
5799 file_part =
strrchr(ttf_name,
'\\');
5802 ok(!
ret,
"CreateScalableFontResource() should fail\n");
5807 ok(!
ret,
"CreateScalableFontResource() should fail\n");
5812 ok(!
ret,
"CreateScalableFontResource() should fail\n");
5818 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5819 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
5827 ok(!
ret,
"font wine_test should not be enumerated\n");
5830 ret = pAddFontResourceExA(fot_name, 0, 0);
5834 ok(
ret,
"font wine_test should be enumerated\n");
5840 ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0);
5841 ok(!
ret,
"RemoveFontResourceEx() with not matching flags should fail\n");
5844 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5848 ok(!
ret,
"font wine_test should not be enumerated\n");
5850 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5851 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
5854 for (
i = 0;
i < 5;
i++)
5857 ret = pAddFontResourceExA(fot_name, 0, 0);
5860 for (
i = 0;
i < 5;
i++)
5863 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5866 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5867 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
5877 ok(!
ret,
"font wine_test should not be enumerated\n");
5880 ret = pAddFontResourceExA(fot_name, 0, 0);
5885 ok(!
ret,
"font wine_test should not be enumerated\n");
5889 ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0);
5893 ok(!
ret,
"font wine_test should not be enumerated\n");
5895 ret = pRemoveFontResourceExA(fot_name, 0, 0);
5896 ok(!
ret,
"RemoveFontResourceEx() should fail\n");
5909 static const WCHAR str[] = { 0x2025 };
5929 ok(
hfont !=
NULL,
"CreateFontIndirectA failed\n");
5934 ok(hfont_prev !=
NULL,
"SelectObject failed\n");
5937 ok(
ret,
"GetTextFaceA failed\n");
5943 memset(gm, 0,
sizeof *gm);
5945 ret = pGetGlyphIndicesW(
hdc,
str, 1, gi, 0);
5964 USHORT numOfLongVerMetrics;
5968 memset(&lf, 0,
sizeof(lf));
5978 ok(
ret,
"GetCharABCWidthsW failed\n");
5981 memset(&lf, 0,
sizeof(lf));
5991 ok(
ret,
"GetCharABCWidthsW failed\n");
5997 "expected %d, got %d\n",
6000 memset(&otm, 0,
sizeof(otm));
6003 ok(
ret != 0,
"GetOutlineTextMetricsA failed\n");
6006 &numOfLongVerMetrics,
sizeof(numOfLongVerMetrics)) !=
GDI_ERROR) {
6008 SHORT topSideBearing;
6010 if (!pGetGlyphIndicesW) {
6011 win_skip(
"GetGlyphIndices is not available on this platform\n");
6015 ok(
ret != 0,
"GetGlyphIndicesW failed\n");
6016 numOfLongVerMetrics =
GET_BE_WORD(numOfLongVerMetrics);
6017 if (numOfLongVerMetrics >
idx)
6020 offset = numOfLongVerMetrics * 2 + (
idx - numOfLongVerMetrics);
6022 &topSideBearing,
sizeof(
SHORT));
6027 "expected %d, got %d\n",
6034 "got %d, expected rgm.origin.x(%d) + vgm.cellIncX(%d) + descent(%d)\n",
6040 "got %d, expected abcA(%d) + abcB(%u) + descent(%d)\n",
6054 const char* face_list[] = {
6055 "@WineTestVertical",
6060 if (!pAddFontResourceExA || !pRemoveFontResourceExA || !pGetGlyphIndicesW)
6062 win_skip(
"AddFontResourceExA or GetGlyphIndicesW is not available on this platform\n");
6068 skip(
"Failed to create ttf file for testing\n");
6072 num = pAddFontResourceExA(ttf_name, FR_PRIVATE, 0);
6073 ok(
num == 2,
"AddFontResourceExA should add 2 fonts from vertical.ttf\n");
6076 ok(installed,
"WineTestVertical is not installed\n");
6077 ok(
selected,
"WineTestVertical is not selected\n");
6079 "gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n",
6083 ok(installed,
"@WineTestVertical is not installed\n");
6084 ok(
selected,
"@WineTestVertical is not selected\n");
6086 "gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n",
6089 ok(hgi != vgi,
"same glyph h:%u v:%u\n", hgi, vgi);
6091 for (
i = 0;
i <
sizeof(face_list)/
sizeof(face_list[0]);
i++) {
6092 const char*
face = face_list[
i];
6094 skip(
"%s is not installed\n",
face);
6101 ret = pRemoveFontResourceExA(ttf_name, FR_PRIVATE, 0);
6132 memset(&lf, 0,
sizeof lf);
6138 skip(
"Vertical font for charset %u is not installed\n",
charset[
i]);
6144 memset(face_name, 0,
sizeof face_name);
6146 ok(
ret && face_name[0] !=
'@',
6147 "expected non-vertical face for charset %u, got %s\n",
charset[
i], face_name);
6150 memset(&lf, 0,
sizeof lf);
6155 memset(face_name, 0,
sizeof face_name);
6157 ok(
ret && face_name[0] ==
'@',
6158 "expected vertical face for charset %u, got %s\n",
charset[
i], face_name);
6172 ok(
hfont != 0,
"CreateFontIndirect failed\n");
6176 ok(
ret,
"GetTextMetrics failed\n");
6177 ret =
tm.tmDigitizedAspectX;
6188 static const int font[] =
6247 for (
i = 0;
i <
sizeof(
font)/
sizeof(
font[0]);
i++)
6254 ok(
hfont != 0,
"%d: GetStockObject(%d) failed\n",
i,
font[
i]);
6257 if (
ret !=
sizeof(lf))
6260 win_skip(
"%d: GetObject returned %d instead of sizeof(LOGFONT)\n",
i,
ret);
6264 for (
j = 0; td[
i][
j].face_name[0] != 0;
j++)
6276 trace(
"%d(%d): font %s %d dpi doesn't match test data %d\n",
6284 ((!
strcmp(td[
i][
j].face_name,
"MS Sans Serif") && td[
i][
j].
height == 12) ||
6287 ok(
height == td[
i][
j].height_pixels,
"%d(%d): expected height %d, got %d\n",
i,
j, td[
i][
j].height_pixels,
height);
6291 if (td[
i][
j].face_name[0] ==
'?')
6314 LONG invalid_height[] = { -65536, -123456, 123456 };
6317 memset(&tm1, 0,
sizeof(tm1));
6318 memset(&lf, 0,
sizeof(lf));
6328 ok(
r,
"GetTextMetrics failed\n");
6339 ok(
r,
"GetTextMetrics failed\n");
6341 "expected greater than 1 ppem value (%d), got %d\n", tm1.
tmHeight,
tm.tmHeight);
6343 "expected greater than 1 ppem value (%d), got %d\n", tm1.
tmAveCharWidth,
tm.tmAveCharWidth);
6347 for (
i = 0;
i <
sizeof(invalid_height)/
sizeof(invalid_height[0]);
i++) {
6353 ok(
r,
"GetTextMetrics failed\n");
6355 "expected 1 ppem value (%d), got %d\n", tm1.
tmHeight,
tm.tmHeight);
6357 "expected 1 ppem value (%d), got %d\n", tm1.
tmAveCharWidth,
tm.tmAveCharWidth);
6373 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
6383 memset( &efd, 0,
sizeof(efd) );
6392 ok(
i >
j,
"Found vertical font %s before its horizontal version\n", efd.
lf[
i].
lfFaceName);
6411 if (!pGetCharWidth32A || !pGetCharWidth32W)
6413 win_skip(
"GetCharWidth32A/W not available on this platform\n");
6425 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6426 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6427 ret = pGetCharWidth32A(
hdc,
'a',
'a', &bufferA);
6428 ok(
ret,
"GetCharWidth32A should have succeeded\n");
6429 ok (bufferA == bufferW,
"Widths should be the same\n");
6430 ok (bufferA > 0,
" Width should be greater than zero\n");
6447 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6448 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6449 ok (bufferW > 0,
" Width should be greater than zero\n");
6452 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6453 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6454 ok (bufferW > 0,
" Width should be greater than zero\n");
6456 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6457 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6458 ok (bufferW > 0,
" Width should be greater than zero\n");
6461 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6462 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6463 ok (bufferW > 0,
" Width should be greater than zero\n");
6465 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6466 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6467 ok (bufferW > 0,
" Width should be greater than zero\n");
6478 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6479 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6480 ok (bufferW > 0,
" Width should be greater than zero\n");
6483 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6484 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6485 ok (bufferW > 0,
" Width should be greater than zero\n");
6487 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6488 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6489 ok (bufferW > 0,
" Width should be greater than zero\n");
6492 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6493 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6494 ok (bufferW > 0,
" Width should be greater than zero\n");
6496 ret = pGetCharWidth32W(
hdc,
'a',
'a', &bufferW);
6497 ok(
ret,
"GetCharWidth32W should have succeeded\n");
6498 ok (bufferW > 0,
" Width should be greater than zero\n");
6507 static const MAT2 x2_mat = { {0,2}, {0,0}, {0,0}, {0,2} };
6520 if (!pGetCharWidth32A || !pGetCharABCWidthsA) {
6521 win_skip(
"GetCharWidth32A/GetCharABCWidthA is not available on this platform\n");
6526 memset(&lf, 0,
sizeof(lf));
6532 for (
i = 0;
i <= 1;
i++)
6555 "expected %d, got %d\n",
data[0].tm.tmHeight,
data[1].tm.tmHeight);
6557 "expected %d, got %d\n",
data[0].tm.tmAscent,
data[1].tm.tmAscent);
6559 "expected %d, got %d\n",
data[0].tm.tmDescent,
data[1].tm.tmDescent);
6560 ok(
data[0].
tm.tmAveCharWidth + 1 ==
data[1].tm.tmAveCharWidth,
6561 "expected %d, got %d\n",
data[0].tm.tmAveCharWidth + 1,
data[1].tm.tmAveCharWidth);
6562 ok(
data[0].
tm.tmMaxCharWidth + 1 ==
data[1].tm.tmMaxCharWidth,
6563 "expected %d, got %d\n",
data[0].tm.tmMaxCharWidth + 1,
data[1].tm.tmMaxCharWidth);
6565 "expected %d, got %d\n",
data[0].tm.tmOverhang,
data[1].tm.tmOverhang);
6567 "expected %d, got %d\n",
data[0].
w + 1,
data[1].
w);
6569 ok(
data[0].gm.gmCellIncX + 1 ==
data[1].gm.gmCellIncX,
6570 "expected %d, got %d\n",
data[0].gm.gmCellIncX + 1,
data[1].gm.gmCellIncX);
6571 ok(
data[0].gm.gmCellIncY ==
data[1].gm.gmCellIncY,
6572 "expected %d, got %d\n",
data[0].gm.gmCellIncY,
data[1].gm.gmCellIncY);
6576 memset(&lf, 0,
sizeof(lf));
6582 for (
i = 0;
i < 4;
i++)
6602 for (
i = 0;
i < 4;
i+=2)
6607 skip(
"TrueType font is selected (expected a bitmap one)\n");
6611 "expected %d, got %d\n",
data[
i].tm.tmHeight,
data[
i+1].tm.tmHeight);
6613 "expected %d, got %d\n",
data[
i].tm.tmAscent,
data[
i+1].tm.tmAscent);
6615 "expected %d, got %d\n",
data[
i].tm.tmDescent,
data[
i+1].tm.tmDescent);
6616 ok(
data[
i+1].
tm.tmAveCharWidth -
data[
i].tm.tmAveCharWidth == diff,
6617 "expected %d, got %d\n", diff,
data[
i+1].tm.tmAveCharWidth -
data[
i].tm.tmAveCharWidth);
6618 ok(
data[
i+1].
tm.tmMaxCharWidth -
data[
i].tm.tmMaxCharWidth == diff,
6619 "expected %d, got %d\n", diff,
data[
i+1].tm.tmMaxCharWidth -
data[
i].tm.tmMaxCharWidth);
6621 "expected 0, got %d\n",
data[
i].tm.tmOverhang);
6623 "expected 1, got %d\n",
data[
i+1].tm.tmOverhang);
6631 const WCHAR text[] = {
'#',
'!',
'/',
'b',
'i',
'n',
'/',
's',
'h',0};
6635 } bitmap_font_list[] = {
6655 if (!pGetGlyphIndicesW || !pGetGlyphIndicesA) {
6656 win_skip(
"GetGlyphIndices is unavailable\n");
6661 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
6663 memset(&bmi, 0,
sizeof(bmi));
6671 for (
i = 0;
i <
sizeof(bitmap_font_list)/
sizeof(bitmap_font_list[0]);
i++) {
6672 memset(&lf, 0,
sizeof(lf));
6679 ok(
ret,
"GetTextMetric failed\n");
6681 ok(
ret,
"GetTextFace failed\n");
6683 skip(
"TrueType font (%s) was selected for \"%s\"\n", facename, bitmap_font_list[
i].
face);
6691 for (
j = 0;
j < 2;
j++) {
6694 ok(hBmp[
j] !=
NULL,
"Can't create DIB\n");
6705 ok(
ret,
"GetGlyphIndices failed\n");
6707 "Glyph indices and text are different for %s:%d\n", lf.
lfFaceName,
tm.tmCharSet);
6713 ok(
ret,
"ExtTextOutW failed\n");
6719 "Images are different (%s:%d)\n", lf.
lfFaceName,
tm.tmCharSet);
6727 skip(
"High-ascii character is not defined in codepage %d\n", ci.
ciACP);
6731 for (
j = 0;
j < 2;
j++) {
6741 ok(
ret,
"GetGlyphIndices failed\n");
6746 ok(
ret,
"ExtTextOutA failed\n");
6751 "Images are different (%s:%d)\n", lf.
lfFaceName,
tm.tmCharSet);
6753 for (
j = 0;
j < 2;
j++)
6764 static const char *teststr =
"wine ";
6775 memset(&lf, 0,
sizeof(lf));
6786 ok(nb ==
len,
"\n");
6790 ok(
ret,
"GetCharABCWidthsI failed\n");
6792 memset(widths, 0xcc,
sizeof(widths));
6794 ok(
ret,
"GetCharWidthI failed\n");
6796 for (
i = 0;
i <
len;
i++)
6797 ok(widths[
i] ==
abc[
i].abcA +
abc[
i].abcB +
abc[
i].abcC,
"%u, glyph %u, got width %d\n",
6822 skip(
"Failed to create ttf file for testing\n");
6829 ok(
ret,
"AddFontResourceEx() failed\n");
6831 strcpy(
font.lfFaceName,
"wine_3_this_is_a_very_long_name");
6834 ok(found_font ==
TRUE,
"EnumFontFamiliesExA didn't find font.\n");
6836 strcpy(
font.lfFaceName,
"wine_2_this_is_a_very_long_name");
6839 ok(found_font ==
TRUE,
"EnumFontFamiliesExA didn't find font.\n");
6841 strcpy(
font.lfFaceName,
"wine_1_this_is_a_very_long_name");
6844 ok(found_font ==
FALSE,
"EnumFontFamiliesExA must not find font.\n");
6847 ok(handle_font !=
NULL,
"CreateFontIndirectA failed\n");
6851 ok(
ret,
"RemoveFontResourceEx() failed\n");
6896 skip(
"Arial Black or Symbol/Wingdings is not installed\n");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
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 HeapFree(x, y, z)
#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 LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
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)
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)
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
static const WCHAR emptyW[]
static WCHAR have_file[PORTNAME_MAXSIZE]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
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 UINT UINT LPWORD LPABC abc
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_GdiGetCharDimensions(void)
static void test_GetTextMetrics(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 test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
static void test_GetGlyphIndices(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 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 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_orientation(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 test_EnumFonts_subst(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_AddFontMemResource(void)
static void test_GetGlyphOutline_metric_clipping(void)
static const WORD INT INT LPINT nfit
#define match_off_by_1(a, b, exact)
static UINT UINT LPWORD glyphs
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 LPCSTR INT LPWORD pgi
#define expect(expected, got)
static INT CALLBACK font_enum_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
static const WORD INT INT LPINT LPINT dxs
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 LPCSTR INT LPWORD DWORD flags
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 void testJustification(HDC hdc, PCSTR str, RECT *clientArea)
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_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)
static const WORD INT INT max_ext
#define MS_MAKE_TAG(ch0, ch1, ch2, ch3)
static void test_bitmap_font_glyph_index(void)
static void test_vertical_order(void)
static DWORD *static void DWORD *static ULONGLONG
static void test_fullname(void)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static void test_CreateScalableFontResource(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)
#define todo_wine_if(is_todo)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static int font_height(HFONT hFont)
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
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#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
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]
#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)
DWORD WINAPI GetLastError(void)
#define ERROR_FILE_EXISTS
#define ERROR_CAN_NOT_COMPLETE
int WINAPI SetMapMode(_In_ HDC, _In_ int)
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)
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)
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
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)
#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)
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)
#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
BOOL WINAPI GetCharWidthA(_In_ HDC hdc, _In_ UINT iFirst, _In_ UINT iLast, _Out_writes_(iLast+1 - iFirst) LPINT lpBuffer)
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)
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)