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
92c8cac2
Commit
92c8cac2
authored
Jun 23, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Return the correct value from GetTextFace.
parent
88a9ca7c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
font.c
dlls/gdi32/font.c
+13
-4
freetype.c
dlls/gdi32/freetype.c
+3
-2
font.c
dlls/gdi32/tests/font.c
+0
-5
No files found.
dlls/gdi32/font.c
View file @
92c8cac2
...
...
@@ -800,9 +800,17 @@ INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name )
if
(
name
)
{
if
(
count
&&
!
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
-
1
,
name
,
count
,
NULL
,
NULL
))
if
(
count
)
{
res
=
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
-
1
,
name
,
count
,
NULL
,
NULL
);
if
(
res
==
0
)
res
=
count
;
name
[
count
-
1
]
=
0
;
res
=
strlen
(
name
);
/* GetTextFaceA does NOT include the nul byte in the return count. */
res
--
;
}
else
res
=
0
;
}
else
res
=
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -825,12 +833,13 @@ INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name )
ret
=
WineEngGetTextFace
(
dc
->
gdiFont
,
count
,
name
);
else
if
((
font
=
(
FONTOBJ
*
)
GDI_GetObjPtr
(
dc
->
hFont
,
FONT_MAGIC
)))
{
INT
n
=
strlenW
(
font
->
logfont
.
lfFaceName
)
+
1
;
if
(
name
)
{
lstrcpynW
(
name
,
font
->
logfont
.
lfFaceName
,
count
);
ret
=
strlenW
(
name
);
ret
=
min
(
count
,
n
);
}
else
ret
=
strlenW
(
font
->
logfont
.
lfFaceName
)
+
1
;
else
ret
=
n
;
GDI_ReleaseObj
(
dc
->
hFont
);
}
release_dc_ptr
(
dc
);
...
...
dlls/gdi32/freetype.c
View file @
92c8cac2
...
...
@@ -5569,11 +5569,12 @@ DWORD WineEngGetFontData(GdiFont *font, DWORD table, DWORD offset, LPVOID buf,
*/
INT
WineEngGetTextFace
(
GdiFont
*
font
,
INT
count
,
LPWSTR
str
)
{
INT
n
=
strlenW
(
font
->
name
)
+
1
;
if
(
str
)
{
lstrcpynW
(
str
,
font
->
name
,
count
);
return
strlenW
(
font
->
name
);
return
min
(
count
,
n
);
}
else
return
strlenW
(
font
->
name
)
+
1
;
return
n
;
}
UINT
WineEngGetTextCharsetInfo
(
GdiFont
*
font
,
LPFONTSIGNATURE
fs
,
DWORD
flags
)
...
...
dlls/gdi32/tests/font.c
View file @
92c8cac2
...
...
@@ -2261,7 +2261,6 @@ static void test_GetTextFace(void)
/* Play with the count arg. */
bufA
[
0
]
=
'x'
;
n
=
GetTextFaceA
(
dc
,
0
,
bufA
);
todo_wine
ok
(
n
==
0
,
"GetTextFaceA returned %d
\n
"
,
n
);
ok
(
bufA
[
0
]
==
'x'
,
"GetTextFaceA buf[0] == %d
\n
"
,
bufA
[
0
]);
...
...
@@ -2289,26 +2288,22 @@ static void test_GetTextFace(void)
dc
=
GetDC
(
NULL
);
g
=
SelectObject
(
dc
,
f
);
n
=
GetTextFaceW
(
dc
,
sizeof
bufW
/
sizeof
bufW
[
0
],
bufW
);
todo_wine
ok
(
n
==
sizeof
faceW
/
sizeof
faceW
[
0
],
"GetTextFaceW returned %d
\n
"
,
n
);
ok
(
lstrcmpW
(
faceW
,
bufW
)
==
0
,
"GetTextFaceW
\n
"
);
/* Play with the count arg. */
bufW
[
0
]
=
'x'
;
n
=
GetTextFaceW
(
dc
,
0
,
bufW
);
todo_wine
ok
(
n
==
0
,
"GetTextFaceW returned %d
\n
"
,
n
);
ok
(
bufW
[
0
]
==
'x'
,
"GetTextFaceW buf[0] == %d
\n
"
,
bufW
[
0
]);
bufW
[
0
]
=
'x'
;
n
=
GetTextFaceW
(
dc
,
1
,
bufW
);
todo_wine
ok
(
n
==
1
,
"GetTextFaceW returned %d
\n
"
,
n
);
ok
(
bufW
[
0
]
==
'\0'
,
"GetTextFaceW buf[0] == %d
\n
"
,
bufW
[
0
]);
bufW
[
0
]
=
'x'
;
bufW
[
1
]
=
'y'
;
n
=
GetTextFaceW
(
dc
,
2
,
bufW
);
todo_wine
ok
(
n
==
2
,
"GetTextFaceW returned %d
\n
"
,
n
);
ok
(
bufW
[
0
]
==
faceW
[
0
]
&&
bufW
[
1
]
==
'\0'
,
"GetTextFaceW didn't copy
\n
"
);
...
...
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