Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
98b57857
Commit
98b57857
authored
Apr 01, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: cache font folder in win32
parent
7b15f743
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/freetype.c
+20
-10
No files found.
modules/misc/text_renderer/freetype.c
View file @
98b57857
...
...
@@ -45,7 +45,7 @@
# define DEFAULT_FONT "/Library/Fonts/Arial Black.ttf"
# define FC_DEFAULT_FONT "Arial Black"
#elif defined( WIN32 )
# define DEFAULT_FONT ""
/* Default font found at run-time */
# define DEFAULT_FONT "
arial.ttf
"
/* Default font found at run-time */
# define FC_DEFAULT_FONT "Arial"
#elif defined( HAVE_MAEMO )
# define DEFAULT_FONT "/usr/share/fonts/nokia/nosnb.ttf"
...
...
@@ -289,6 +289,9 @@ struct filter_sys_t
char
*
psz_fontfamily
;
#ifdef HAVE_STYLES
xml_reader_t
*
p_xml
;
#ifdef WIN32
char
*
psz_win_fonts_path
;
#endif
#endif
input_attachment_t
**
pp_font_attachments
;
...
...
@@ -339,6 +342,17 @@ static int Create( vlc_object_t *p_this )
p_sys
->
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
p_sys
->
i_font_color
=
__MAX
(
__MIN
(
p_sys
->
i_font_color
,
0xFFFFFF
),
0
);
#ifdef WIN32
/* Get Windows Font folder */
wchar_t
wdir
[
MAX_PATH
];
if
(
S_OK
!=
SHGetFolderPathW
(
NULL
,
CSIDL_FONTS
,
NULL
,
SHGFP_TYPE_CURRENT
,
wdir
)
)
{
GetWindowsDirectoryW
(
wdir
,
MAX_PATH
);
wcscat
(
wdir
,
L"
\\
fonts"
);
}
p_sys
->
psz_win_fonts_path
=
FromWide
(
wdir
);
#endif
/* Set default psz_fontfamily */
if
(
!
psz_fontfamily
||
!*
psz_fontfamily
)
{
...
...
@@ -350,8 +364,8 @@ static int Create( vlc_object_t *p_this )
if
(
!
psz_fontfamily
)
goto
error
;
# ifdef WIN32
GetWindowsDirectory
(
psz_fontfamily
,
PATH_MAX
+
1
);
strcat
(
psz_fontfamily
,
"
\\
fonts
\\
arial.ttf"
);
strcat
(
psz_fontfamily
,
p_sys
->
psz_win_fonts_path
);
strcat
(
psz_fontfamily
,
DEFAULT_FONT
);
# else
strcpy
(
psz_fontfamily
,
DEFAULT_FONT
);
# endif
...
...
@@ -371,11 +385,12 @@ static int Create( vlc_object_t *p_this )
#elif defined(WIN32)
psz_fontfile
=
Win32_Select
(
p_filter
,
psz_fontfamily
,
false
,
false
,
p_sys
->
i_default_font_size
,
&
fontindex
);
#endif
msg_Dbg
(
p_filter
,
"Using %s as font from file %s"
,
psz_fontfamily
,
psz_fontfile
);
if
(
!
psz_fontfile
)
psz_fontfile
=
psz_fontfamily
;
#else
#else
/* !HAVE_STYLES */
psz_fontfile
=
psz_fontfamily
;
#endif
...
...
@@ -2297,14 +2312,9 @@ static char* Win32_Select( filter_t *p_filter, const char* family,
/* FIXME: increase i_idx, when concatenated strings */
i_idx
=
0
;
/* Get Windows Font folder */
wchar_t
wdir
[
MAX_PATH
];
if
(
S_OK
!=
SHGetFolderPathW
(
NULL
,
CSIDL_FONTS
,
NULL
,
SHGFP_TYPE_CURRENT
,
wdir
)
)
return
NULL
;
/* */
char
*
psz_tmp
;
if
(
asprintf
(
&
psz_tmp
,
"%s
\\
%s"
,
FromWide
(
wdir
)
,
psz_filename
)
==
-
1
)
if
(
asprintf
(
&
psz_tmp
,
"%s
\\
%s"
,
p_filter
->
p_sys
->
psz_win_fonts_path
,
psz_filename
)
==
-
1
)
return
NULL
;
return
psz_tmp
;
}
...
...
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