]> git.sesse.net Git - vlc/commitdiff
Try to parse unrecognized color names as hexadecimal value (freetype).
authorLaurent Aimar <fenrir@videolan.org>
Sun, 19 Jun 2011 00:27:09 +0000 (02:27 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 25 Jun 2011 18:10:26 +0000 (20:10 +0200)
They should be prefixed by '#' but it is not always done...

modules/misc/text_renderer/freetype.c

index c431748c94fe491850da39c51a0d184c4afa440e..7b66938d582ff4448bba2921ef22b8f471ef0de9 100644 (file)
@@ -1212,6 +1212,11 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
             }
             else
             {
+                char *end;
+                uint32_t i_value = strtol( value, &end, 16 );
+                if( *end == '\0' || *end == ' ' )
+                    i_font_color = i_value & 0x00ffffff;
+
                 for( int i = 0; p_html_colors[i].psz_name != NULL; i++ )
                 {
                     if( !strncasecmp( value, p_html_colors[i].psz_name, strlen(p_html_colors[i].psz_name) ) )