Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8ea8e3aa
Commit
8ea8e3aa
authored
Mar 23, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype renderer: cosmetics
parent
d610defd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
modules/misc/freetype.c
modules/misc/freetype.c
+28
-25
No files found.
modules/misc/freetype.c
View file @
8ea8e3aa
...
@@ -228,7 +228,7 @@ struct line_desc_t
...
@@ -228,7 +228,7 @@ struct line_desc_t
uint32_t
*
p_fg_rgb
;
uint32_t
*
p_fg_rgb
;
uint32_t
*
p_bg_rgb
;
uint32_t
*
p_bg_rgb
;
uint8_t
*
p_fg_bg_ratio
;
/* 0x00=100% FG --> 0x7F=100% BG */
uint8_t
*
p_fg_bg_ratio
;
/* 0x00=100% FG --> 0x7F=100% BG */
bool
b_new_color_mode
;
bool
b_new_color_mode
;
/** underline information -- only supplied if text should be underlined */
/** underline information -- only supplied if text should be underlined */
int
*
pi_underline_offset
;
int
*
pi_underline_offset
;
uint16_t
*
pi_underline_thickness
;
uint16_t
*
pi_underline_thickness
;
...
@@ -247,10 +247,10 @@ typedef struct
...
@@ -247,10 +247,10 @@ typedef struct
int
i_font_size
;
int
i_font_size
;
uint32_t
i_font_color
;
/* ARGB */
uint32_t
i_font_color
;
/* ARGB */
uint32_t
i_karaoke_bg_color
;
/* ARGB */
uint32_t
i_karaoke_bg_color
;
/* ARGB */
bool
b_italic
;
bool
b_italic
;
bool
b_bold
;
bool
b_bold
;
bool
b_underline
;
bool
b_underline
;
bool
b_through
;
bool
b_through
;
char
*
psz_fontname
;
char
*
psz_fontname
;
}
ft_style_t
;
}
ft_style_t
;
...
@@ -268,7 +268,7 @@ struct filter_sys_t
...
@@ -268,7 +268,7 @@ struct filter_sys_t
{
{
FT_Library
p_library
;
/* handle to library */
FT_Library
p_library
;
/* handle to library */
FT_Face
p_face
;
/* handle to face object */
FT_Face
p_face
;
/* handle to face object */
bool
i_use_kerning
;
bool
i_use_kerning
;
uint8_t
i_font_opacity
;
uint8_t
i_font_opacity
;
int
i_font_color
;
int
i_font_color
;
int
i_font_size
;
int
i_font_size
;
...
@@ -283,7 +283,6 @@ struct filter_sys_t
...
@@ -283,7 +283,6 @@ struct filter_sys_t
input_attachment_t
**
pp_font_attachments
;
input_attachment_t
**
pp_font_attachments
;
int
i_font_attachments
;
int
i_font_attachments
;
};
};
#define UCHAR uint32_t
#define UCHAR uint32_t
...
@@ -301,21 +300,22 @@ static int Create( vlc_object_t *p_this )
...
@@ -301,21 +300,22 @@ static int Create( vlc_object_t *p_this )
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
filter_sys_t
*
p_sys
;
char
*
psz_fontfile
=
NULL
;
char
*
psz_fontfile
=
NULL
;
char
*
psz_fontfamily
=
NULL
;
char
*
psz_fontfamily
=
NULL
;
int
i_error
,
fontindex
;
int
i_error
,
fontindex
;
/* Allocate structure */
/* Allocate structure */
p_filter
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
filter_sys_t
)
);
p_filter
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
filter_sys_t
)
);
if
(
!
p_sys
)
if
(
!
p_sys
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
#ifdef HAVE_STYLES
#ifdef HAVE_STYLES
p_sys
->
psz_fontfamily
=
NULL
;
p_sys
->
psz_fontfamily
=
NULL
;
p_sys
->
p_xml
=
NULL
;
p_sys
->
p_xml
=
NULL
;
#endif
#endif
p_sys
->
p_face
=
0
;
p_sys
->
p_face
=
0
;
p_sys
->
p_library
=
0
;
p_sys
->
p_library
=
0
;
p_sys
->
i_font_size
=
0
;
p_sys
->
i_font_size
=
0
;
p_sys
->
i_display_height
=
0
;
p_sys
->
i_display_height
=
0
;
var_Create
(
p_filter
,
"freetype-rel-fontsize"
,
var_Create
(
p_filter
,
"freetype-rel-fontsize"
,
...
@@ -329,7 +329,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -329,7 +329,7 @@ static int Create( vlc_object_t *p_this )
p_sys
->
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
p_sys
->
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
p_sys
->
i_font_color
=
__MAX
(
__MIN
(
p_sys
->
i_font_color
,
0xFFFFFF
),
0
);
p_sys
->
i_font_color
=
__MAX
(
__MIN
(
p_sys
->
i_font_color
,
0xFFFFFF
),
0
);
fontindex
=
0
;
/* Set default psz_fontfamily */
if
(
!
psz_fontfamily
||
!*
psz_fontfamily
)
if
(
!
psz_fontfamily
||
!*
psz_fontfamily
)
{
{
free
(
psz_fontfamily
);
free
(
psz_fontfamily
);
...
@@ -340,7 +340,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -340,7 +340,7 @@ static int Create( vlc_object_t *p_this )
if
(
!
psz_fontfamily
)
if
(
!
psz_fontfamily
)
goto
error
;
goto
error
;
# ifdef WIN32
# ifdef WIN32
GetWindowsDirectory
(
psz_fontfamily
,
PATH_MAX
+
1
);
GetWindowsDirectory
(
psz_fontfamily
,
PATH_MAX
+
1
);
strcat
(
psz_fontfamily
,
"
\\
fonts
\\
arial.ttf"
);
strcat
(
psz_fontfamily
,
"
\\
fonts
\\
arial.ttf"
);
# else
# else
strcpy
(
psz_fontfamily
,
DEFAULT_FONT
);
strcpy
(
psz_fontfamily
,
DEFAULT_FONT
);
...
@@ -349,6 +349,8 @@ static int Create( vlc_object_t *p_this )
...
@@ -349,6 +349,8 @@ static int Create( vlc_object_t *p_this )
#endif
#endif
}
}
/* Set the font file */
fontindex
=
0
;
#ifdef HAVE_FONTCONFIG
#ifdef HAVE_FONTCONFIG
if
(
FontConfig_FindFont
(
p_filter
,
psz_fontfamily
,
&
psz_fontfile
,
&
fontindex
)
if
(
FontConfig_FindFont
(
p_filter
,
psz_fontfamily
,
&
psz_fontfile
,
&
fontindex
)
!=
VLC_SUCCESS
)
!=
VLC_SUCCESS
)
...
@@ -357,6 +359,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -357,6 +359,7 @@ static int Create( vlc_object_t *p_this )
psz_fontfile
=
psz_fontfamily
;
psz_fontfile
=
psz_fontfamily
;
#endif
#endif
/* */
i_error
=
FT_Init_FreeType
(
&
p_sys
->
p_library
);
i_error
=
FT_Init_FreeType
(
&
p_sys
->
p_library
);
if
(
i_error
)
if
(
i_error
)
{
{
...
@@ -2131,15 +2134,15 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
...
@@ -2131,15 +2134,15 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
if
(
p_xml_reader
)
if
(
p_xml_reader
)
{
{
uint32_t
*
psz_text
;
uint32_t
*
psz_text
;
int
i_len
=
0
;
int
i_len
=
0
;
uint32_t
i_runs
=
0
;
uint32_t
i_runs
=
0
;
uint32_t
i_k_runs
=
0
;
uint32_t
i_k_runs
=
0
;
uint32_t
*
pi_run_lengths
=
NULL
;
uint32_t
*
pi_run_lengths
=
NULL
;
uint32_t
*
pi_k_run_lengths
=
NULL
;
uint32_t
*
pi_k_run_lengths
=
NULL
;
uint32_t
*
pi_k_durations
=
NULL
;
uint32_t
*
pi_k_durations
=
NULL
;
ft_style_t
**
pp_styles
=
NULL
;
ft_style_t
**
pp_styles
=
NULL
;
FT_Vector
result
;
FT_Vector
result
=
{
0
,
0
}
;
line_desc_t
*
p_lines
=
NULL
;
line_desc_t
*
p_lines
=
NULL
;
psz_text
=
(
uint32_t
*
)
malloc
(
strlen
(
p_region_in
->
psz_html
)
*
psz_text
=
(
uint32_t
*
)
malloc
(
strlen
(
p_region_in
->
psz_html
)
*
sizeof
(
uint32_t
)
);
sizeof
(
uint32_t
)
);
...
...
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