Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
bc4b7944
Commit
bc4b7944
authored
Dec 27, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartztext: add support for HTML color names within color tags
parent
1bccc59e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
modules/text_renderer/quartztext.c
modules/text_renderer/quartztext.c
+21
-3
No files found.
modules/text_renderer/quartztext.c
View file @
bc4b7944
...
...
@@ -106,6 +106,11 @@ static const int pi_color_values[] = {
0x00FF0000
,
0x00FF00FF
,
0x00FFFF00
,
0x00808000
,
0x00008000
,
0x00008080
,
0x0000FF00
,
0x00800080
,
0x00000080
,
0x000000FF
,
0x0000FFFF
};
static
const
char
*
const
ppsz_color_names
[]
=
{
"black"
,
"gray"
,
"silver"
,
"white"
,
"maroon"
,
"red"
,
"fuchsia"
,
"yellow"
,
"olive"
,
"green"
,
"teal"
,
"lime"
,
"purple"
,
"navy"
,
"blue"
,
"aqua"
};
static
const
char
*
const
ppsz_color_descriptions
[]
=
{
N_
(
"Black"
),
N_
(
"Gray"
),
N_
(
"Silver"
),
N_
(
"White"
),
N_
(
"Maroon"
),
N_
(
"Red"
),
N_
(
"Fuchsia"
),
N_
(
"Yellow"
),
N_
(
"Olive"
),
N_
(
"Green"
),
N_
(
"Teal"
),
...
...
@@ -310,6 +315,7 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
bool
b_bold
,
b_uline
,
b_italic
;
vlc_value_t
val
;
b_bold
=
b_uline
=
b_italic
=
FALSE
;
VLC_UNUSED
(
p_chroma_list
);
p_sys
->
i_font_size
=
GetFontSize
(
p_filter
);
...
...
@@ -492,9 +498,20 @@ static int HandleFontAttributes(xml_reader_t *p_xml_reader,
}
else
i_font_size
=
atoi
(
value
);
}
else
if
(
!
strcasecmp
(
"color"
,
attr
)
&&
(
value
[
0
]
==
'#'
))
{
i_font_color
=
strtol
(
value
+
1
,
NULL
,
16
);
i_font_color
&=
0x00ffffff
;
}
else
if
(
!
strcasecmp
(
"color"
,
attr
))
{
if
(
value
[
0
]
==
'#'
)
{
i_font_color
=
strtol
(
value
+
1
,
NULL
,
16
);
i_font_color
&=
0x00ffffff
;
}
else
{
/* color detection fallback */
unsigned
int
count
=
sizeof
(
ppsz_color_names
);
for
(
unsigned
x
=
0
;
x
<
count
;
x
++
)
{
if
(
!
strcmp
(
value
,
ppsz_color_names
[
x
]))
{
i_font_color
=
pi_color_values
[
x
];
break
;
}
}
}
}
else
if
(
!
strcasecmp
(
"alpha"
,
attr
)
&&
(
value
[
0
]
==
'#'
))
{
i_font_alpha
=
strtol
(
value
+
1
,
NULL
,
16
);
i_font_alpha
&=
0xff
;
...
...
@@ -740,6 +757,7 @@ static int RenderHtml(filter_t *p_filter, subpicture_region_t *p_region_out,
stream_t
*
p_sub
=
NULL
;
xml_t
*
p_xml
=
NULL
;
xml_reader_t
*
p_xml_reader
=
NULL
;
VLC_UNUSED
(
p_chroma_list
);
if
(
!
p_region_in
||
!
p_region_in
->
psz_html
)
return
VLC_EGENERIC
;
...
...
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