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
5476c0e2
Commit
5476c0e2
authored
Apr 24, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: ntmCellHeight and ntmAvgWidth should be in font units.
parent
57fbf143
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
freetype.c
dlls/gdi32/freetype.c
+10
-3
font.c
dlls/gdi32/tests/font.c
+8
-0
No files found.
dlls/gdi32/freetype.c
View file @
5476c0e2
...
...
@@ -342,6 +342,7 @@ struct tagGdiFont {
SHORT
yMax
;
SHORT
yMin
;
DWORD
ntmFlags
;
UINT
ntmCellHeight
,
ntmAvgWidth
;
FONTSIGNATURE
fs
;
GdiFont
*
base_font
;
VOID
*
GSUB_Table
;
...
...
@@ -5070,6 +5071,8 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
memcpy
(
&
pntm
->
ntmTm
,
&
font
->
potm
->
otmTextMetrics
,
sizeof
(
TEXTMETRICW
));
pntm
->
ntmTm
.
ntmSizeEM
=
font
->
potm
->
otmEMSquare
;
pntm
->
ntmTm
.
ntmCellHeight
=
font
->
ntmCellHeight
;
pntm
->
ntmTm
.
ntmAvgWidth
=
font
->
ntmAvgWidth
;
lstrcpynW
(
pelf
->
elfLogFont
.
lfFaceName
,
(
WCHAR
*
)((
char
*
)
font
->
potm
+
(
ULONG_PTR
)
font
->
potm
->
otmpFamilyName
),
...
...
@@ -5086,6 +5089,8 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
get_text_metrics
(
font
,
(
TEXTMETRICW
*
)
&
pntm
->
ntmTm
);
pntm
->
ntmTm
.
ntmSizeEM
=
pntm
->
ntmTm
.
tmHeight
-
pntm
->
ntmTm
.
tmInternalLeading
;
pntm
->
ntmTm
.
ntmCellHeight
=
pntm
->
ntmTm
.
tmHeight
;
pntm
->
ntmTm
.
ntmAvgWidth
=
pntm
->
ntmTm
.
tmAveCharWidth
;
lstrcpynW
(
pelf
->
elfLogFont
.
lfFaceName
,
face
->
family
->
FamilyName
,
LF_FACESIZE
);
if
(
face
->
FullName
)
...
...
@@ -5096,8 +5101,6 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
}
pntm
->
ntmTm
.
ntmFlags
=
face
->
ntmFlags
;
pntm
->
ntmTm
.
ntmCellHeight
=
pntm
->
ntmTm
.
tmHeight
;
pntm
->
ntmTm
.
ntmAvgWidth
=
pntm
->
ntmTm
.
tmAveCharWidth
;
pntm
->
ntmFontSig
=
face
->
fs
;
pelf
->
elfScript
[
0
]
=
'\0'
;
/* This will get set in WineEngEnumFonts */
...
...
@@ -6611,9 +6614,10 @@ static BOOL get_outline_text_metrics(GdiFont *font)
pPost
=
pFT_Get_Sfnt_Table
(
ft_face
,
ft_sfnt_post
);
/* we can live with this failing */
TRACE
(
"OS/2 winA = %d winD = %d typoA = %d typoD = %d typoLG = %d FT_Face a = %d, d = %d, h = %d: HORZ a = %d, d = %d lg = %d maxY = %ld minY = %ld
\n
"
,
TRACE
(
"OS/2 winA = %d winD = %d typoA = %d typoD = %d typoLG = %d
avgW %d
FT_Face a = %d, d = %d, h = %d: HORZ a = %d, d = %d lg = %d maxY = %ld minY = %ld
\n
"
,
pOS2
->
usWinAscent
,
pOS2
->
usWinDescent
,
pOS2
->
sTypoAscender
,
pOS2
->
sTypoDescender
,
pOS2
->
sTypoLineGap
,
pOS2
->
xAvgCharWidth
,
ft_face
->
ascender
,
ft_face
->
descender
,
ft_face
->
height
,
pHori
->
Ascender
,
pHori
->
Descender
,
pHori
->
Line_Gap
,
ft_face
->
bbox
.
yMax
,
ft_face
->
bbox
.
yMin
);
...
...
@@ -6631,6 +6635,9 @@ static BOOL get_outline_text_metrics(GdiFont *font)
descent
=
pOS2
->
usWinDescent
;
}
font
->
ntmCellHeight
=
ascent
+
descent
;
font
->
ntmAvgWidth
=
pOS2
->
xAvgCharWidth
;
if
(
font
->
yMax
)
{
TM
.
tmAscent
=
font
->
yMax
;
TM
.
tmDescent
=
-
font
->
yMin
;
...
...
dlls/gdi32/tests/font.c
View file @
5476c0e2
...
...
@@ -2056,11 +2056,15 @@ struct enum_font_dataW
static
INT
CALLBACK
arial_enum_proc
(
const
LOGFONT
*
lf
,
const
TEXTMETRIC
*
tm
,
DWORD
type
,
LPARAM
lParam
)
{
struct
enum_font_data
*
efd
=
(
struct
enum_font_data
*
)
lParam
;
const
NEWTEXTMETRIC
*
ntm
=
(
const
NEWTEXTMETRIC
*
)
tm
;
ok
(
lf
->
lfHeight
==
tm
->
tmHeight
,
"lfHeight %d != tmHeight %d
\n
"
,
lf
->
lfHeight
,
tm
->
tmHeight
);
ok
(
lf
->
lfHeight
>
0
&&
lf
->
lfHeight
<
200
,
"enumerated font height %d
\n
"
,
lf
->
lfHeight
);
if
(
type
!=
TRUETYPE_FONTTYPE
)
return
1
;
ok
(
ntm
->
ntmCellHeight
+
ntm
->
ntmCellHeight
/
5
>=
ntm
->
ntmSizeEM
,
"ntmCellHeight %d should be close to ntmSizeEM %d
\n
"
,
ntm
->
ntmCellHeight
,
ntm
->
ntmSizeEM
);
if
(
0
)
/* Disabled to limit console spam */
trace
(
"enumed font
\"
%s
\"
, charset %d, height %d, weight %d, italic %d
\n
"
,
lf
->
lfFaceName
,
lf
->
lfCharSet
,
lf
->
lfHeight
,
lf
->
lfWeight
,
lf
->
lfItalic
);
...
...
@@ -2075,11 +2079,15 @@ static INT CALLBACK arial_enum_proc(const LOGFONT *lf, const TEXTMETRIC *tm, DWO
static
INT
CALLBACK
arial_enum_procw
(
const
LOGFONTW
*
lf
,
const
TEXTMETRICW
*
tm
,
DWORD
type
,
LPARAM
lParam
)
{
struct
enum_font_dataW
*
efd
=
(
struct
enum_font_dataW
*
)
lParam
;
const
NEWTEXTMETRICW
*
ntm
=
(
const
NEWTEXTMETRICW
*
)
tm
;
ok
(
lf
->
lfHeight
==
tm
->
tmHeight
,
"lfHeight %d != tmHeight %d
\n
"
,
lf
->
lfHeight
,
tm
->
tmHeight
);
ok
(
lf
->
lfHeight
>
0
&&
lf
->
lfHeight
<
200
,
"enumerated font height %d
\n
"
,
lf
->
lfHeight
);
if
(
type
!=
TRUETYPE_FONTTYPE
)
return
1
;
ok
(
ntm
->
ntmCellHeight
+
ntm
->
ntmCellHeight
/
5
>=
ntm
->
ntmSizeEM
,
"ntmCellHeight %d should be close to ntmSizeEM %d
\n
"
,
ntm
->
ntmCellHeight
,
ntm
->
ntmSizeEM
);
if
(
0
)
/* Disabled to limit console spam */
trace
(
"enumed font %s, charset %d, height %d, weight %d, italic %d
\n
"
,
wine_dbgstr_w
(
lf
->
lfFaceName
),
lf
->
lfCharSet
,
lf
->
lfHeight
,
lf
->
lfWeight
,
lf
->
lfItalic
);
...
...
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