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
bc710312
Commit
bc710312
authored
Nov 15, 2002
by
Huw Davies
Committed by
Alexandre Julliard
Nov 15, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper handling of SetTextCharacterExtra.
parent
6d886a52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
15 deletions
+41
-15
dc.c
dlls/gdi/mfdrv/dc.c
+3
-1
text.c
dlls/wineps/text.c
+30
-6
font.c
objects/font.c
+8
-8
No files found.
dlls/gdi/mfdrv/dc.c
View file @
bc710312
...
...
@@ -85,7 +85,9 @@ INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks )
INT
MFDRV_SetTextCharacterExtra
(
PHYSDEV
dev
,
INT
extra
)
{
return
MFDRV_MetaParam1
(
dev
,
META_SETTEXTCHAREXTRA
,
extra
);
if
(
!
MFDRV_MetaParam1
(
dev
,
META_SETTEXTCHAREXTRA
,
extra
))
return
0x80000000
;
return
TRUE
;
}
DWORD
MFDRV_SetMapperFlags
(
PHYSDEV
dev
,
DWORD
flags
)
...
...
dlls/wineps/text.c
View file @
bc710312
...
...
@@ -95,6 +95,8 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
WORD
*
glyphs
=
NULL
;
DC
*
dc
=
physDev
->
dc
;
UINT
align
=
GetTextAlign
(
physDev
->
hdc
);
INT
char_extra
;
INT
*
deltas
=
NULL
;
if
(
!
count
)
return
TRUE
;
...
...
@@ -125,7 +127,27 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
else
GetTextExtentPoint32W
(
physDev
->
hdc
,
str
,
count
,
&
sz
);
if
(
lpDx
)
{
if
((
char_extra
=
GetTextCharacterExtra
(
physDev
->
hdc
))
!=
0
)
{
INT
i
;
SIZE
tmpsz
;
deltas
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
INT
));
for
(
i
=
0
;
i
<
count
;
i
++
)
{
deltas
[
i
]
=
char_extra
;
if
(
lpDx
)
deltas
[
i
]
+=
lpDx
[
i
];
else
{
if
(
physDev
->
font
.
fontloc
==
Download
)
GetTextExtentPointI
(
physDev
->
hdc
,
glyphs
+
i
,
1
,
&
tmpsz
);
else
GetTextExtentPoint32W
(
physDev
->
hdc
,
str
+
i
,
1
,
&
tmpsz
);
deltas
[
i
]
+=
tmpsz
.
cx
;
}
}
}
else
if
(
lpDx
)
deltas
=
(
INT
*
)
lpDx
;
if
(
deltas
)
{
SIZE
tmpsz
;
INT
i
;
/* Get the width of the last char and add on all the offsets */
...
...
@@ -134,7 +156,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
else
GetTextExtentPoint32W
(
physDev
->
hdc
,
str
+
count
-
1
,
1
,
&
tmpsz
);
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
tmpsz
.
cx
+=
lpDx
[
i
];
tmpsz
.
cx
+=
deltas
[
i
];
sz
.
cx
=
tmpsz
.
cx
;
/* sz.cy remains untouched */
}
...
...
@@ -201,7 +223,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
PSDRV_WriteMoveTo
(
physDev
,
x
,
y
);
if
(
!
lpDx
)
{
if
(
!
deltas
)
{
if
(
physDev
->
font
.
fontloc
==
Download
)
PSDRV_WriteDownloadGlyphShow
(
physDev
,
glyphs
,
count
);
else
...
...
@@ -213,13 +235,13 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
float
cos_theta
=
cos
(
physDev
->
font
.
escapement
*
M_PI
/
1800
.
0
);
float
sin_theta
=
sin
(
physDev
->
font
.
escapement
*
M_PI
/
1800
.
0
);
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
{
TRACE
(
"lpDx[%d] = %d
\n
"
,
i
,
lpDx
[
i
]);
TRACE
(
"lpDx[%d] = %d
\n
"
,
i
,
deltas
[
i
]);
if
(
physDev
->
font
.
fontloc
==
Download
)
PSDRV_WriteDownloadGlyphShow
(
physDev
,
glyphs
+
i
,
1
);
else
PSDRV_WriteBuiltinGlyphShow
(
physDev
,
str
+
i
,
1
);
dx
+=
lpDx
[
i
]
*
cos_theta
;
dy
-=
lpDx
[
i
]
*
sin_theta
;
dx
+=
deltas
[
i
]
*
cos_theta
;
dy
-=
deltas
[
i
]
*
sin_theta
;
PSDRV_WriteMoveTo
(
physDev
,
x
+
INTERNAL_XWSTODS
(
dc
,
dx
),
y
+
INTERNAL_YWSTODS
(
dc
,
dy
));
}
...
...
@@ -227,6 +249,8 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, LPCWSTR
PSDRV_WriteDownloadGlyphShow
(
physDev
,
glyphs
+
i
,
1
);
else
PSDRV_WriteBuiltinGlyphShow
(
physDev
,
str
+
i
,
1
);
if
(
deltas
!=
lpDx
)
HeapFree
(
GetProcessHeap
(),
0
,
deltas
);
}
/*
...
...
objects/font.c
View file @
bc710312
...
...
@@ -317,10 +317,12 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
{
memcpy
(
&
fontPtr
->
logfont
,
plf
,
sizeof
(
LOGFONTW
)
);
TRACE
(
"(%ld %ld %ld %ld %x) %s %s %s => %04x
\n
"
,
TRACE
(
"(%ld %ld %ld %ld %x
%d %x %d %d
) %s %s %s => %04x
\n
"
,
plf
->
lfHeight
,
plf
->
lfWidth
,
plf
->
lfEscapement
,
plf
->
lfOrientation
,
plf
->
lfPitchAndFamily
,
plf
->
lfOutPrecision
,
plf
->
lfClipPrecision
,
plf
->
lfQuality
,
plf
->
lfCharSet
,
debugstr_w
(
plf
->
lfFaceName
),
plf
->
lfWeight
>
400
?
"Bold"
:
""
,
plf
->
lfItalic
?
"Italic"
:
""
,
hFont
);
...
...
@@ -766,9 +768,8 @@ INT WINAPI GetTextCharacterExtra( HDC hdc )
{
INT
ret
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
0
;
ret
=
abs
(
(
dc
->
charExtra
*
dc
->
wndExtX
+
dc
->
vportExtX
/
2
)
/
dc
->
vportExtX
);
if
(
!
dc
)
return
0x80000000
;
ret
=
dc
->
charExtra
;
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
...
...
@@ -781,14 +782,13 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{
INT
prev
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
!
dc
)
return
0
x80000000
;
if
(
dc
->
funcs
->
pSetTextCharacterExtra
)
prev
=
dc
->
funcs
->
pSetTextCharacterExtra
(
dc
->
physDev
,
extra
);
else
{
extra
=
(
extra
*
dc
->
vportExtX
+
dc
->
wndExtX
/
2
)
/
dc
->
wndExtX
;
prev
=
(
dc
->
charExtra
*
dc
->
wndExtX
+
dc
->
vportExtX
/
2
)
/
dc
->
vportExtX
;
dc
->
charExtra
=
abs
(
extra
);
prev
=
dc
->
charExtra
;
dc
->
charExtra
=
extra
;
}
GDI_ReleaseObj
(
hdc
);
return
prev
;
...
...
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