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
7901c0b5
Commit
7901c0b5
authored
Aug 20, 2000
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Aug 20, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle the codepage of fonts if supported by the graphics driver.
parent
5b1b5120
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
39 deletions
+60
-39
xfont.c
graphics/x11drv/xfont.c
+4
-0
gdi.h
include/gdi.h
+1
-0
dc.c
objects/dc.c
+1
-0
font.c
objects/font.c
+20
-14
text.c
objects/text.c
+34
-25
No files found.
graphics/x11drv/xfont.c
View file @
7901c0b5
...
...
@@ -2995,6 +2995,10 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
hPrevFont
=
dc
->
w
.
hFont
;
dc
->
w
.
hFont
=
hfont
;
dc
->
w
.
codepage
=
CP_ACP
;
/* NOTE: the codepage of UNICODE is treated as CP_ACP(=0) */
if
(
CHECK_PFONT
(
physDev
->
font
)
)
dc
->
w
.
codepage
=
__PFONT
(
physDev
->
font
)
->
fi
->
codepage
;
LeaveCriticalSection
(
&
crtsc_fonts_X11
);
...
...
include/gdi.h
View file @
7901c0b5
...
...
@@ -134,6 +134,7 @@ typedef struct
XFORM
xformWorld2Vport
;
/* World-to-viewport transformation */
XFORM
xformVport2World
;
/* Inverse of the above transformation */
BOOL
vport2WorldValid
;
/* Is xformVport2World valid? */
WORD
codepage
;
/* codepage of the selected font */
}
WIN_DC_INFO
;
...
...
objects/dc.c
View file @
7901c0b5
...
...
@@ -73,6 +73,7 @@ static void DC_Init_DC_INFO( WIN_DC_INFO *win_dc_info )
win_dc_info
->
xformWorld2Vport
=
win_dc_info
->
xformWorld2Wnd
;
win_dc_info
->
xformVport2World
=
win_dc_info
->
xformWorld2Wnd
;
win_dc_info
->
vport2WorldValid
=
TRUE
;
win_dc_info
->
codepage
=
CP_ACP
;
PATH_InitGdiPath
(
&
win_dc_info
->
path
);
}
...
...
objects/font.c
View file @
7901c0b5
...
...
@@ -889,22 +889,28 @@ BOOL16 WINAPI GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count,
BOOL
WINAPI
GetTextExtentPoint32A
(
HDC
hdc
,
LPCSTR
str
,
INT
count
,
LPSIZE
size
)
{
LPWSTR
p
;
BOOL
ret
;
UINT
codepage
=
CP_ACP
;
/* FIXME: get codepage of font charset */
UINT
wlen
;
/* str may not be 0 terminated so we can't use HEAP_strdupWtoA.
* We allocate one more than we need so that lstrcpynWtoA can write a
* trailing 0 if it wants.
*/
BOOL
ret
=
FALSE
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
wlen
=
MultiByteToWideChar
(
codepage
,
0
,
str
,
count
,
NULL
,
0
);
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
WCHAR
)
);
wlen
=
MultiByteToWideChar
(
codepage
,
0
,
str
,
count
,
p
,
wlen
);
if
(
!
dc
)
return
FALSE
;
ret
=
GetTextExtentPoint32W
(
hdc
,
p
,
wlen
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
p
);
if
(
dc
->
funcs
->
pGetTextExtentPoint
)
{
/* str may not be 0 terminated so we can't use HEAP_strdupWtoA.
* So we use MultiByteToWideChar.
*/
UINT
wlen
=
MultiByteToWideChar
(
dc
->
w
.
codepage
,
0
,
str
,
count
,
NULL
,
0
);
LPWSTR
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
WCHAR
)
);
if
(
p
)
{
wlen
=
MultiByteToWideChar
(
dc
->
w
.
codepage
,
0
,
str
,
count
,
p
,
wlen
);
ret
=
dc
->
funcs
->
pGetTextExtentPoint
(
dc
,
p
,
wlen
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
p
);
}
}
GDI_ReleaseObj
(
hdc
);
TRACE
(
"(%08x %s %d %p): returning %d,%d
\n
"
,
hdc
,
debugstr_an
(
str
,
count
),
count
,
size
,
size
->
cx
,
size
->
cy
);
return
ret
;
}
...
...
objects/text.c
View file @
7901c0b5
...
...
@@ -52,35 +52,44 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
const
RECT
*
lprect
,
LPCSTR
str
,
UINT
count
,
const
INT
*
lpDx
)
{
DC
*
dc
=
DC_GetDCUpdate
(
hdc
);
LPWSTR
p
;
INT
ret
;
UINT
codepage
=
CP_ACP
;
/* FIXME: get codepage of font charset */
UINT
wlen
;
BOOL
ret
=
FALSE
;
LPINT
lpDxW
=
NULL
;
wlen
=
MultiByteToWideChar
(
codepage
,
0
,
str
,
count
,
NULL
,
0
);
if
(
lpDx
){
int
i
,
j
;
i
=
0
;
j
=
0
;
lpDxW
=
(
LPINT
)
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
INT
));
while
(
i
<
count
){
if
(
IsDBCSLeadByteEx
(
codepage
,
str
[
i
])){
lpDxW
[
j
++
]
=
lpDx
[
i
]
+
lpDx
[
i
+
1
];
i
=
i
+
2
;
}
else
{
lpDxW
[
j
++
]
=
lpDx
[
i
];
i
=
i
+
1
;
}
}
lpDx
=
lpDxW
;
if
(
!
dc
)
return
FALSE
;
if
(
dc
->
funcs
->
pExtTextOut
)
{
UINT
wlen
=
MultiByteToWideChar
(
dc
->
w
.
codepage
,
0
,
str
,
count
,
NULL
,
0
);
if
(
lpDx
)
{
int
i
=
0
,
j
=
0
;
lpDxW
=
(
LPINT
)
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
INT
));
while
(
i
<
count
)
{
if
(
IsDBCSLeadByteEx
(
dc
->
w
.
codepage
,
str
[
i
]))
{
lpDxW
[
j
++
]
=
lpDx
[
i
]
+
lpDx
[
i
+
1
];
i
=
i
+
2
;
}
else
{
lpDxW
[
j
++
]
=
lpDx
[
i
];
i
=
i
+
1
;
}
}
}
if
((
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
WCHAR
)
)))
{
wlen
=
MultiByteToWideChar
(
dc
->
w
.
codepage
,
0
,
str
,
count
,
p
,
wlen
);
ret
=
dc
->
funcs
->
pExtTextOut
(
dc
,
x
,
y
,
flags
,
lprect
,
p
,
wlen
,
lpDxW
);
HeapFree
(
GetProcessHeap
(),
0
,
p
);
}
if
(
lpDxW
)
HeapFree
(
GetProcessHeap
(),
0
,
lpDxW
);
}
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wlen
*
sizeof
(
WCHAR
)
);
wlen
=
MultiByteToWideChar
(
codepage
,
0
,
str
,
count
,
p
,
wlen
);
ret
=
ExtTextOutW
(
hdc
,
x
,
y
,
flags
,
lprect
,
p
,
wlen
,
lpDxW
);
if
(
lpDxW
)
HeapFree
(
GetProcessHeap
(),
0
,
lpDxW
);
HeapFree
(
GetProcessHeap
(),
0
,
p
);
GDI_ReleaseObj
(
hdc
);
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