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);
2545 ok(csi.
ciACP == code_page,
"expected %d, got %d\n", code_page, csi.
ciACP);
2547 if (pGdiGetCodePage !=
NULL && pGdiGetCodePage(
hdc) != code_page)
2549 skip(
"Font code page %d, looking for code page %d\n",
2550 pGdiGetCodePage(
hdc), code_page);
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");