Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1eac54ef
Commit
1eac54ef
authored
Mar 17, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Take into account the fontdir directory specified at build time.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e8c8ddcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
14 deletions
+37
-14
Makefile.in
dlls/gdi32/Makefile.in
+2
-0
freetype.c
dlls/gdi32/freetype.c
+35
-14
No files found.
dlls/gdi32/Makefile.in
View file @
1eac54ef
...
...
@@ -49,3 +49,5 @@ C_SRCS = \
vertical.c
RC_SRCS
=
gdi32.rc
freetype_EXTRADEFS
=
-DWINE_FONT_DIR
=
\"
`
$(MAKEDEP)
-R
${
datadir
}
/wine
${
fontdir
}
`
\"
dlls/gdi32/freetype.c
View file @
1eac54ef
...
...
@@ -214,6 +214,10 @@ MAKE_FUNCPTR(FcPatternGetString);
#define GET_BE_WORD(x) RtlUshortByteSwap(x)
#endif
#ifndef WINE_FONT_DIR
#define WINE_FONT_DIR "fonts"
#endif
/* This is basically a copy of FT_Bitmap_Size with an extra element added */
typedef
struct
{
FT_Short
height
;
...
...
@@ -2969,22 +2973,44 @@ static void load_mac_fonts(void)
#endif
static
char
*
get_font_dir
(
void
)
{
const
char
*
build_dir
,
*
data_dir
;
char
*
name
=
NULL
;
if
((
data_dir
=
wine_get_data_dir
()))
{
if
(
!
(
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
data_dir
)
+
1
+
sizeof
(
WINE_FONT_DIR
)
)))
return
NULL
;
strcpy
(
name
,
data_dir
);
strcat
(
name
,
"/"
);
strcat
(
name
,
WINE_FONT_DIR
);
}
else
if
((
build_dir
=
wine_get_build_dir
()))
{
if
(
!
(
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
build_dir
)
+
sizeof
(
"/fonts"
)
)))
return
NULL
;
strcpy
(
name
,
build_dir
);
strcat
(
name
,
"/fonts"
);
}
return
name
;
}
static
char
*
get_data_dir_path
(
LPCWSTR
file
)
{
char
*
unix_name
=
NULL
;
const
char
*
data_dir
=
wine_get_data_dir
();
if
(
!
data_dir
)
data_dir
=
wine_get_build_dir
();
char
*
font_dir
=
get_font_dir
();
if
(
data
_dir
)
if
(
font
_dir
)
{
INT
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/
"
);
unix_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
font_dir
)
+
len
+
1
);
strcpy
(
unix_name
,
font
_dir
);
strcat
(
unix_name
,
"/"
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
file
,
-
1
,
unix_name
+
strlen
(
unix_name
),
len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
font_dir
);
}
return
unix_name
;
}
...
...
@@ -4131,7 +4157,6 @@ static void init_font_list(void)
DWORD
valuelen
,
datalen
,
i
=
0
,
type
,
dlen
,
vlen
;
WCHAR
windowsdir
[
MAX_PATH
];
char
*
unixname
;
const
char
*
data_dir
;
delete_external_font_keys
();
...
...
@@ -4147,13 +4172,9 @@ static void init_font_list(void)
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
}
/* load the system truetype fonts */
data_dir
=
wine_get_data_dir
();
if
(
!
data_dir
)
data_dir
=
wine_get_build_dir
();
if
(
data_dir
&&
(
unixname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
data_dir
)
+
sizeof
(
"/fonts/"
))))
/* load the wine fonts */
if
((
unixname
=
get_font_dir
()))
{
strcpy
(
unixname
,
data_dir
);
strcat
(
unixname
,
"/fonts/"
);
ReadFontDir
(
unixname
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
unixname
);
}
...
...
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