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
b31df501
Commit
b31df501
authored
Aug 28, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: apply sub-text-scale factor where possible
parent
1a6ac714
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+10
-3
No files found.
modules/text_renderer/freetype.c
View file @
b31df501
...
...
@@ -891,10 +891,11 @@ static void FreeStylesArray( text_style_t **pp_styles, size_t i_styles )
}
static
uni_char_t
*
SegmentsToTextAndStyles
(
filter_t
*
p_filter
,
const
text_segment_t
*
p_segment
,
size_t
*
pi_string_length
,
text_style_t
***
ppp_styles
,
size_t
*
pi_styles
)
text_style_t
***
ppp_styles
,
size_t
*
pi_styles
,
bool
b_grid
)
{
text_style_t
**
pp_styles
=
NULL
;
uni_char_t
*
psz_uni
=
NULL
;
const
int
i_scale
=
(
b_grid
)
?
100
:
var_InheritInteger
(
p_filter
,
"sub-text-scale"
);
size_t
i_size
=
0
;
size_t
i_nb_char
=
0
;
*
pi_styles
=
0
;
...
...
@@ -950,6 +951,12 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
/* Overwrite any default or value with forced ones */
text_style_Merge
(
p_style
,
p_filter
->
p_sys
->
p_forced_style
,
true
);
if
(
i_scale
!=
100
)
{
p_style
->
i_font_size
=
p_style
->
i_font_size
*
i_scale
/
100
;
p_style
->
f_font_relsize
=
p_style
->
f_font_relsize
*
i_scale
/
100
;
}
// i_string_bytes is a number of bytes, while here we're going to assign pointer by pointer
for
(
size_t
i
=
0
;
i
<
i_string_bytes
/
sizeof
(
*
psz_uni
);
++
i
)
pp_styles
[
i_nb_char
+
i
]
=
p_style
;
...
...
@@ -977,7 +984,8 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
text_style_t
**
pp_styles
=
NULL
;
size_t
i_text_length
=
0
;
size_t
i_styles
=
0
;
uni_char_t
*
psz_text
=
SegmentsToTextAndStyles
(
p_filter
,
p_region_in
->
p_text
,
&
i_text_length
,
&
pp_styles
,
&
i_styles
);
uni_char_t
*
psz_text
=
SegmentsToTextAndStyles
(
p_filter
,
p_region_in
->
p_text
,
&
i_text_length
,
&
pp_styles
,
&
i_styles
,
p_region_in
->
b_gridmode
);
if
(
!
psz_text
||
!
pp_styles
)
{
return
VLC_EGENERIC
;
...
...
@@ -1119,7 +1127,6 @@ error:
return
VLC_EGENERIC
;
}
static
int
Create
(
vlc_object_t
*
p_this
)
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
...
...
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