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
d8d34fbe
Commit
d8d34fbe
authored
Aug 29, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: move GetStyleFromStack to helper
parent
b13e8ff1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+2
-20
modules/text_renderer/text_renderer.c
modules/text_renderer/text_renderer.c
+22
-0
modules/text_renderer/text_renderer.h
modules/text_renderer/text_renderer.h
+5
-0
No files found.
modules/text_renderer/freetype.c
View file @
d8d34fbe
...
...
@@ -1245,26 +1245,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
}
static
text_style_t
*
GetStyleFromFontStack
(
filter_t
*
p_filter
,
font_stack_t
**
p_fonts
,
int
i_style_flags
)
{
char
*
psz_fontname
=
NULL
;
uint32_t
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
i_font_color
=
VLC_CLIP
(
i_font_color
,
0
,
0xFFFFFF
);
i_font_color
=
i_font_color
&
0x00ffffff
;
int
i_font_size
=
p_filter
->
p_sys
->
style
.
i_font_size
;
uint32_t
i_karaoke_bg_color
=
i_font_color
;
if
(
PeekFont
(
p_fonts
,
&
psz_fontname
,
&
i_font_size
,
&
i_font_color
,
&
i_karaoke_bg_color
)
)
return
NULL
;
return
CreateStyle
(
psz_fontname
,
i_font_size
,
i_font_color
,
i_karaoke_bg_color
,
i_style_flags
);
}
static
int
ProcessNodes
(
filter_t
*
p_filter
,
uni_char_t
*
psz_text
,
...
...
@@ -1365,6 +1345,7 @@ static int ProcessNodes( filter_t *p_filter,
"
\n
"
,
GetStyleFromFontStack
(
p_filter
,
&
p_fonts
,
&
p_sys
->
style
,
i_style_flags
),
i_k_date
);
}
...
...
@@ -1396,6 +1377,7 @@ static int ProcessNodes( filter_t *p_filter,
psz_node
,
GetStyleFromFontStack
(
p_filter
,
&
p_fonts
,
&
p_sys
->
style
,
i_style_flags
),
i_k_date
);
free
(
psz_node
);
...
...
modules/text_renderer/text_renderer.c
View file @
d8d34fbe
...
...
@@ -501,4 +501,26 @@ bool FaceStyleEquals( const text_style_t *p_style1,
!
strcmp
(
p_style1
->
psz_fontname
,
p_style2
->
psz_fontname
);
}
text_style_t
*
GetStyleFromFontStack
(
filter_t
*
p_filter
,
font_stack_t
**
p_fonts
,
text_style_t
*
style
,
int
i_style_flags
)
{
char
*
psz_fontname
=
NULL
;
uint32_t
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
i_font_color
=
VLC_CLIP
(
i_font_color
,
0
,
0xFFFFFF
);
i_font_color
=
i_font_color
&
0x00ffffff
;
int
i_font_size
=
style
->
i_font_size
;
uint32_t
i_karaoke_bg_color
=
i_font_color
;
if
(
PeekFont
(
p_fonts
,
&
psz_fontname
,
&
i_font_size
,
&
i_font_color
,
&
i_karaoke_bg_color
)
)
return
NULL
;
return
CreateStyle
(
psz_fontname
,
i_font_size
,
i_font_color
,
i_karaoke_bg_color
,
i_style_flags
);
}
modules/text_renderer/text_renderer.h
View file @
d8d34fbe
...
...
@@ -60,6 +60,11 @@ text_style_t *CreateStyle( char *psz_fontname, int i_font_size,
uint32_t
i_font_color
,
uint32_t
i_karaoke_bg_color
,
int
i_style_flags
);
text_style_t
*
GetStyleFromFontStack
(
filter_t
*
p_filter
,
font_stack_t
**
p_fonts
,
text_style_t
*
style
,
int
i_style_flags
);
#ifdef __OS2__
typedef
uint16_t
uni_char_t
;
# define FREETYPE_TO_UCS "UCS-2LE"
...
...
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