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
a1a02efe
Commit
a1a02efe
authored
Aug 17, 2015
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: regroup functions
parent
e09289ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
36 deletions
+34
-36
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+34
-36
No files found.
modules/text_renderer/freetype.c
View file @
a1a02efe
...
...
@@ -861,42 +861,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
return
VLC_SUCCESS
;
}
static
FT_Face
LoadEmbeddedFace
(
filter_sys_t
*
p_sys
,
const
char
*
psz_fontname
,
const
text_style_t
*
p_style
)
{
for
(
int
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
{
input_attachment_t
*
p_attach
=
p_sys
->
pp_font_attachments
[
k
];
int
i_font_idx
=
0
;
FT_Face
p_face
=
NULL
;
while
(
0
==
FT_New_Memory_Face
(
p_sys
->
p_library
,
p_attach
->
p_data
,
p_attach
->
i_data
,
i_font_idx
,
&
p_face
))
{
if
(
p_face
)
{
int
i_style_received
=
((
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
)
?
STYLE_BOLD
:
0
)
|
((
p_face
->
style_flags
&
FT_STYLE_FLAG_ITALIC
)
?
STYLE_ITALIC
:
0
);
if
(
p_face
->
family_name
!=
NULL
&&
!
strcasecmp
(
p_face
->
family_name
,
psz_fontname
)
&&
(
p_style
->
i_style_flags
&
(
STYLE_BOLD
|
STYLE_ITALIC
))
==
i_style_received
)
return
p_face
;
FT_Done_Face
(
p_face
);
}
i_font_idx
++
;
}
}
return
NULL
;
}
static
void
FillDefaultStyles
(
filter_t
*
p_filter
)
{
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
...
...
@@ -931,6 +895,7 @@ static void FillDefaultStyles( filter_t *p_filter )
/* Apply forced styles to defaults, if any */
text_style_Merge
(
p_sys
->
p_default_style
,
p_sys
->
p_forced_style
,
true
);
}
static
uni_char_t
*
SegmentsToTextAndStyles
(
filter_t
*
p_filter
,
const
text_segment_t
*
p_segment
,
size_t
*
pi_string_length
,
const
text_style_t
***
ppp_styles
)
{
const
text_style_t
**
pp_styles
=
NULL
;
...
...
@@ -1367,6 +1332,39 @@ bool FaceStyleEquals( const text_style_t *p_style1,
!
strcmp
(
p_style1
->
psz_fontname
,
p_style2
->
psz_fontname
);
}
static
FT_Face
LoadEmbeddedFace
(
filter_sys_t
*
p_sys
,
const
char
*
psz_fontname
,
const
text_style_t
*
p_style
)
{
for
(
int
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
{
input_attachment_t
*
p_attach
=
p_sys
->
pp_font_attachments
[
k
];
int
i_font_idx
=
0
;
FT_Face
p_face
=
NULL
;
while
(
0
==
FT_New_Memory_Face
(
p_sys
->
p_library
,
p_attach
->
p_data
,
p_attach
->
i_data
,
i_font_idx
,
&
p_face
))
{
if
(
p_face
)
{
int
i_style_received
=
((
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
)
?
STYLE_BOLD
:
0
)
|
((
p_face
->
style_flags
&
FT_STYLE_FLAG_ITALIC
)
?
STYLE_ITALIC
:
0
);
if
(
p_face
->
family_name
!=
NULL
&&
!
strcasecmp
(
p_face
->
family_name
,
psz_fontname
)
&&
(
p_style
->
i_style_flags
&
(
STYLE_BOLD
|
STYLE_ITALIC
))
==
i_style_received
)
return
p_face
;
FT_Done_Face
(
p_face
);
}
i_font_idx
++
;
}
}
return
NULL
;
}
FT_Face
LoadFace
(
filter_t
*
p_filter
,
const
text_style_t
*
p_style
)
{
...
...
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