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
6b49f6bd
Commit
6b49f6bd
authored
Mar 09, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi: Load system fonts from $(datadir)/wine/fonts if loading from
%windir%\fonts has failed.
parent
434a60ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
freetype.c
dlls/gdi/freetype.c
+34
-2
No files found.
dlls/gdi/freetype.c
View file @
6b49f6bd
...
@@ -1123,6 +1123,30 @@ LOAD_FUNCPTR(FcPatternGet);
...
@@ -1123,6 +1123,30 @@ LOAD_FUNCPTR(FcPatternGet);
return
;
return
;
}
}
static
BOOL
load_font_from_data_dir
(
LPCWSTR
file
)
{
BOOL
ret
=
FALSE
;
const
char
*
data_dir
=
wine_get_data_dir
();
if
(
data_dir
)
{
INT
len
;
char
*
unix_name
;
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
file
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
unix_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
data_dir
)
+
len
+
sizeof
(
"/fonts/"
));
strcpy
(
unix_name
,
data_dir
);
strcat
(
unix_name
,
"/fonts/"
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
file
,
-
1
,
unix_name
+
strlen
(
unix_name
),
len
,
NULL
,
NULL
);
ret
=
AddFontFileToList
(
unix_name
,
NULL
,
ADDFONT_FORCE_BITMAP
);
HeapFree
(
GetProcessHeap
(),
0
,
unix_name
);
}
return
ret
;
}
static
void
load_system_fonts
(
void
)
static
void
load_system_fonts
(
void
)
{
{
...
@@ -1140,11 +1164,15 @@ static void load_system_fonts(void)
...
@@ -1140,11 +1164,15 @@ static void load_system_fonts(void)
dlen
=
sizeof
(
data
);
dlen
=
sizeof
(
data
);
if
(
RegQueryValueExW
(
hkey
,
*
value
,
0
,
&
type
,
(
void
*
)
data
,
&
dlen
)
==
ERROR_SUCCESS
&&
if
(
RegQueryValueExW
(
hkey
,
*
value
,
0
,
&
type
,
(
void
*
)
data
,
&
dlen
)
==
ERROR_SUCCESS
&&
type
==
REG_SZ
)
{
type
==
REG_SZ
)
{
BOOL
added
=
FALSE
;
sprintfW
(
pathW
,
fmtW
,
windowsdir
,
data
);
sprintfW
(
pathW
,
fmtW
,
windowsdir
,
data
);
if
((
unixname
=
wine_get_unix_file_name
(
pathW
)))
{
if
((
unixname
=
wine_get_unix_file_name
(
pathW
)))
{
AddFontFileToList
(
unixname
,
NULL
,
ADDFONT_FORCE_BITMAP
);
added
=
AddFontFileToList
(
unixname
,
NULL
,
ADDFONT_FORCE_BITMAP
);
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
}
}
if
(
!
added
)
load_font_from_data_dir
(
data
);
}
}
}
}
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
@@ -1592,12 +1620,16 @@ BOOL WineEngInit(void)
...
@@ -1592,12 +1620,16 @@ BOOL WineEngInit(void)
{
{
WCHAR
pathW
[
MAX_PATH
];
WCHAR
pathW
[
MAX_PATH
];
static
const
WCHAR
fmtW
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
'\0'
};
static
const
WCHAR
fmtW
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
'\0'
};
BOOL
added
=
FALSE
;
sprintfW
(
pathW
,
fmtW
,
windowsdir
,
data
);
sprintfW
(
pathW
,
fmtW
,
windowsdir
,
data
);
if
((
unixname
=
wine_get_unix_file_name
(
pathW
)))
if
((
unixname
=
wine_get_unix_file_name
(
pathW
)))
{
{
AddFontFileToList
(
unixname
,
NULL
,
ADDFONT_FORCE_BITMAP
);
added
=
AddFontFileToList
(
unixname
,
NULL
,
ADDFONT_FORCE_BITMAP
);
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
}
}
if
(
!
added
)
load_font_from_data_dir
(
data
);
}
}
/* reset dlen and vlen */
/* reset dlen and vlen */
dlen
=
datalen
;
dlen
=
datalen
;
...
...
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