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
3f8e407d
Commit
3f8e407d
authored
Nov 05, 2001
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 05, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert GetCharWidth to Unicode.
parent
38a247fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
10 deletions
+41
-10
xfont.c
graphics/x11drv/xfont.c
+8
-3
font.c
objects/font.c
+33
-7
No files found.
graphics/x11drv/xfont.c
View file @
3f8e407d
...
...
@@ -3326,10 +3326,15 @@ BOOL X11DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
for
(
i
=
firstChar
;
i
<=
lastChar
;
i
++
)
{
if
(
i
>=
pfo
->
fs
->
min_char_or_byte2
&&
i
<=
pfo
->
fs
->
max_char_or_byte2
)
WCHAR
wch
=
i
;
BYTE
ch
;
UINT
ch_f
;
/* character code in the font encoding */
WideCharToMultiByte
(
pfo
->
fi
->
codepage
,
0
,
&
wch
,
1
,
&
ch
,
1
,
NULL
,
NULL
);
ch_f
=
ch
;
if
(
ch_f
>=
pfo
->
fs
->
min_char_or_byte2
&&
ch_f
<=
pfo
->
fs
->
max_char_or_byte2
)
{
cs
=
&
pfo
->
fs
->
per_char
[(
i
-
pfo
->
fs
->
min_char_or_byte2
)];
cs
=
&
pfo
->
fs
->
per_char
[(
ch_f
-
pfo
->
fs
->
min_char_or_byte2
)];
if
(
CI_NONEXISTCHAR
(
cs
))
cs
=
def
;
}
else
cs
=
def
;
if
(
pfo
->
lpX11Trans
)
...
...
objects/font.c
View file @
3f8e407d
...
...
@@ -1507,10 +1507,10 @@ BOOL16 WINAPI GetCharWidth16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar,
/***********************************************************************
* GetCharWidth
A
(GDI32.@)
* GetCharWidth32
A
(GDI32.@)
* GetCharWidth
W
(GDI32.@)
* GetCharWidth32
W
(GDI32.@)
*/
BOOL
WINAPI
GetCharWidth32
A
(
HDC
hdc
,
UINT
firstChar
,
UINT
lastChar
,
BOOL
WINAPI
GetCharWidth32
W
(
HDC
hdc
,
UINT
firstChar
,
UINT
lastChar
,
LPINT
buffer
)
{
UINT
i
,
extra
;
...
...
@@ -1538,13 +1538,39 @@ BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar,
/***********************************************************************
* GetCharWidth
W
(GDI32.@)
* GetCharWidth32
W
(GDI32.@)
* GetCharWidth
A
(GDI32.@)
* GetCharWidth32
A
(GDI32.@)
*/
BOOL
WINAPI
GetCharWidth32
W
(
HDC
hdc
,
UINT
firstChar
,
UINT
lastChar
,
BOOL
WINAPI
GetCharWidth32
A
(
HDC
hdc
,
UINT
firstChar
,
UINT
lastChar
,
LPINT
buffer
)
{
return
GetCharWidth32A
(
hdc
,
firstChar
,
lastChar
,
buffer
);
INT
i
,
wlen
,
count
=
(
INT
)(
lastChar
-
firstChar
+
1
);
LPSTR
str
;
LPWSTR
wstr
;
BOOL
ret
=
TRUE
;
if
(
count
<=
0
)
return
FALSE
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
str
[
i
]
=
(
BYTE
)(
firstChar
+
i
);
wstr
=
FONT_mbtowc
(
hdc
,
str
,
count
,
&
wlen
,
NULL
);
for
(
i
=
0
;
i
<
wlen
;
i
++
)
{
if
(
!
GetCharWidth32W
(
hdc
,
wstr
[
i
],
wstr
[
i
],
buffer
))
{
ret
=
FALSE
;
break
;
}
buffer
++
;
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
HeapFree
(
GetProcessHeap
(),
0
,
wstr
);
return
ret
;
}
...
...
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