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
e93d3481
Commit
e93d3481
authored
Feb 16, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Improve calculation of the character code text metrics.
parent
9d9880bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
12 deletions
+22
-12
font.c
dlls/gdi32/font.c
+8
-6
freetype.c
dlls/gdi32/freetype.c
+14
-6
font.c
dlls/gdi32/tests/font.c
+0
-0
No files found.
dlls/gdi32/font.c
View file @
e93d3481
...
...
@@ -212,14 +212,16 @@ static void FONT_TextMetricWToA(const TEXTMETRICW *ptmW, LPTEXTMETRICA ptmA )
ptmA
->
tmFirstChar
=
min
(
ptmW
->
tmFirstChar
,
255
);
if
(
ptmW
->
tmCharSet
==
SYMBOL_CHARSET
)
{
UINT
last_char
=
ptmW
->
tmLastChar
;
if
(
last_char
>
0xf000
)
last_char
-=
0xf000
;
ptmA
->
tmLastChar
=
min
(
last_char
,
255
);
ptmA
->
tmFirstChar
=
0x1e
;
ptmA
->
tmLastChar
=
0xff
;
/* win9x behaviour - we need the OS2 table data to calculate correctly */
}
else
ptmA
->
tmLastChar
=
min
(
ptmW
->
tmLastChar
,
255
);
ptmA
->
tmDefaultChar
=
min
(
ptmW
->
tmDefaultChar
,
255
);
ptmA
->
tmBreakChar
=
min
(
ptmW
->
tmBreakChar
,
255
);
{
ptmA
->
tmFirstChar
=
ptmW
->
tmDefaultChar
-
1
;
ptmA
->
tmLastChar
=
min
(
ptmW
->
tmLastChar
,
0xff
);
}
ptmA
->
tmDefaultChar
=
ptmW
->
tmDefaultChar
;
ptmA
->
tmBreakChar
=
ptmW
->
tmBreakChar
;
ptmA
->
tmItalic
=
ptmW
->
tmItalic
;
ptmA
->
tmUnderlined
=
ptmW
->
tmUnderlined
;
ptmA
->
tmStruckOut
=
ptmW
->
tmStruckOut
;
...
...
dlls/gdi32/freetype.c
View file @
e93d3481
...
...
@@ -5396,18 +5396,26 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
/* It appears that for fonts with SYMBOL_CHARSET Windows always sets
* symbol range to 0 - f0ff
*/
if
(
font
->
charset
==
SYMBOL_CHARSET
)
if
(
font
->
charset
==
SYMBOL_CHARSET
||
(
pOS2
->
usFirstCharIndex
>=
0xf000
&&
pOS2
->
usFirstCharIndex
<
0xf100
)
)
{
TM
.
tmFirstChar
=
0
;
TM
.
tmDefaultChar
=
pOS2
->
usDefaultChar
?
pOS2
->
usDefaultChar
:
0x1f
;
TM
.
tmLastChar
=
0xf0ff
;
TM
.
tmBreakChar
=
0x20
;
TM
.
tmDefaultChar
=
0x1f
;
}
else
{
TM
.
tmFirstChar
=
pOS2
->
usFirstCharIndex
;
TM
.
tmDefaultChar
=
pOS2
->
usDefaultChar
?
pOS2
->
usDefaultChar
:
0xffff
;
TM
.
tmFirstChar
=
pOS2
->
usFirstCharIndex
;
/* Should be the first char in the cmap */
TM
.
tmLastChar
=
pOS2
->
usLastCharIndex
;
/* Should be min(cmap_last, os2_last) */
if
(
pOS2
->
usFirstCharIndex
<=
1
)
TM
.
tmBreakChar
=
pOS2
->
usFirstCharIndex
+
2
;
else
if
(
pOS2
->
usFirstCharIndex
>
0xff
)
TM
.
tmBreakChar
=
0x20
;
else
TM
.
tmBreakChar
=
pOS2
->
usFirstCharIndex
;
TM
.
tmDefaultChar
=
TM
.
tmBreakChar
-
1
;
}
TM
.
tmLastChar
=
pOS2
->
usLastCharIndex
;
TM
.
tmBreakChar
=
pOS2
->
usBreakChar
?
pOS2
->
usBreakChar
:
' '
;
TM
.
tmItalic
=
font
->
fake_italic
?
255
:
((
ft_face
->
style_flags
&
FT_STYLE_FLAG_ITALIC
)
?
255
:
0
);
TM
.
tmUnderlined
=
font
->
underline
;
TM
.
tmStruckOut
=
font
->
strikeout
;
...
...
dlls/gdi32/tests/font.c
View file @
e93d3481
This diff is collapsed.
Click to expand it.
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