Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a5d288f0
Commit
a5d288f0
authored
May 13, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add more font substitution tests, make them pass under Wine.
parent
68420896
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
5 deletions
+86
-5
freetype.c
dlls/gdi32/freetype.c
+3
-2
font.c
dlls/gdi32/tests/font.c
+83
-3
No files found.
dlls/gdi32/freetype.c
View file @
a5d288f0
...
...
@@ -2965,7 +2965,7 @@ static void calc_hash(FONT_DESC *pfd)
return
;
}
static
GdiFont
*
find_in_cache
(
HFONT
hfont
,
LOGFONTW
*
plf
,
XFORM
*
pxf
,
BOOL
can_use_bitmap
)
static
GdiFont
*
find_in_cache
(
HFONT
hfont
,
const
LOGFONTW
*
plf
,
const
XFORM
*
pxf
,
BOOL
can_use_bitmap
)
{
GdiFont
*
ret
;
FONT_DESC
fd
;
...
...
@@ -3288,7 +3288,8 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
/* If requested charset was DEFAULT_CHARSET then try using charset
corresponding to the current ansi codepage */
if
(
!
csi
.
fs
.
fsCsb
[
0
])
{
if
(
!
csi
.
fs
.
fsCsb
[
0
]
||
lf
.
lfWeight
==
FW_DONTCARE
)
{
INT
acp
=
GetACP
();
if
(
!
TranslateCharsetInfo
((
DWORD
*
)(
INT_PTR
)
acp
,
&
csi
,
TCI_SRCCODEPAGE
))
{
FIXME
(
"TCI failed on codepage %d
\n
"
,
acp
);
...
...
dlls/gdi32/tests/font.c
View file @
a5d288f0
...
...
@@ -1778,14 +1778,26 @@ static void test_nonexistent_font(void)
LOGFONTA
lf
;
HDC
hdc
;
HFONT
hfont
;
CHARSETINFO
csi
;
INT
cs
,
expected_cs
;
char
buf
[
LF_FACESIZE
];
if
(
!
is_truetype_font_installed
(
"Arial Black"
))
if
(
!
is_truetype_font_installed
(
"Arial"
)
||
!
is_truetype_font_installed
(
"Times New Roman"
))
{
skip
(
"Arial not installed
\n
"
);
skip
(
"Arial
or Times New Roman
not installed
\n
"
);
return
;
}
expected_cs
=
GetACP
();
if
(
!
TranslateCharsetInfo
(
ULongToPtr
(
expected_cs
),
&
csi
,
TCI_SRCCODEPAGE
))
{
skip
(
"TranslateCharsetInfo failed for code page %d
\n
"
,
expected_cs
);
return
;
}
expected_cs
=
csi
.
ciCharset
;
trace
(
"ACP %d -> charset %d
\n
"
,
GetACP
(),
expected_cs
);
hdc
=
GetDC
(
0
);
memset
(
&
lf
,
0
,
sizeof
(
lf
));
...
...
@@ -1794,12 +1806,80 @@ static void test_nonexistent_font(void)
lf
.
lfCharSet
=
ANSI_CHARSET
;
lf
.
lfPitchAndFamily
=
FF_SWISS
;
strcpy
(
lf
.
lfFaceName
,
"Nonexistent font"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
ok
(
!
lstrcmpiA
(
buf
,
"Arial"
),
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
ANSI_CHARSET
,
"expected ANSI_CHARSET, got %d
\n
"
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
13
;
lf
.
lfWeight
=
FW_DONTCARE
;
strcpy
(
lf
.
lfFaceName
,
"Nonexistent font"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
todo_wine
/* Wine uses Arial for all substitutions */
ok
(
!
lstrcmpiA
(
buf
,
"Nonexistent font"
)
/* XP, Vista */
||
!
lstrcmpiA
(
buf
,
"MS Serif"
)
/* Win9x */
,
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
expected_cs
,
"expected %d, got %d
\n
"
,
expected_cs
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
13
;
lf
.
lfWeight
=
FW_REGULAR
;
strcpy
(
lf
.
lfFaceName
,
"Nonexistent font"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
ok
(
!
lstrcmpiA
(
buf
,
"Arial"
)
/* XP, Vista */
||
!
lstrcmpiA
(
buf
,
"Times New Roman"
)
/* Win9x */
,
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
ANSI_CHARSET
,
"expected ANSI_CHARSET, got %d
\n
"
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
13
;
lf
.
lfWeight
=
FW_DONTCARE
;
strcpy
(
lf
.
lfFaceName
,
"Times New Roman CE"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
todo_wine
/* Wine uses Arial for all substitutions */
ok
(
!
lstrcmpiA
(
buf
,
"Times New Roman CE"
)
/* XP, Vista */
||
!
lstrcmpiA
(
buf
,
"MS Serif"
)
/* Win9x */
,
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
expected_cs
,
"expected %d, got %d
\n
"
,
expected_cs
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
13
;
lf
.
lfWeight
=
FW_DONTCARE
;
strcpy
(
lf
.
lfFaceName
,
"Times New Roman"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
ok
(
!
lstrcmpiA
(
buf
,
"Times New Roman"
),
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
ANSI_CHARSET
,
"expected ANSI_CHARSET, got %d
\n
"
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
13
;
lf
.
lfWeight
=
FW_REGULAR
;
strcpy
(
lf
.
lfFaceName
,
"Times New Roman CE"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextFaceA
(
hdc
,
sizeof
(
buf
),
buf
);
ok
(
!
lstrcmpiA
(
buf
,
"Arial"
)
/* XP, Vista */
||
!
lstrcmpiA
(
buf
,
"Times New Roman"
)
/* Win9x */
,
"Got %s
\n
"
,
buf
);
cs
=
GetTextCharset
(
hdc
);
ok
(
cs
==
ANSI_CHARSET
,
"expected ANSI_CHARSET, got %d
\n
"
,
cs
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
ReleaseDC
(
0
,
hdc
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment