Go to the documentation of this file.
   25 #ifndef VLC_TEXT_STYLE_H 
   26 #define VLC_TEXT_STYLE_H 1 
   43     char *     psz_monofontname;  
 
   46     uint16_t   i_style_flags;     
 
   58     uint8_t    i_outline_alpha;   
 
   63     uint8_t    i_shadow_alpha;    
 
   67     int        i_background_color;
 
   68     uint8_t    i_background_alpha;
 
   69     int        i_karaoke_background_color;
 
   70     uint8_t    i_karaoke_background_alpha;
 
   75         STYLE_WRAP_DEFAULT = 0,   
 
   81 #define STYLE_ALPHA_OPAQUE      0xFF 
   82 #define STYLE_ALPHA_TRANSPARENT 0x00 
   85 #define STYLE_NO_DEFAULTS               0x0 
   86 #define STYLE_FULLY_SET                 0xFFFF 
   87 #define STYLE_HAS_FONT_COLOR            (1 << 0) 
   88 #define STYLE_HAS_FONT_ALPHA            (1 << 1) 
   89 #define STYLE_HAS_FLAGS                 (1 << 2) 
   90 #define STYLE_HAS_OUTLINE_COLOR         (1 << 3) 
   91 #define STYLE_HAS_OUTLINE_ALPHA         (1 << 4) 
   92 #define STYLE_HAS_SHADOW_COLOR          (1 << 5) 
   93 #define STYLE_HAS_SHADOW_ALPHA          (1 << 6) 
   94 #define STYLE_HAS_BACKGROUND_COLOR      (1 << 7) 
   95 #define STYLE_HAS_BACKGROUND_ALPHA      (1 << 8) 
   96 #define STYLE_HAS_K_BACKGROUND_COLOR    (1 << 9) 
   97 #define STYLE_HAS_K_BACKGROUND_ALPHA    (1 << 10) 
   98 #define STYLE_HAS_WRAP_INFO             (1 << 11) 
  101 #define STYLE_BOLD              (1 << 0) 
  102 #define STYLE_ITALIC            (1 << 1) 
  103 #define STYLE_OUTLINE           (1 << 2) 
  104 #define STYLE_SHADOW            (1 << 3) 
  105 #define STYLE_BACKGROUND        (1 << 4) 
  106 #define STYLE_UNDERLINE         (1 << 5) 
  107 #define STYLE_STRIKEOUT         (1 << 6) 
  108 #define STYLE_HALFWIDTH         (1 << 7) 
  109 #define STYLE_MONOSPACED        (1 << 8) 
  110 #define STYLE_DOUBLEWIDTH       (1 << 9) 
  111 #define STYLE_BLINK_FOREGROUND  (1 << 10) 
  112 #define STYLE_BLINK_BACKGROUND  (1 << 11) 
  114 #define STYLE_DEFAULT_FONT_SIZE 20 
  115 #define STYLE_DEFAULT_REL_FONT_SIZE 6.25 
  213 static const struct {
 
  218     { 
"Aqua",    0x00FFFF },
 
  219     { 
"Black",   0x000000 },
 
  220     { 
"Blue",    0x0000FF },
 
  221     { 
"Fuchsia", 0xFF00FF },
 
  222     { 
"Gray",    0x808080 },
 
  223     { 
"Green",   0x008000 },
 
  224     { 
"Lime",    0x00FF00 },
 
  225     { 
"Maroon",  0x800000 },
 
  226     { 
"Navy",    0x000080 },
 
  227     { 
"Olive",   0x808000 },
 
  228     { 
"Purple",  0x800080 },
 
  230     { 
"Silver",  0xC0C0C0 },
 
  231     { 
"Teal",    0x008080 },
 
  232     { 
"White",   0xFFFFFF },
 
  233     { 
"Yellow",  0xFFFF00 },
 
  236     { 
"AliceBlue", 0xF0F8FF },
 
  237     { 
"AntiqueWhite", 0xFAEBD7 },
 
  238     { 
"Aqua", 0x00FFFF },
 
  239     { 
"Aquamarine", 0x7FFFD4 },
 
  240     { 
"Azure", 0xF0FFFF },
 
  241     { 
"Beige", 0xF5F5DC },
 
  242     { 
"Bisque", 0xFFE4C4 },
 
  243     { 
"Black", 0x000000 },
 
  244     { 
"BlanchedAlmond", 0xFFEBCD },
 
  245     { 
"Blue", 0x0000FF },
 
  246     { 
"BlueViolet", 0x8A2BE2 },
 
  247     { 
"Brown", 0xA52A2A },
 
  248     { 
"BurlyWood", 0xDEB887 },
 
  249     { 
"CadetBlue", 0x5F9EA0 },
 
  250     { 
"Chartreuse", 0x7FFF00 },
 
  251     { 
"Chocolate", 0xD2691E },
 
  252     { 
"Coral", 0xFF7F50 },
 
  253     { 
"CornflowerBlue", 0x6495ED },
 
  254     { 
"Cornsilk", 0xFFF8DC },
 
  255     { 
"Crimson", 0xDC143C },
 
  256     { 
"Cyan", 0x00FFFF },
 
  257     { 
"DarkBlue", 0x00008B },
 
  258     { 
"DarkCyan", 0x008B8B },
 
  259     { 
"DarkGoldenRod", 0xB8860B },
 
  260     { 
"DarkGray", 0xA9A9A9 },
 
  261     { 
"DarkGrey", 0xA9A9A9 },
 
  262     { 
"DarkGreen", 0x006400 },
 
  263     { 
"DarkKhaki", 0xBDB76B },
 
  264     { 
"DarkMagenta", 0x8B008B },
 
  265     { 
"DarkOliveGreen", 0x556B2F },
 
  266     { 
"Darkorange", 0xFF8C00 },
 
  267     { 
"DarkOrchid", 0x9932CC },
 
  268     { 
"DarkRed", 0x8B0000 },
 
  269     { 
"DarkSalmon", 0xE9967A },
 
  270     { 
"DarkSeaGreen", 0x8FBC8F },
 
  271     { 
"DarkSlateBlue", 0x483D8B },
 
  272     { 
"DarkSlateGray", 0x2F4F4F },
 
  273     { 
"DarkSlateGrey", 0x2F4F4F },
 
  274     { 
"DarkTurquoise", 0x00CED1 },
 
  275     { 
"DarkViolet", 0x9400D3 },
 
  276     { 
"DeepPink", 0xFF1493 },
 
  277     { 
"DeepSkyBlue", 0x00BFFF },
 
  278     { 
"DimGray", 0x696969 },
 
  279     { 
"DimGrey", 0x696969 },
 
  280     { 
"DodgerBlue", 0x1E90FF },
 
  281     { 
"FireBrick", 0xB22222 },
 
  282     { 
"FloralWhite", 0xFFFAF0 },
 
  283     { 
"ForestGreen", 0x228B22 },
 
  284     { 
"Fuchsia", 0xFF00FF },
 
  285     { 
"Gainsboro", 0xDCDCDC },
 
  286     { 
"GhostWhite", 0xF8F8FF },
 
  287     { 
"Gold", 0xFFD700 },
 
  288     { 
"GoldenRod", 0xDAA520 },
 
  289     { 
"Gray", 0x808080 },
 
  290     { 
"Grey", 0x808080 },
 
  291     { 
"Green", 0x008000 },
 
  292     { 
"GreenYellow", 0xADFF2F },
 
  293     { 
"HoneyDew", 0xF0FFF0 },
 
  294     { 
"HotPink", 0xFF69B4 },
 
  295     { 
"IndianRed", 0xCD5C5C },
 
  296     { 
"Indigo", 0x4B0082 },
 
  297     { 
"Ivory", 0xFFFFF0 },
 
  298     { 
"Khaki", 0xF0E68C },
 
  299     { 
"Lavender", 0xE6E6FA },
 
  300     { 
"LavenderBlush", 0xFFF0F5 },
 
  301     { 
"LawnGreen", 0x7CFC00 },
 
  302     { 
"LemonChiffon", 0xFFFACD },
 
  303     { 
"LightBlue", 0xADD8E6 },
 
  304     { 
"LightCoral", 0xF08080 },
 
  305     { 
"LightCyan", 0xE0FFFF },
 
  306     { 
"LightGoldenRodYellow", 0xFAFAD2 },
 
  307     { 
"LightGray", 0xD3D3D3 },
 
  308     { 
"LightGrey", 0xD3D3D3 },
 
  309     { 
"LightGreen", 0x90EE90 },
 
  310     { 
"LightPink", 0xFFB6C1 },
 
  311     { 
"LightSalmon", 0xFFA07A },
 
  312     { 
"LightSeaGreen", 0x20B2AA },
 
  313     { 
"LightSkyBlue", 0x87CEFA },
 
  314     { 
"LightSlateGray", 0x778899 },
 
  315     { 
"LightSlateGrey", 0x778899 },
 
  316     { 
"LightSteelBlue", 0xB0C4DE },
 
  317     { 
"LightYellow", 0xFFFFE0 },
 
  318     { 
"Lime", 0x00FF00 },
 
  319     { 
"LimeGreen", 0x32CD32 },
 
  320     { 
"Linen", 0xFAF0E6 },
 
  321     { 
"Magenta", 0xFF00FF },
 
  322     { 
"Maroon", 0x800000 },
 
  323     { 
"MediumAquaMarine", 0x66CDAA },
 
  324     { 
"MediumBlue", 0x0000CD },
 
  325     { 
"MediumOrchid", 0xBA55D3 },
 
  326     { 
"MediumPurple", 0x9370D8 },
 
  327     { 
"MediumSeaGreen", 0x3CB371 },
 
  328     { 
"MediumSlateBlue", 0x7B68EE },
 
  329     { 
"MediumSpringGreen", 0x00FA9A },
 
  330     { 
"MediumTurquoise", 0x48D1CC },
 
  331     { 
"MediumVioletRed", 0xC71585 },
 
  332     { 
"MidnightBlue", 0x191970 },
 
  333     { 
"MintCream", 0xF5FFFA },
 
  334     { 
"MistyRose", 0xFFE4E1 },
 
  335     { 
"Moccasin", 0xFFE4B5 },
 
  336     { 
"NavajoWhite", 0xFFDEAD },
 
  337     { 
"Navy", 0x000080 },
 
  338     { 
"OldLace", 0xFDF5E6 },
 
  339     { 
"Olive", 0x808000 },
 
  340     { 
"OliveDrab", 0x6B8E23 },
 
  341     { 
"Orange", 0xFFA500 },
 
  342     { 
"OrangeRed", 0xFF4500 },
 
  343     { 
"Orchid", 0xDA70D6 },
 
  344     { 
"PaleGoldenRod", 0xEEE8AA },
 
  345     { 
"PaleGreen", 0x98FB98 },
 
  346     { 
"PaleTurquoise", 0xAFEEEE },
 
  347     { 
"PaleVioletRed", 0xD87093 },
 
  348     { 
"PapayaWhip", 0xFFEFD5 },
 
  349     { 
"PeachPuff", 0xFFDAB9 },
 
  350     { 
"Peru", 0xCD853F },
 
  351     { 
"Pink", 0xFFC0CB },
 
  352     { 
"Plum", 0xDDA0DD },
 
  353     { 
"PowderBlue", 0xB0E0E6 },
 
  354     { 
"Purple", 0x800080 },
 
  355     { 
"RebeccaPurple", 0x663399 },
 
  357     { 
"RosyBrown", 0xBC8F8F },
 
  358     { 
"RoyalBlue", 0x4169E1 },
 
  359     { 
"SaddleBrown", 0x8B4513 },
 
  360     { 
"Salmon", 0xFA8072 },
 
  361     { 
"SandyBrown", 0xF4A460 },
 
  362     { 
"SeaGreen", 0x2E8B57 },
 
  363     { 
"SeaShell", 0xFFF5EE },
 
  364     { 
"Sienna", 0xA0522D },
 
  365     { 
"Silver", 0xC0C0C0 },
 
  366     { 
"SkyBlue", 0x87CEEB },
 
  367     { 
"SlateBlue", 0x6A5ACD },
 
  368     { 
"SlateGray", 0x708090 },
 
  369     { 
"SlateGrey", 0x708090 },
 
  370     { 
"Snow", 0xFFFAFA },
 
  371     { 
"SpringGreen", 0x00FF7F },
 
  372     { 
"SteelBlue", 0x4682B4 },
 
  374     { 
"Teal", 0x008080 },
 
  375     { 
"Thistle", 0xD8BFD8 },
 
  376     { 
"Tomato", 0xFF6347 },
 
  377     { 
"Turquoise", 0x40E0D0 },
 
  378     { 
"Violet", 0xEE82EE },
 
  379     { 
"Wheat", 0xF5DEB3 },
 
  380     { 
"White", 0xFFFFFF },
 
  381     { 
"WhiteSmoke", 0xF5F5F5 },
 
  382     { 
"Yellow", 0xFFFF00 },
 
  383     { 
"YellowGreen", 0x9ACD32 },
 
  
text_style_t * text_style_Create(int)
Create a text style.
Definition: text_style.c:38
#define VLC_API
Definition: fourcc_gen.c:30
uint32_t i_value
Definition: vlc_text_style.h:215
Text segment for subtitles.
Definition: vlc_text_style.h:131
const char * psz_name
Definition: vlc_text_style.h:214
text_style_t * text_style_Duplicate(const text_style_t *)
Duplicate a text style.
Definition: text_style.c:138
text_segment_t * text_segment_New(const char *)
This function will create a new text segment.
Definition: text_style.c:158
text_segment_t * text_segment_Copy(text_segment_t *)
This function will copy a text_segment and its chain into a new one.
Definition: text_style.c:208
text_segment_t * p_next
next segment
Definition: vlc_text_style.h:134
void text_style_Merge(text_style_t *, const text_style_t *, bool b_override)
Merge two styles using non default values.
Definition: text_style.c:97
void text_style_Delete(text_style_t *)
Delete a text style created by text_style_New or text_style_Duplicate.
Definition: text_style.c:149
text_segment_t * text_segment_NewInheritStyle(const text_style_t *p_style)
This function will create a new text segment and duplicates the style passed as argument.
Definition: text_style.c:170
Text style.
Definition: vlc_text_style.h:39
void text_segment_ChainDelete(text_segment_t *)
This function will destroy a list of text segments allocated by text_segment_New.
Definition: text_style.c:196
text_style_t * style
style applied to this segment
Definition: vlc_text_style.h:133
static const struct @199 p_html_colors[]
char psz_value[8]
Definition: vout_intf.c:91
void text_segment_Delete(text_segment_t *)
Delete a text segment and its content.
Definition: text_style.c:186
unsigned int vlc_html_color(const char *psz_value, bool *ok)
Returns an integer representation of an HTML color.
Definition: text_style.c:236
text_style_t * text_style_New(void)
Create a default text style.
Definition: text_style.c:33
char * psz_text
text string of the segment
Definition: vlc_text_style.h:132
text_style_t * text_style_Copy(text_style_t *, const text_style_t *)
Copy a text style into another.
Definition: text_style.c:72