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
a84c60ed
Commit
a84c60ed
authored
Nov 03, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a separate backend function to load the font list.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fc44dcdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
font.c
dlls/gdi32/font.c
+10
-1
freetype.c
dlls/gdi32/freetype.c
+18
-23
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
No files found.
dlls/gdi32/font.c
View file @
a84c60ed
...
...
@@ -3238,13 +3238,22 @@ static void init_font_options(void)
*/
void
font_init
(
void
)
{
static
const
WCHAR
mutex_nameW
[]
=
{
'_'
,
'_'
,
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'F'
,
'O'
,
'N'
,
'T'
,
'_'
,
'M'
,
'U'
,
'T'
,
'E'
,
'X'
,
'_'
,
'_'
,
0
};
HANDLE
mutex
;
if
(
RegCreateKeyExA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Fonts"
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
wine_fonts_key
,
NULL
))
return
;
init_font_options
();
update_codepage
();
WineEngInit
(
&
font_funcs
);
if
(
!
WineEngInit
(
&
font_funcs
))
return
;
if
(
!
(
mutex
=
CreateMutexW
(
NULL
,
FALSE
,
mutex_nameW
)))
return
;
WaitForSingleObject
(
mutex
,
INFINITE
);
font_funcs
->
load_fonts
();
ReleaseMutex
(
mutex
);
reorder_font_list
();
load_gdi_font_subst
();
load_gdi_font_replacements
();
...
...
dlls/gdi32/freetype.c
View file @
a84c60ed
...
...
@@ -286,8 +286,6 @@ static struct list mappings_list = LIST_INIT( mappings_list );
static
UINT
default_aa_flags
;
static
HKEY
hkey_font_cache
;
static
const
WCHAR
font_mutex_nameW
[]
=
{
'_'
,
'_'
,
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'F'
,
'O'
,
'N'
,
'T'
,
'_'
,
'M'
,
'U'
,
'T'
,
'E'
,
'X'
,
'_'
,
'_'
,
'\0'
};
static
BOOL
CDECL
freetype_set_outline_text_metrics
(
struct
gdi_font
*
font
);
static
BOOL
CDECL
freetype_set_bitmap_text_metrics
(
struct
gdi_font
*
font
);
static
void
remove_face_from_cache
(
Face
*
face
);
...
...
@@ -2168,29 +2166,11 @@ static void init_font_list(void)
}
/*************************************************************
* WineEngInit
*
* Initialize FreeType library and create a list of available faces
* freetype_load_fonts
*/
BOOL
WineEngInit
(
const
struct
font_backend_funcs
**
funcs
)
static
void
CDECL
freetype_load_fonts
(
void
)
{
DWORD
disposition
;
HANDLE
font_mutex
;
if
(
!
init_freetype
())
return
FALSE
;
#ifdef SONAME_LIBFONTCONFIG
init_fontconfig
();
#endif
*
funcs
=
&
font_funcs
;
if
((
font_mutex
=
CreateMutexW
(
NULL
,
FALSE
,
font_mutex_nameW
))
==
NULL
)
{
ERR
(
"Failed to create font mutex
\n
"
);
return
FALSE
;
}
WaitForSingleObject
(
font_mutex
,
INFINITE
);
create_font_cache_key
(
&
hkey_font_cache
,
&
disposition
);
...
...
@@ -2201,8 +2181,22 @@ BOOL WineEngInit( const struct font_backend_funcs **funcs )
if
(
disposition
==
REG_CREATED_NEW_KEY
)
update_reg_entries
();
}
/*************************************************************
* WineEngInit
*
* Initialize FreeType library and create a list of available faces
*/
BOOL
WineEngInit
(
const
struct
font_backend_funcs
**
funcs
)
{
if
(
!
init_freetype
())
return
FALSE
;
#ifdef SONAME_LIBFONTCONFIG
init_fontconfig
();
#endif
ReleaseMutex
(
font_mutex
)
;
*
funcs
=
&
font_funcs
;
return
TRUE
;
}
...
...
@@ -5020,6 +5014,7 @@ static DWORD CDECL freetype_get_kerning_pairs( struct gdi_font *font, KERNINGPAI
static
const
struct
font_backend_funcs
font_funcs
=
{
freetype_SelectFont
,
freetype_load_fonts
,
freetype_add_font
,
freetype_add_mem_font
,
freetype_remove_font
,
...
...
dlls/gdi32/gdi_private.h
View file @
a84c60ed
...
...
@@ -427,6 +427,7 @@ struct font_backend_funcs
{
struct
gdi_font
*
(
CDECL
*
pSelectFont
)(
DC
*
dc
,
HFONT
hfont
);
void
(
CDECL
*
load_fonts
)(
void
);
INT
(
CDECL
*
add_font
)(
const
WCHAR
*
file
,
DWORD
flags
);
INT
(
CDECL
*
add_mem_font
)(
void
*
ptr
,
SIZE_T
size
,
DWORD
flags
);
BOOL
(
CDECL
*
remove_font
)(
const
WCHAR
*
file
,
DWORD
flags
);
...
...
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