Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
fef698c8
Commit
fef698c8
authored
23 years ago
by
Huw D. M. Davies
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GetTextCharsetInfo should return the charset that the driver is
actually using, rather than that specified in the LOGFONT.
parent
9d382c65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
objects/text.c
+12
-14
12 additions, 14 deletions
objects/text.c
with
12 additions
and
14 deletions
objects/text.c
+
12
−
14
View file @
fef698c8
...
...
@@ -32,19 +32,17 @@ DEFAULT_DEBUG_CHANNEL(text);
*/
LPWSTR
FONT_mbtowc
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
INT
*
plenW
,
UINT
*
pCP
)
{
LOGFONTW
lf
;
UINT
cp
=
CP_ACP
;
INT
lenW
;
LPWSTR
strW
;
CHARSETINFO
csi
;
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
int
charset
=
GetTextCharset
(
hdc
);
/* Hmm, nicely designed api this one! */
if
(
TranslateCharsetInfo
((
DWORD
*
)
(
UINT
)
lf
.
lfC
har
S
et
,
&
csi
,
TCI_SRCCHARSET
))
if
(
TranslateCharsetInfo
((
DWORD
*
)
c
har
s
et
,
&
csi
,
TCI_SRCCHARSET
))
cp
=
csi
.
ciACP
;
else
{
switch
(
lf
.
lfC
har
S
et
)
{
switch
(
c
har
s
et
)
{
case
SYMBOL_CHARSET
:
cp
=
CP_SYMBOL
;
break
;
...
...
@@ -74,7 +72,7 @@ LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
default:
FIXME
(
"Can't find codepage for charset %d
\n
"
,
lf
.
lfC
har
S
et
);
FIXME
(
"Can't find codepage for charset %d
\n
"
,
c
har
s
et
);
break
;
}
}
...
...
@@ -226,6 +224,10 @@ UINT16 WINAPI GetTextCharset16(HDC16 hdc)
* Should it return a UINT32 instead of an INT32?
* => YES and YES, from win32.hlp from Borland
*
* This returns the actual charset selected by the driver rather than the
* value in lf.lfCharSet during CreateFont, to get that use
* GetObject(GetCurrentObject(...),...)
*
* RETURNS
* Success: Character set identifier
* Failure: DEFAULT_CHARSET
...
...
@@ -235,20 +237,16 @@ UINT WINAPI GetTextCharsetInfo(
LPFONTSIGNATURE
fs
,
/* [out] Pointer to struct to receive data */
DWORD
flags
)
/* [in] Reserved - must be 0 */
{
HGDIOBJ
hFont
;
UINT
charSet
=
DEFAULT_CHARSET
;
LOGFONTW
lf
;
CHARSETINFO
csinfo
;
TEXTMETRICW
tm
;
hFont
=
GetCurrentObject
(
hdc
,
OBJ_FONT
);
if
(
hFont
==
0
)
return
(
DEFAULT_CHARSET
);
if
(
GetObjectW
(
hFont
,
sizeof
(
LOGFONTW
),
&
lf
)
!=
0
)
charSet
=
lf
.
lfCharSet
;
if
(
!
GetTextMetricsW
(
hdc
,
&
tm
))
return
DEFAULT_CHARSET
;
charSet
=
tm
.
tmCharSet
;
if
(
fs
!=
NULL
)
{
if
(
!
TranslateCharsetInfo
((
LPDWORD
)
charSet
,
&
csinfo
,
TCI_SRCCHARSET
))
return
(
DEFAULT_CHARSET
)
;
return
DEFAULT_CHARSET
;
memcpy
(
fs
,
&
csinfo
.
fs
,
sizeof
(
FONTSIGNATURE
));
}
return
charSet
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment