Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
fef698c8
Commit
fef698c8
authored
Oct 10, 2001
by
Huw D M Davies
Committed by
Alexandre Julliard
Oct 10, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetTextCharsetInfo should return the charset that the driver is
actually using, rather than that specified in the LOGFONT.
parent
9d382c65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
text.c
objects/text.c
+12
-14
No files found.
objects/text.c
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
.
lfCharS
et
,
&
csi
,
TCI_SRCCHARSET
))
if
(
TranslateCharsetInfo
((
DWORD
*
)
chars
et
,
&
csi
,
TCI_SRCCHARSET
))
cp
=
csi
.
ciACP
;
else
{
switch
(
lf
.
lfCharS
et
)
{
switch
(
chars
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
.
lfCharS
et
);
FIXME
(
"Can't find codepage for charset %d
\n
"
,
chars
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
;
...
...
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