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
2014da26
Commit
2014da26
authored
Sep 08, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Sep 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have ExtTextOut call into the font linking mechanism.
GetCharWidth, GetCharABCWidths and GetTextExtentPoint should return the widths of a linked font's glyphs.
parent
4e414963
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
23 deletions
+84
-23
font.c
dlls/gdi/font.c
+69
-11
freetype.c
dlls/gdi/freetype.c
+15
-12
No files found.
dlls/gdi/font.c
View file @
2014da26
...
...
@@ -1795,12 +1795,6 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if
(
flags
&
ETO_GLYPH_INDEX
)
glyphs
=
(
const
WORD
*
)
reordered_str
;
else
if
(
dc
->
gdiFont
)
{
glyphs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WCHAR
));
GetGlyphIndicesW
(
hdc
,
reordered_str
,
count
,
(
WORD
*
)
glyphs
,
0
);
flags
|=
ETO_GLYPH_INDEX
;
}
if
(
lprect
)
TRACE
(
"rect: %ld,%ld - %ld,%ld
\n
"
,
lprect
->
left
,
lprect
->
top
,
lprect
->
right
,
...
...
@@ -1891,7 +1885,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
deltas
[
i
]
=
tmpsz
.
cx
;
}
if
(
dc
->
breakExtra
&&
reordered_str
[
i
]
==
tm
.
tmBreakChar
)
if
(
!
(
flags
&
ETO_GLYPH_INDEX
)
&&
dc
->
breakExtra
&&
reordered_str
[
i
]
==
tm
.
tmBreakChar
)
{
deltas
[
i
]
=
deltas
[
i
]
+
dc
->
breakExtra
;
}
...
...
@@ -1979,8 +1973,74 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
}
}
ret
=
dc
->
funcs
->
pExtTextOut
(
dc
->
physDev
,
x
,
y
,
(
flags
&
~
ETO_OPAQUE
),
&
rc
,
(
flags
&
ETO_GLYPH_INDEX
)
?
glyphs
:
reordered_str
,
count
,
deltas
);
if
(
FontIsLinked
(
hdc
)
&&
!
(
flags
&
ETO_GLYPH_INDEX
))
{
HFONT
orig_font
=
dc
->
hFont
,
cur_font
;
UINT
glyph
;
WORD
*
glyphs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WORD
));
INT
span
=
0
,
*
offsets
=
NULL
,
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
WineEngGetLinkedHFont
(
dc
,
reordered_str
[
i
],
&
cur_font
,
&
glyph
);
if
(
cur_font
!=
dc
->
hFont
)
{
if
(
!
offsets
)
{
int
j
;
offsets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
deltas
));
offsets
[
0
]
=
0
;
if
(
!
deltas
)
{
SIZE
tmpsz
;
for
(
j
=
1
;
j
<
count
;
j
++
)
{
GetTextExtentPointW
(
hdc
,
reordered_str
+
j
-
1
,
1
,
&
tmpsz
);
offsets
[
j
]
=
offsets
[
j
-
1
]
+
INTERNAL_XWSTODS
(
dc
,
tmpsz
.
cx
);
}
}
else
{
for
(
j
=
1
;
j
<
count
;
j
++
)
offsets
[
j
]
=
offsets
[
j
-
1
]
+
deltas
[
j
];
}
}
if
(
span
)
{
dc
->
funcs
->
pExtTextOut
(
dc
->
physDev
,
x
+
offsets
[
i
-
span
]
*
cosEsc
,
y
-
offsets
[
i
-
span
]
*
sinEsc
,
(
flags
&
~
ETO_OPAQUE
)
|
ETO_GLYPH_INDEX
,
&
rc
,
glyphs
,
span
,
deltas
?
deltas
+
i
-
span
:
NULL
);
span
=
0
;
}
SelectObject
(
hdc
,
cur_font
);
}
glyphs
[
span
++
]
=
glyph
;
if
(
i
==
count
-
1
)
{
ret
=
dc
->
funcs
->
pExtTextOut
(
dc
->
physDev
,
x
+
(
offsets
?
offsets
[
count
-
span
]
*
cosEsc
:
0
),
y
-
(
offsets
?
offsets
[
count
-
span
]
*
sinEsc
:
0
),
(
flags
&
~
ETO_OPAQUE
)
|
ETO_GLYPH_INDEX
,
&
rc
,
glyphs
,
span
,
deltas
?
deltas
+
count
-
span
:
NULL
);
SelectObject
(
hdc
,
orig_font
);
HeapFree
(
GetProcessHeap
(),
0
,
glyphs
);
HeapFree
(
GetProcessHeap
(),
0
,
offsets
);
}
}
}
else
{
WORD
*
glyphs
=
NULL
;
if
(
!
(
flags
&
ETO_GLYPH_INDEX
)
&&
dc
->
gdiFont
)
{
glyphs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WORD
));
GetGlyphIndicesW
(
hdc
,
reordered_str
,
count
,
glyphs
,
0
);
flags
|=
ETO_GLYPH_INDEX
;
}
ret
=
dc
->
funcs
->
pExtTextOut
(
dc
->
physDev
,
x
,
y
,
(
flags
&
~
ETO_OPAQUE
),
&
rc
,
(
flags
&
ETO_GLYPH_INDEX
)
?
glyphs
:
reordered_str
,
count
,
deltas
);
HeapFree
(
GetProcessHeap
(),
0
,
glyphs
);
}
if
(
lf
.
lfUnderline
||
lf
.
lfStrikeOut
)
{
...
...
@@ -2045,8 +2105,6 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
done:
HeapFree
(
GetProcessHeap
(),
0
,
deltas
);
if
(
glyphs
&&
glyphs
!=
reordered_str
)
HeapFree
(
GetProcessHeap
(),
0
,
(
WORD
*
)
glyphs
);
if
(
reordered_str
!=
str
)
HeapFree
(
GetProcessHeap
(),
0
,
reordered_str
);
...
...
dlls/gdi/freetype.c
View file @
2014da26
...
...
@@ -3346,14 +3346,15 @@ BOOL WineEngGetCharWidth(GdiFont font, UINT firstChar, UINT lastChar,
UINT
c
;
GLYPHMETRICS
gm
;
FT_UInt
glyph_index
;
GdiFont
linked_font
;
TRACE
(
"%p, %d, %d, %p
\n
"
,
font
,
firstChar
,
lastChar
,
buffer
);
for
(
c
=
firstChar
;
c
<=
lastChar
;
c
++
)
{
g
lyph_index
=
get_glyph_index
(
font
,
c
);
WineEngGetGlyphOutline
(
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
g
et_glyph_index_linked
(
font
,
c
,
&
linked_font
,
&
glyph_index
);
WineEngGetGlyphOutline
(
linked_
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
&
gm
,
0
,
NULL
,
NULL
);
buffer
[
c
-
firstChar
]
=
font
->
gm
[
glyph_index
].
adv
;
buffer
[
c
-
firstChar
]
=
linked_
font
->
gm
[
glyph_index
].
adv
;
}
return
TRUE
;
}
...
...
@@ -3368,6 +3369,7 @@ BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, UINT lastChar,
UINT
c
;
GLYPHMETRICS
gm
;
FT_UInt
glyph_index
;
GdiFont
linked_font
;
TRACE
(
"%p, %d, %d, %p
\n
"
,
font
,
firstChar
,
lastChar
,
buffer
);
...
...
@@ -3375,13 +3377,13 @@ BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar, UINT lastChar,
return
FALSE
;
for
(
c
=
firstChar
;
c
<=
lastChar
;
c
++
)
{
g
lyph_index
=
get_glyph_index
(
font
,
c
);
WineEngGetGlyphOutline
(
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
g
et_glyph_index_linked
(
font
,
c
,
&
linked_font
,
&
glyph_index
);
WineEngGetGlyphOutline
(
linked_
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
&
gm
,
0
,
NULL
,
NULL
);
buffer
[
c
-
firstChar
].
abcA
=
font
->
gm
[
glyph_index
].
lsb
;
buffer
[
c
-
firstChar
].
abcB
=
font
->
gm
[
glyph_index
].
bbx
;
buffer
[
c
-
firstChar
].
abcC
=
font
->
gm
[
glyph_index
].
adv
-
font
->
gm
[
glyph_index
].
lsb
-
font
->
gm
[
glyph_index
].
bbx
;
buffer
[
c
-
firstChar
].
abcA
=
linked_
font
->
gm
[
glyph_index
].
lsb
;
buffer
[
c
-
firstChar
].
abcB
=
linked_
font
->
gm
[
glyph_index
].
bbx
;
buffer
[
c
-
firstChar
].
abcC
=
linked_font
->
gm
[
glyph_index
].
adv
-
linked_
font
->
gm
[
glyph_index
].
lsb
-
linked_
font
->
gm
[
glyph_index
].
bbx
;
}
return
TRUE
;
}
...
...
@@ -3397,6 +3399,7 @@ BOOL WineEngGetTextExtentPoint(GdiFont font, LPCWSTR wstr, INT count,
GLYPHMETRICS
gm
;
TEXTMETRICW
tm
;
FT_UInt
glyph_index
;
GdiFont
linked_font
;
TRACE
(
"%p, %s, %d, %p
\n
"
,
font
,
debugstr_wn
(
wstr
,
count
),
count
,
size
);
...
...
@@ -3406,10 +3409,10 @@ BOOL WineEngGetTextExtentPoint(GdiFont font, LPCWSTR wstr, INT count,
size
->
cy
=
tm
.
tmHeight
;
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
glyph_index
=
get_glyph_index
(
font
,
wstr
[
idx
]
);
WineEngGetGlyphOutline
(
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
get_glyph_index_linked
(
font
,
wstr
[
idx
],
&
linked_font
,
&
glyph_index
);
WineEngGetGlyphOutline
(
linked_
font
,
glyph_index
,
GGO_METRICS
|
GGO_GLYPH_INDEX
,
&
gm
,
0
,
NULL
,
NULL
);
size
->
cx
+=
font
->
gm
[
glyph_index
].
adv
;
size
->
cx
+=
linked_
font
->
gm
[
glyph_index
].
adv
;
}
TRACE
(
"return %ld,%ld
\n
"
,
size
->
cx
,
size
->
cy
);
return
TRUE
;
...
...
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