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
131d3b1f
Commit
131d3b1f
authored
Oct 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the loading of system fonts out of freetype.c.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9908c5d3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
38 deletions
+24
-38
font.c
dlls/gdi32/font.c
+22
-0
freetype.c
dlls/gdi32/freetype.c
+1
-38
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
No files found.
dlls/gdi32/font.c
View file @
131d3b1f
...
...
@@ -5375,6 +5375,28 @@ static BOOL remove_font_resource( LPCWSTR file, DWORD flags )
return
ret
;
}
void
load_system_bitmap_fonts
(
void
)
{
static
const
WCHAR
keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
0
};
static
const
WCHAR
fontsW
[]
=
{
'F'
,
'O'
,
'N'
,
'T'
,
'S'
,
'.'
,
'F'
,
'O'
,
'N'
,
0
};
static
const
WCHAR
oemfontW
[]
=
{
'O'
,
'E'
,
'M'
,
'F'
,
'O'
,
'N'
,
'T'
,
'.'
,
'F'
,
'O'
,
'N'
,
0
};
static
const
WCHAR
fixedfonW
[]
=
{
'F'
,
'I'
,
'X'
,
'E'
,
'D'
,
'F'
,
'O'
,
'N'
,
'.'
,
'F'
,
'O'
,
'N'
,
0
};
static
const
WCHAR
*
const
fonts
[]
=
{
fontsW
,
oemfontW
,
fixedfonW
};
HKEY
hkey
;
WCHAR
data
[
MAX_PATH
];
DWORD
i
,
dlen
,
type
;
if
(
RegOpenKeyW
(
HKEY_CURRENT_CONFIG
,
keyW
,
&
hkey
))
return
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
fonts
);
i
++
)
{
dlen
=
sizeof
(
data
);
if
(
!
RegQueryValueExW
(
hkey
,
fonts
[
i
],
0
,
&
type
,
(
BYTE
*
)
data
,
&
dlen
)
&&
type
==
REG_SZ
)
add_system_font_resource
(
data
,
ADDFONT_ALLOW_BITMAP
|
ADDFONT_ADD_TO_CACHE
);
}
RegCloseKey
(
hkey
);
}
/***********************************************************************
* AddFontResourceExW (GDI32.@)
*/
...
...
dlls/gdi32/freetype.c
View file @
131d3b1f
...
...
@@ -340,18 +340,6 @@ static const WCHAR winnt_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\',
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
system_fonts_reg_key
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
FixedSys_Value
[]
=
{
'F'
,
'I'
,
'X'
,
'E'
,
'D'
,
'F'
,
'O'
,
'N'
,
'.'
,
'F'
,
'O'
,
'N'
,
'\0'
};
static
const
WCHAR
System_Value
[]
=
{
'F'
,
'O'
,
'N'
,
'T'
,
'S'
,
'.'
,
'F'
,
'O'
,
'N'
,
'\0'
};
static
const
WCHAR
OEMFont_Value
[]
=
{
'O'
,
'E'
,
'M'
,
'F'
,
'O'
,
'N'
,
'T'
,
'.'
,
'F'
,
'O'
,
'N'
,
'\0'
};
static
const
WCHAR
*
const
SystemFontValues
[]
=
{
System_Value
,
OEMFont_Value
,
FixedSys_Value
,
NULL
};
static
const
WCHAR
external_fonts_reg_key
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\\'
,
'E'
,
'x'
,
't'
,
'e'
,
'r'
,
'n'
,
'a'
,
'l'
,
' '
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
...
...
@@ -2861,30 +2849,6 @@ static void load_mac_fonts(void)
#endif
static
void
load_system_fonts
(
void
)
{
HKEY
hkey
;
WCHAR
data
[
MAX_PATH
],
pathW
[
MAX_PATH
];
const
WCHAR
*
const
*
value
;
DWORD
dlen
,
type
;
if
(
RegOpenKeyW
(
HKEY_CURRENT_CONFIG
,
system_fonts_reg_key
,
&
hkey
)
==
ERROR_SUCCESS
)
{
for
(
value
=
SystemFontValues
;
*
value
;
value
++
)
{
dlen
=
sizeof
(
data
);
if
(
RegQueryValueExW
(
hkey
,
*
value
,
0
,
&
type
,
(
void
*
)
data
,
&
dlen
)
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
{
get_fonts_win_dir_path
(
data
,
pathW
);
if
(
!
freetype_add_font
(
pathW
,
ADDFONT_ALLOW_BITMAP
|
ADDFONT_ADD_TO_CACHE
))
{
get_fonts_data_dir_path
(
data
,
pathW
);
freetype_add_font
(
pathW
,
ADDFONT_ALLOW_BITMAP
|
ADDFONT_ADD_TO_CACHE
);
}
}
}
RegCloseKey
(
hkey
);
}
}
static
WCHAR
*
get_full_path_name
(
const
WCHAR
*
name
)
{
WCHAR
*
full_path
;
...
...
@@ -3456,8 +3420,7 @@ static void init_font_list(void)
delete_external_font_keys
();
/* load the system bitmap fonts */
load_system_fonts
();
load_system_bitmap_fonts
();
/* load in the fonts from %WINDOWSDIR%\\Fonts first of all */
GetWindowsDirectoryW
(
path
,
ARRAY_SIZE
(
path
));
...
...
dlls/gdi32/gdi_private.h
View file @
131d3b1f
...
...
@@ -392,6 +392,7 @@ struct font_backend_funcs
extern
void
get_font_dir
(
WCHAR
*
path
)
DECLSPEC_HIDDEN
;
extern
void
get_fonts_data_dir_path
(
const
WCHAR
*
file
,
WCHAR
*
path
)
DECLSPEC_HIDDEN
;
extern
void
get_fonts_win_dir_path
(
const
WCHAR
*
file
,
WCHAR
*
path
)
DECLSPEC_HIDDEN
;
extern
void
load_system_bitmap_fonts
(
void
)
DECLSPEC_HIDDEN
;
extern
struct
gdi_font
*
alloc_gdi_font
(
const
WCHAR
*
file
,
void
*
data_ptr
,
SIZE_T
data_size
)
DECLSPEC_HIDDEN
;
extern
void
free_gdi_font
(
struct
gdi_font
*
font
)
DECLSPEC_HIDDEN
;
...
...
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