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
8ab829a6
Commit
8ab829a6
authored
Feb 11, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Feb 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Correct the font family values returned in the text metrics.
parent
3c68ba1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
16 deletions
+99
-16
freetype.c
dlls/gdi32/freetype.c
+39
-16
font.c
dlls/gdi32/tests/font.c
+60
-0
No files found.
dlls/gdi32/freetype.c
View file @
8ab829a6
...
...
@@ -5420,31 +5420,54 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
else
TM
.
tmPitchAndFamily
=
0
;
switch
(
pOS2
->
panose
[
PAN_FAMILYTYPE_INDEX
])
{
switch
(
pOS2
->
panose
[
PAN_FAMILYTYPE_INDEX
])
{
case
PAN_FAMILY_SCRIPT
:
TM
.
tmPitchAndFamily
|=
FF_SCRIPT
;
break
;
break
;
case
PAN_FAMILY_DECORATIVE
:
case
PAN_FAMILY_PICTORIAL
:
TM
.
tmPitchAndFamily
|=
FF_DECORATIVE
;
break
;
break
;
case
PAN_ANY
:
case
PAN_NO_FIT
:
case
PAN_FAMILY_TEXT_DISPLAY
:
case
PAN_FAMILY_PICTORIAL
:
/* symbol fonts get treated as if they were text */
/* which is clearly not what the panose spec says. */
default:
if
(
TM
.
tmPitchAndFamily
==
0
)
/* fixed */
TM
.
tmPitchAndFamily
=
FF_MODERN
;
else
{
switch
(
pOS2
->
panose
[
PAN_SERIFSTYLE_INDEX
])
{
case
PAN_SERIF_NORMAL_SANS
:
case
PAN_SERIF_OBTUSE_SANS
:
case
PAN_SERIF_PERP_SANS
:
TM
.
tmPitchAndFamily
|=
FF_SWISS
;
break
;
default:
TM
.
tmPitchAndFamily
|=
FF_ROMAN
;
}
else
{
switch
(
pOS2
->
panose
[
PAN_SERIFSTYLE_INDEX
])
{
case
PAN_ANY
:
case
PAN_NO_FIT
:
default:
TM
.
tmPitchAndFamily
|=
FF_DONTCARE
;
break
;
case
PAN_SERIF_COVE
:
case
PAN_SERIF_OBTUSE_COVE
:
case
PAN_SERIF_SQUARE_COVE
:
case
PAN_SERIF_OBTUSE_SQUARE_COVE
:
case
PAN_SERIF_SQUARE
:
case
PAN_SERIF_THIN
:
case
PAN_SERIF_BONE
:
case
PAN_SERIF_EXAGGERATED
:
case
PAN_SERIF_TRIANGLE
:
TM
.
tmPitchAndFamily
|=
FF_ROMAN
;
break
;
case
PAN_SERIF_NORMAL_SANS
:
case
PAN_SERIF_OBTUSE_SANS
:
case
PAN_SERIF_PERP_SANS
:
TM
.
tmPitchAndFamily
|=
FF_SWISS
;
break
;
}
}
break
;
default:
TM
.
tmPitchAndFamily
|=
FF_DONTCARE
;
}
if
(
FT_IS_SCALABLE
(
ft_face
))
...
...
dlls/gdi32/tests/font.c
View file @
8ab829a6
...
...
@@ -2019,6 +2019,14 @@ typedef struct
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2')
static
void
expect_ff
(
const
TEXTMETRICW
*
tmW
,
const
TT_OS2_V2
*
os2
,
WORD
family
,
const
char
*
name
)
{
ok
((
tmW
->
tmPitchAndFamily
&
0xf0
)
==
family
,
"%s: expected family %02x got %02x. panose %d-%d-%d-%d-...
\n
"
,
name
,
family
,
tmW
->
tmPitchAndFamily
,
os2
->
panose
.
bFamilyType
,
os2
->
panose
.
bSerifStyle
,
os2
->
panose
.
bWeight
,
os2
->
panose
.
bProportion
);
}
static
void
test_text_metrics
(
const
LOGFONTA
*
lf
)
{
HDC
hdc
;
...
...
@@ -2130,6 +2138,58 @@ static void test_text_metrics(const LOGFONTA *lf)
tmW
.
tmDigitizedAspectX
,
ret
);
}
/* test FF_ values */
switch
(
tt_os2
.
panose
.
bFamilyType
)
{
case
PAN_ANY
:
case
PAN_NO_FIT
:
case
PAN_FAMILY_TEXT_DISPLAY
:
case
PAN_FAMILY_PICTORIAL
:
default:
if
((
tmW
.
tmPitchAndFamily
&
1
)
==
0
)
/* fixed */
{
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_MODERN
,
font_name
);
break
;
}
switch
(
tt_os2
.
panose
.
bSerifStyle
)
{
case
PAN_ANY
:
case
PAN_NO_FIT
:
default:
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_DONTCARE
,
font_name
);
break
;
case
PAN_SERIF_COVE
:
case
PAN_SERIF_OBTUSE_COVE
:
case
PAN_SERIF_SQUARE_COVE
:
case
PAN_SERIF_OBTUSE_SQUARE_COVE
:
case
PAN_SERIF_SQUARE
:
case
PAN_SERIF_THIN
:
case
PAN_SERIF_BONE
:
case
PAN_SERIF_EXAGGERATED
:
case
PAN_SERIF_TRIANGLE
:
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_ROMAN
,
font_name
);
break
;
case
PAN_SERIF_NORMAL_SANS
:
case
PAN_SERIF_OBTUSE_SANS
:
case
PAN_SERIF_PERP_SANS
:
case
PAN_SERIF_FLARED
:
case
PAN_SERIF_ROUNDED
:
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_SWISS
,
font_name
);
break
;
}
break
;
case
PAN_FAMILY_SCRIPT
:
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_SCRIPT
,
font_name
);
break
;
case
PAN_FAMILY_DECORATIVE
:
expect_ff
(
&
tmW
,
&
tt_os2
,
FF_DECORATIVE
,
font_name
);
break
;
}
test_negative_width
(
hdc
,
lf
);
end_of_test:
...
...
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