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
ecf07a80
Commit
ecf07a80
authored
Aug 05, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text_renderer: quartztext: handle monospace font style
parent
a98bd633
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
modules/text_renderer/quartztext.c
modules/text_renderer/quartztext.c
+15
-3
No files found.
modules/text_renderer/quartztext.c
View file @
ecf07a80
...
...
@@ -54,6 +54,7 @@
#endif
#define DEFAULT_FONT "Helvetica-Neue"
#define DEFAULT_MONOFONT "Andale-Mono"
#define DEFAULT_FONT_COLOR 0xffffff
#define DEFAULT_REL_FONT_SIZE 16
...
...
@@ -90,6 +91,7 @@ static void setFontAttibutes(char *psz_fontname, int i_font_size, uint32_t i_fon
* RenderText. */
#define FONT_TEXT N_("Font")
#define FONT_LONGTEXT N_("Name for the font you want to use")
#define MONOSPACE_FONT_TEXT N_("Monospace Font")
#define FONTSIZER_TEXT N_("Relative font size")
#define FONTSIZER_LONGTEXT N_("This is the relative default size of the " \
"fonts that will be rendered on the video. If absolute font size is set, "\
...
...
@@ -124,6 +126,8 @@ vlc_module_begin ()
add_string
(
"quartztext-font"
,
DEFAULT_FONT
,
FONT_TEXT
,
FONT_LONGTEXT
,
false
)
add_string
(
"quartztext-monofont"
,
DEFAULT_MONOFONT
,
MONOSPACE_FONT_TEXT
,
FONT_LONGTEXT
,
false
)
add_integer
(
"quartztext-rel-fontsize"
,
DEFAULT_REL_FONT_SIZE
,
FONTSIZER_TEXT
,
FONTSIZER_LONGTEXT
,
false
)
change_integer_list
(
pi_sizes
,
ppsz_sizes_text
)
...
...
@@ -203,7 +207,7 @@ static int Create(vlc_object_t *p_this)
return
VLC_ENOMEM
;
p_sys
->
style
.
psz_fontname
=
var_CreateGetString
(
p_this
,
"quartztext-font"
);;
p_sys
->
style
.
psz_monofontname
=
strdup
(
p_sys
->
style
.
psz_fontname
);
p_sys
->
style
.
psz_monofontname
=
var_CreateGetString
(
p_this
,
"quartztext-monofont"
);
p_sys
->
style
.
i_font_size
=
GetFontSize
(
p_filter
);;
p_sys
->
style
.
i_style_flags
=
0
;
...
...
@@ -327,8 +331,16 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
}
if
(
p_text
->
style
)
{
psz_fontname
=
p_text
->
style
->
psz_fontname
?
p_text
->
style
->
psz_fontname
:
p_sys
->
style
.
psz_fontname
;
if
(
p_text
->
style
->
i_style_flags
&
STYLE_MONOSPACED
)
{
psz_fontname
=
p_text
->
style
->
psz_monofontname
?
p_text
->
style
->
psz_monofontname
:
p_sys
->
style
.
psz_monofontname
;
}
else
{
psz_fontname
=
p_text
->
style
->
psz_fontname
?
p_text
->
style
->
psz_fontname
:
p_sys
->
style
.
psz_fontname
;
}
i_font_color
=
VLC_CLIP
(
p_text
->
style
->
i_font_color
,
0
,
0xFFFFFF
);
i_font_size
=
VLC_CLIP
(
p_text
->
style
->
i_font_size
,
0
,
255
);
if
(
p_text
->
style
->
i_style_flags
)
{
...
...
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