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
2fdaa566
Commit
2fdaa566
authored
Jan 15, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 15, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a test for undocumented EnumFontFamiliesEx(NULL), make it pass under Wine.
parent
554644fd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
19 deletions
+68
-19
font.c
dlls/gdi32/font.c
+39
-19
freetype.c
dlls/gdi32/freetype.c
+8
-0
font.c
dlls/gdi32/tests/font.c
+12
-0
xfont.c
dlls/winex11.drv/xfont.c
+9
-0
No files found.
dlls/gdi32/font.c
View file @
2fdaa566
...
...
@@ -692,7 +692,8 @@ static INT CALLBACK FONT_EnumInstance16( const LOGFONTW *plf, const TEXTMETRICW
INT
ret
=
1
;
DC
*
dc
;
if
(
pfe
->
lpLogFontParam
->
lfCharSet
==
DEFAULT_CHARSET
||
if
(
!
pfe
->
lpLogFontParam
||
pfe
->
lpLogFontParam
->
lfCharSet
==
DEFAULT_CHARSET
||
pfe
->
lpLogFontParam
->
lfCharSet
==
plf
->
lfCharSet
)
{
WORD
args
[
7
];
...
...
@@ -740,7 +741,8 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
DC
*
dc
;
/* lfCharSet is at the same offset in both LOGFONTA and LOGFONTW */
if
((
pfe
->
lpLogFontParam
->
lfCharSet
==
DEFAULT_CHARSET
||
if
((
!
pfe
->
lpLogFontParam
||
pfe
->
lpLogFontParam
->
lfCharSet
==
DEFAULT_CHARSET
||
pfe
->
lpLogFontParam
->
lfCharSet
==
plf
->
lfCharSet
)
&&
(
!
(
fType
&
RASTER_FONTTYPE
)
||
GetDeviceCaps
(
pfe
->
hdc
,
TEXTCAPS
)
&
TC_RA_ABLE
)
)
{
...
...
@@ -785,11 +787,17 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
DC
*
dc
=
DC_GetDCPtr
(
HDC_32
(
hDC
)
);
NEWTEXTMETRICEX16
tm16
;
ENUMLOGFONTEX16
lf16
;
LOGFONTW
lfW
;
LOGFONTW
lfW
,
*
plfW
;
BOOL
enum_gdi_fonts
;
if
(
!
dc
)
return
0
;
if
(
plf
)
{
FONT_LogFont16ToW
(
plf
,
&
lfW
);
plfW
=
&
lfW
;
}
else
plfW
=
NULL
;
fe16
.
hdc
=
HDC_32
(
hDC
);
fe16
.
dc
=
dc
;
...
...
@@ -812,10 +820,10 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
}
if
(
enum_gdi_fonts
)
ret
=
WineEngEnumFonts
(
&
lfW
,
FONT_EnumInstance16
,
(
LPARAM
)
&
fe16
);
ret
=
WineEngEnumFonts
(
p
lfW
,
FONT_EnumInstance16
,
(
LPARAM
)
&
fe16
);
fe16
.
dwFlags
&=
~
ENUM_CALLED
;
if
(
ret
&&
dc
->
funcs
->
pEnumDeviceFonts
)
{
ret2
=
dc
->
funcs
->
pEnumDeviceFonts
(
dc
->
physDev
,
&
lfW
,
FONT_EnumInstance16
,
(
LPARAM
)
&
fe16
);
ret2
=
dc
->
funcs
->
pEnumDeviceFonts
(
dc
->
physDev
,
p
lfW
,
FONT_EnumInstance16
,
(
LPARAM
)
&
fe16
);
if
(
fe16
.
dwFlags
&
ENUM_CALLED
)
/* update ret iff a font gets enumed */
ret
=
ret2
;
}
...
...
@@ -888,10 +896,16 @@ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf,
FONTENUMPROCA
efproc
,
LPARAM
lParam
,
DWORD
dwFlags
)
{
LOGFONTW
lfW
;
LOGFONTW
lfW
,
*
plfW
;
if
(
plf
)
{
FONT_LogFontAToW
(
plf
,
&
lfW
);
plfW
=
&
lfW
;
}
else
plfW
=
NULL
;
return
FONT_EnumFontFamiliesEx
(
hDC
,
&
lfW
,
(
FONTENUMPROCW
)
efproc
,
lParam
,
0
);
return
FONT_EnumFontFamiliesEx
(
hDC
,
p
lfW
,
(
FONTENUMPROCW
)
efproc
,
lParam
,
0
);
}
/***********************************************************************
...
...
@@ -900,17 +914,19 @@ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf,
INT16
WINAPI
EnumFontFamilies16
(
HDC16
hDC
,
LPCSTR
lpFamily
,
FONTENUMPROC16
efproc
,
LPARAM
lpData
)
{
LOGFONT16
lf
;
LOGFONT16
lf
,
*
p
lf
;
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
if
(
lpFamily
)
{
if
(
!*
lpFamily
)
return
1
;
lstrcpynA
(
lf
.
lfFaceName
,
lpFamily
,
LF_FACESIZE
);
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
lf
.
lfPitchAndFamily
=
0
;
plf
=
&
lf
;
}
else
lf
.
lfFaceName
[
0
]
=
'\0'
;
else
plf
=
NULL
;
return
EnumFontFamiliesEx16
(
hDC
,
&
lf
,
efproc
,
lpData
,
0
);
return
EnumFontFamiliesEx16
(
hDC
,
p
lf
,
efproc
,
lpData
,
0
);
}
/***********************************************************************
...
...
@@ -919,17 +935,19 @@ INT16 WINAPI EnumFontFamilies16( HDC16 hDC, LPCSTR lpFamily,
INT
WINAPI
EnumFontFamiliesA
(
HDC
hDC
,
LPCSTR
lpFamily
,
FONTENUMPROCA
efproc
,
LPARAM
lpData
)
{
LOGFONTA
lf
;
LOGFONTA
lf
,
*
p
lf
;
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
if
(
lpFamily
)
{
if
(
!*
lpFamily
)
return
1
;
lstrcpynA
(
lf
.
lfFaceName
,
lpFamily
,
LF_FACESIZE
);
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
lf
.
lfPitchAndFamily
=
0
;
plf
=
&
lf
;
}
else
lf
.
lfFaceName
[
0
]
=
lf
.
lfFaceName
[
1
]
=
'\0'
;
else
plf
=
NULL
;
return
EnumFontFamiliesExA
(
hDC
,
&
lf
,
efproc
,
lpData
,
0
);
return
EnumFontFamiliesExA
(
hDC
,
p
lf
,
efproc
,
lpData
,
0
);
}
/***********************************************************************
...
...
@@ -938,17 +956,19 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily,
INT
WINAPI
EnumFontFamiliesW
(
HDC
hDC
,
LPCWSTR
lpFamily
,
FONTENUMPROCW
efproc
,
LPARAM
lpData
)
{
LOGFONTW
lf
;
LOGFONTW
lf
,
*
p
lf
;
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
if
(
lpFamily
)
{
if
(
!*
lpFamily
)
return
1
;
lstrcpynW
(
lf
.
lfFaceName
,
lpFamily
,
LF_FACESIZE
);
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
lf
.
lfPitchAndFamily
=
0
;
plf
=
&
lf
;
}
else
lf
.
lfFaceName
[
0
]
=
0
;
else
plf
=
NULL
;
return
EnumFontFamiliesExW
(
hDC
,
&
lf
,
efproc
,
lpData
,
0
);
return
EnumFontFamiliesExW
(
hDC
,
p
lf
,
efproc
,
lpData
,
0
);
}
/***********************************************************************
...
...
dlls/gdi32/freetype.c
View file @
2fdaa566
...
...
@@ -3371,6 +3371,14 @@ DWORD WineEngEnumFonts(LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lparam)
LOGFONTW
lf
;
int
i
;
if
(
!
plf
)
{
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
lf
.
lfPitchAndFamily
=
0
;
lf
.
lfFaceName
[
0
]
=
0
;
plf
=
&
lf
;
}
TRACE
(
"facename = %s charset %d
\n
"
,
debugstr_w
(
plf
->
lfFaceName
),
plf
->
lfCharSet
);
if
(
plf
->
lfFaceName
[
0
])
{
...
...
dlls/gdi32/tests/font.c
View file @
2fdaa566
...
...
@@ -1287,6 +1287,18 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
ok
(
ansi_charset
>
0
,
"NULL family should enumerate ANSI_CHARSET
\n
"
);
ok
(
symbol_charset
>
0
,
"NULL family should enumerate SYMBOL_CHARSET
\n
"
);
ok
(
russian_charset
>
0
,
"NULL family should enumerate RUSSIAN_CHARSET
\n
"
);
efd
.
total
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
EnumFontFamiliesEx
(
hdc
,
NULL
,
arial_enum_proc
,
(
LPARAM
)
&
efd
,
0
);
ok
(
ret
,
"EnumFontFamiliesEx error %u
\n
"
,
GetLastError
());
get_charset_stats
(
&
efd
,
&
ansi_charset
,
&
symbol_charset
,
&
russian_charset
);
trace
(
"enumerated ansi %d, symbol %d, russian %d fonts for NULL
\n
"
,
ansi_charset
,
symbol_charset
,
russian_charset
);
ok
(
efd
.
total
>
0
,
"no fonts enumerated: NULL
\n
"
);
ok
(
ansi_charset
>
0
,
"NULL family should enumerate ANSI_CHARSET
\n
"
);
ok
(
symbol_charset
>
0
,
"NULL family should enumerate SYMBOL_CHARSET
\n
"
);
ok
(
russian_charset
>
0
,
"NULL family should enumerate RUSSIAN_CHARSET
\n
"
);
}
efd
.
total
=
0
;
...
...
dlls/winex11.drv/xfont.c
View file @
2fdaa566
...
...
@@ -3305,10 +3305,19 @@ BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf,
NEWTEXTMETRICEXW
tm
;
fontResource
*
pfr
=
fontList
;
BOOL
b
,
bRet
=
0
;
LOGFONTW
lfW
;
/* don't enumerate x11 fonts if we're using client side fonts */
if
(
physDev
->
has_gdi_font
)
return
FALSE
;
if
(
!
plf
)
{
lfW
.
lfCharSet
=
DEFAULT_CHARSET
;
lfW
.
lfPitchAndFamily
=
0
;
lfW
.
lfFaceName
[
0
]
=
0
;
plf
=
&
lfW
;
}
if
(
plf
->
lfFaceName
[
0
]
)
{
char
facename
[
LF_FACESIZE
+
1
];
...
...
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