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
50b6b376
Commit
50b6b376
authored
Jul 17, 2015
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: EnumFontFamilies should enumerate substituted fonts only when directly asked for.
parent
5289c9fd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
freetype.c
dlls/gdi32/freetype.c
+5
-3
font.c
dlls/gdi32/tests/font.c
+0
-6
font.c
dlls/gdiplus/font.c
+8
-4
No files found.
dlls/gdi32/freetype.c
View file @
50b6b376
...
...
@@ -5774,7 +5774,7 @@ static BOOL face_matches(const WCHAR *family_name, Face *face, const WCHAR *face
}
static
BOOL
enum_face_charsets
(
const
Family
*
family
,
Face
*
face
,
struct
enum_charset_list
*
list
,
FONTENUMPROCW
proc
,
LPARAM
lparam
)
FONTENUMPROCW
proc
,
LPARAM
lparam
,
const
WCHAR
*
subst
)
{
ENUMLOGFONTEXW
elf
;
NEWTEXTMETRICEXW
ntm
;
...
...
@@ -5808,6 +5808,8 @@ static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_cha
else
strcpyW
(
elf
.
elfFullName
,
family
->
FamilyName
);
}
if
(
subst
)
strcpyW
(
elf
.
elfLogFont
.
lfFaceName
,
subst
);
TRACE
(
"enuming face %s full %s style %s charset = %d type %d script %s it %d weight %d ntmflags %08x
\n
"
,
debugstr_w
(
elf
.
elfLogFont
.
lfFaceName
),
debugstr_w
(
elf
.
elfFullName
),
debugstr_w
(
elf
.
elfStyle
),
...
...
@@ -5862,14 +5864,14 @@ static BOOL freetype_EnumFonts( PHYSDEV dev, LPLOGFONTW plf, FONTENUMPROCW proc,
face_list
=
get_face_list_from_family
(
family
);
LIST_FOR_EACH_ENTRY
(
face
,
face_list
,
Face
,
entry
)
{
if
(
!
face_matches
(
family
->
FamilyName
,
face
,
face_name
))
continue
;
if
(
!
enum_face_charsets
(
family
,
face
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
if
(
!
enum_face_charsets
(
family
,
face
,
&
enum_charsets
,
proc
,
lparam
,
psub
?
psub
->
from
.
name
:
NULL
))
return
FALSE
;
}
}
}
else
{
LIST_FOR_EACH_ENTRY
(
family
,
&
font_list
,
Family
,
entry
)
{
face_list
=
get_face_list_from_family
(
family
);
face
=
LIST_ENTRY
(
list_head
(
face_list
),
Face
,
entry
);
if
(
!
enum_face_charsets
(
family
,
face
,
&
enum_charsets
,
proc
,
lparam
))
return
FALSE
;
if
(
!
enum_face_charsets
(
family
,
face
,
&
enum_charsets
,
proc
,
lparam
,
NULL
))
return
FALSE
;
}
}
LeaveCriticalSection
(
&
freetype_cs
);
...
...
dlls/gdi32/tests/font.c
View file @
50b6b376
...
...
@@ -5051,12 +5051,9 @@ static void test_EnumFonts_subst(void)
memset
(
&
efnd
,
0
,
sizeof
(
efnd
));
strcpy
(
lf
.
lfFaceName
,
"MS Shell Dlg"
);
ret
=
EnumFontFamiliesExA
(
hdc
,
&
lf
,
enum_ms_shell_dlg_proc
,
(
LPARAM
)
&
efnd
,
0
);
todo_wine
ok
(
!
ret
,
"MS Shell Dlg should be enumerated
\n
"
);
todo_wine
ok
(
efnd
.
total
>
0
,
"MS Shell Dlg should be enumerated
\n
"
);
ret
=
strcmp
((
const
char
*
)
efnd
.
elf
[
0
].
elfLogFont
.
lfFaceName
,
"MS Shell Dlg"
);
todo_wine
ok
(
!
ret
,
"expected MS Shell Dlg, got %s
\n
"
,
efnd
.
elf
[
0
].
elfLogFont
.
lfFaceName
);
ret
=
strcmp
((
const
char
*
)
efnd
.
elf
[
0
].
elfFullName
,
"MS Shell Dlg"
);
ok
(
ret
,
"did not expect MS Shell Dlg
\n
"
);
...
...
@@ -5069,12 +5066,9 @@ todo_wine
memset
(
&
efnd
,
0
,
sizeof
(
efnd
));
strcpy
(
lf
.
lfFaceName
,
"MS Shell Dlg 2"
);
ret
=
EnumFontFamiliesExA
(
hdc
,
&
lf
,
enum_ms_shell_dlg2_proc
,
(
LPARAM
)
&
efnd
,
0
);
todo_wine
ok
(
!
ret
,
"MS Shell Dlg 2 should be enumerated
\n
"
);
todo_wine
ok
(
efnd
.
total
>
0
,
"MS Shell Dlg 2 should be enumerated
\n
"
);
ret
=
strcmp
((
const
char
*
)
efnd
.
elf
[
0
].
elfLogFont
.
lfFaceName
,
"MS Shell Dlg 2"
);
todo_wine
ok
(
!
ret
,
"expected MS Shell Dlg 2, got %s
\n
"
,
efnd
.
elf
[
0
].
elfLogFont
.
lfFaceName
);
ret
=
strcmp
((
const
char
*
)
efnd
.
elf
[
0
].
elfFullName
,
"MS Shell Dlg 2"
);
ok
(
ret
,
"did not expect MS Shell Dlg 2
\n
"
);
...
...
dlls/gdiplus/font.c
View file @
50b6b376
...
...
@@ -630,11 +630,15 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi,
static
INT
CALLBACK
is_font_installed_proc
(
const
LOGFONTW
*
elf
,
const
TEXTMETRICW
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
const
ENUMLOGFONTW
*
elfW
=
(
const
ENUMLOGFONTW
*
)
elf
;
LOGFONTW
*
lf
=
(
LOGFONTW
*
)
lParam
;
if
(
type
&
RASTER_FONTTYPE
)
return
1
;
*
(
LOGFONTW
*
)
lParam
=
*
elf
;
*
lf
=
*
elf
;
/* replace substituted font name by a real one */
lstrcpynW
(
lf
->
lfFaceName
,
elfW
->
elfFullName
,
LF_FACESIZE
);
return
0
;
}
...
...
@@ -656,8 +660,6 @@ static BOOL get_font_metrics(HDC hdc, struct font_metrics *fm)
otm
.
otmSize
=
sizeof
(
otm
);
if
(
!
GetOutlineTextMetricsW
(
hdc
,
otm
.
otmSize
,
&
otm
))
return
FALSE
;
GetTextFaceW
(
hdc
,
LF_FACESIZE
,
fm
->
facename
);
fm
->
em_height
=
otm
.
otmEMSquare
;
fm
->
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
...
...
@@ -706,6 +708,8 @@ static GpStatus find_installed_font(const WCHAR *name, struct font_metrics *fm)
{
HFONT
hfont
,
old_font
;
strcpyW
(
fm
->
facename
,
lf
.
lfFaceName
);
hfont
=
CreateFontIndirectW
(
&
lf
);
old_font
=
SelectObject
(
hdc
,
hfont
);
ret
=
get_font_metrics
(
hdc
,
fm
)
?
Ok
:
NotTrueTypeFont
;
...
...
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