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
0eb91035
Commit
0eb91035
authored
Sep 07, 2007
by
Mikolaj Zalewski
Committed by
Alexandre Julliard
Sep 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: If freetype fails try to load manually fonts wrapped as PE resources.
parent
baee27c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
font.c
dlls/gdi32/font.c
+37
-1
No files found.
dlls/gdi32/font.c
View file @
0eb91035
...
...
@@ -3185,12 +3185,48 @@ INT WINAPI AddFontResourceExA( LPCSTR str, DWORD fl, PVOID pdv )
return
ret
;
}
static
BOOL
CALLBACK
load_enumed_resource
(
HMODULE
hModule
,
LPCWSTR
type
,
LPWSTR
name
,
LONG_PTR
lParam
)
{
HRSRC
rsrc
=
FindResourceW
(
hModule
,
name
,
type
);
HGLOBAL
hMem
=
LoadResource
(
hModule
,
rsrc
);
LPVOID
*
pMem
=
LockResource
(
hMem
);
int
*
num_total
=
(
int
*
)
lParam
;
DWORD
num_in_res
;
TRACE
(
"Found resource %s - trying to load
\n
"
,
wine_dbgstr_w
(
type
));
if
(
!
AddFontMemResourceEx
(
pMem
,
SizeofResource
(
hModule
,
rsrc
),
NULL
,
&
num_in_res
))
{
ERR
(
"Failed to load PE font resource mod=%p ptr=%p
\n
"
,
hModule
,
hMem
);
return
FALSE
;
}
*
num_total
+=
num_in_res
;
return
TRUE
;
}
/***********************************************************************
* AddFontResourceExW (GDI32.@)
*/
INT
WINAPI
AddFontResourceExW
(
LPCWSTR
str
,
DWORD
fl
,
PVOID
pdv
)
{
return
WineEngAddFontResourceEx
(
str
,
fl
,
pdv
);
int
ret
=
WineEngAddFontResourceEx
(
str
,
fl
,
pdv
);
if
(
ret
==
0
)
{
/* Freetype <2.3.5 have problems reading resources wrapped in PE files. */
HMODULE
hModule
=
LoadLibraryExW
(
str
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
if
(
hModule
!=
NULL
)
{
int
num_resources
=
0
;
LPWSTR
rt_font
=
(
LPWSTR
)((
ULONG_PTR
)
8
);
/* we don't want to include winuser.h */
TRACE
(
"WineEndAddFontResourceEx failed on PE file %s - trying to load resources manualy
\n
"
,
wine_dbgstr_w
(
str
));
if
(
EnumResourceNamesW
(
hModule
,
rt_font
,
load_enumed_resource
,
(
LONG_PTR
)
&
num_resources
))
ret
=
num_resources
;
FreeLibrary
(
hModule
);
}
}
return
ret
;
}
/***********************************************************************
...
...
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