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
e38a28c3
Commit
e38a28c3
authored
Aug 28, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: use psz_fontname
parent
43567b83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+25
-25
No files found.
modules/text_renderer/freetype.c
View file @
e38a28c3
...
...
@@ -338,7 +338,7 @@ struct filter_sys_t
int
i_default_font_size
;
char
*
psz_font
family
;
char
*
psz_font
name
;
char
*
psz_monofontfamily
;
#ifdef _WIN32
char
*
psz_win_fonts_path
;
...
...
@@ -1291,7 +1291,7 @@ static int ProcessNodes( filter_t *p_filter,
{
/* If the font is not specified in the style, assume the system font */
if
(
!
p_font_style
->
psz_fontname
)
p_font_style
->
psz_fontname
=
strdup
(
p_sys
->
psz_font
family
);
p_font_style
->
psz_fontname
=
strdup
(
p_sys
->
psz_font
name
);
rv
=
PushFont
(
&
p_fonts
,
p_font_style
->
psz_fontname
,
...
...
@@ -1314,7 +1314,7 @@ static int ProcessNodes( filter_t *p_filter,
i_font_color
=
VLC_CLIP
(
i_font_color
,
0
,
0xFFFFFF
);
int
i_font_alpha
=
p_sys
->
i_font_alpha
;
rv
=
PushFont
(
&
p_fonts
,
p_sys
->
psz_font
family
,
p_sys
->
psz_font
name
,
i_font_size
,
(
i_font_color
&
0xffffff
)
|
((
i_font_alpha
&
0xff
)
<<
24
),
...
...
@@ -2192,7 +2192,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
text_style_t
*
p_style
;
if
(
p_region_in
->
p_style
)
p_style
=
CreateStyle
(
p_region_in
->
p_style
->
psz_fontname
?
p_region_in
->
p_style
->
psz_fontname
:
p_sys
->
psz_font
family
,
:
p_sys
->
psz_font
name
,
p_region_in
->
p_style
->
i_font_size
>
0
?
p_region_in
->
p_style
->
i_font_size
:
p_sys
->
i_font_size
,
(
p_region_in
->
p_style
->
i_font_color
&
0xffffff
)
|
...
...
@@ -2206,7 +2206,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
{
uint32_t
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
i_font_color
=
VLC_CLIP
(
i_font_color
,
0
,
0xFFFFFF
);
p_style
=
CreateStyle
(
p_sys
->
psz_font
family
,
p_style
=
CreateStyle
(
p_sys
->
psz_font
name
,
p_sys
->
i_font_size
,
(
i_font_color
&
0xffffff
)
|
((
p_sys
->
i_font_alpha
&
0xff
)
<<
24
),
...
...
@@ -2313,7 +2313,7 @@ static int Create( vlc_object_t *p_this )
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
char
*
psz_fontfile
=
NULL
;
char
*
psz_font
family
=
NULL
;
char
*
psz_font
name
=
NULL
;
char
*
psz_monofontfile
=
NULL
;
char
*
psz_monofontfamily
=
NULL
;
int
i_error
=
0
,
fontindex
=
0
,
monofontindex
=
0
;
...
...
@@ -2323,7 +2323,7 @@ static int Create( vlc_object_t *p_this )
if
(
!
p_sys
)
return
VLC_ENOMEM
;
p_sys
->
psz_font
family
=
NULL
;
p_sys
->
psz_font
name
=
NULL
;
p_sys
->
p_xml
=
NULL
;
p_sys
->
p_face
=
0
;
p_sys
->
p_library
=
0
;
...
...
@@ -2336,7 +2336,7 @@ static int Create( vlc_object_t *p_this )
*
*/
psz_font
family
=
var_InheritString
(
p_filter
,
"freetype-font"
);
psz_font
name
=
var_InheritString
(
p_filter
,
"freetype-font"
);
psz_monofontfamily
=
var_InheritString
(
p_filter
,
"freetype-monofont"
);
p_sys
->
i_default_font_size
=
var_InheritInteger
(
p_filter
,
"freetype-fontsize"
);
p_sys
->
i_font_alpha
=
var_InheritInteger
(
p_filter
,
"freetype-opacity"
);
...
...
@@ -2372,58 +2372,58 @@ static int Create( vlc_object_t *p_this )
p_sys
->
psz_win_fonts_path
=
FromWide
(
wdir
);
#endif
/* Set default psz_font
family
*/
if
(
!
psz_font
family
||
!*
psz_fontfamily
)
/* Set default psz_font
name
*/
if
(
!
psz_font
name
||
!*
psz_fontname
)
{
free
(
psz_font
family
);
free
(
psz_font
name
);
#ifdef HAVE_STYLES
psz_font
family
=
strdup
(
DEFAULT_FAMILY
);
psz_font
name
=
strdup
(
DEFAULT_FAMILY
);
#else
# ifdef _WIN32
if
(
asprintf
(
&
psz_font
family
,
"%s"
DEFAULT_FONT_FILE
,
p_sys
->
psz_win_fonts_path
)
==
-
1
)
if
(
asprintf
(
&
psz_font
name
,
"%s"
DEFAULT_FONT_FILE
,
p_sys
->
psz_win_fonts_path
)
==
-
1
)
{
psz_font
family
=
NULL
;
psz_font
name
=
NULL
;
goto
error
;
}
# else
psz_font
family
=
strdup
(
DEFAULT_FONT_FILE
);
psz_font
name
=
strdup
(
DEFAULT_FONT_FILE
);
# endif
msg_Err
(
p_filter
,
"User specified an empty fontfile, using %s"
,
psz_font
family
);
msg_Err
(
p_filter
,
"User specified an empty fontfile, using %s"
,
psz_font
name
);
#endif
}
/* Set the current font file */
p_sys
->
psz_font
family
=
psz_fontfamily
;
p_sys
->
psz_font
name
=
psz_fontname
;
#ifdef HAVE_STYLES
#ifdef HAVE_FONTCONFIG
FontConfig_BuildCache
(
p_filter
);
/* */
psz_fontfile
=
FontConfig_Select
(
NULL
,
psz_font
family
,
false
,
false
,
psz_fontfile
=
FontConfig_Select
(
NULL
,
psz_font
name
,
false
,
false
,
p_sys
->
i_default_font_size
,
&
fontindex
);
psz_monofontfile
=
FontConfig_Select
(
NULL
,
psz_monofontfamily
,
false
,
false
,
p_sys
->
i_default_font_size
,
&
monofontindex
);
#elif defined(__APPLE__)
#if !TARGET_OS_IPHONE
psz_fontfile
=
MacLegacy_Select
(
p_filter
,
psz_font
family
,
false
,
false
,
0
,
&
fontindex
);
psz_fontfile
=
MacLegacy_Select
(
p_filter
,
psz_font
name
,
false
,
false
,
0
,
&
fontindex
);
#endif
#elif defined(_WIN32)
psz_fontfile
=
Win32_Select
(
p_filter
,
psz_font
family
,
false
,
false
,
psz_fontfile
=
Win32_Select
(
p_filter
,
psz_font
name
,
false
,
false
,
p_sys
->
i_default_font_size
,
&
fontindex
);
#endif
msg_Dbg
(
p_filter
,
"Using %s as font from file %s"
,
psz_font
family
,
psz_fontfile
);
msg_Dbg
(
p_filter
,
"Using %s as font from file %s"
,
psz_font
name
,
psz_fontfile
);
/* If nothing is found, use the default family */
if
(
!
psz_fontfile
)
psz_fontfile
=
strdup
(
psz_font
family
);
psz_fontfile
=
strdup
(
psz_font
name
);
if
(
!
psz_monofontfile
)
psz_monofontfile
=
strdup
(
psz_monofontfamily
);
#else
/* !HAVE_STYLES */
/* Use the default file */
psz_fontfile
=
psz_font
family
;
psz_fontfile
=
psz_font
name
;
psz_monofontfile
=
psz_monofontfamily
;
#endif
p_sys
->
psz_monofontfamily
=
psz_monofontfamily
;
...
...
@@ -2491,7 +2491,7 @@ error:
free
(
psz_fontfile
);
free
(
psz_monofontfile
);
#endif
free
(
psz_font
family
);
free
(
psz_font
name
);
free
(
psz_monofontfamily
);
free
(
p_sys
);
return
VLC_EGENERIC
;
...
...
@@ -2516,7 +2516,7 @@ static void Destroy( vlc_object_t *p_this )
}
if
(
p_sys
->
p_xml
)
xml_ReaderDelete
(
p_sys
->
p_xml
);
free
(
p_sys
->
psz_font
family
);
free
(
p_sys
->
psz_font
name
);
free
(
p_sys
->
psz_monofontfamily
);
#ifdef _WIN32
...
...
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