]> git.sesse.net Git - vlc/blob - modules/misc/text_renderer.h
Use resolve_xml_special_chars where appropriate.
[vlc] / modules / misc / text_renderer.h
1 /*****************************************************************************
2  * text_renderer.h: common text renderer code
3  *****************************************************************************
4  * Copyright (C) 2007-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Bernie Purcell <bitmap@videolan.org>
8  *          Laurent Aimar < fenrir AT videolan DOT org >
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 typedef struct font_stack_t font_stack_t;
26 struct font_stack_t
27 {
28     char          *psz_name;
29     int            i_size;
30     uint32_t       i_color;            /* ARGB */
31     uint32_t       i_karaoke_bg_color; /* ARGB */
32
33     font_stack_t  *p_next;
34 };
35
36 static void SetupLine( filter_t *p_filter, const char *psz_text_in,
37                        UCHAR **psz_text_out, uint32_t *pi_runs,
38                        uint32_t **ppi_run_lengths, TR_FONT_STYLE_PTR **ppp_styles,
39                        TR_FONT_STYLE_PTR p_style );
40
41 static TR_FONT_STYLE_PTR GetStyleFromFontStack( filter_sys_t *p_sys,
42                                           font_stack_t **p_fonts, bool b_bold, bool b_italic,
43                                           bool b_uline );
44
45 static int PushFont( font_stack_t **p_font, const char *psz_name, int i_size,
46                      uint32_t i_color, uint32_t i_karaoke_bg_color )
47 {
48     font_stack_t *p_new;
49
50     if( !p_font )
51         return VLC_EGENERIC;
52
53     p_new = malloc( sizeof( font_stack_t ) );
54     if( ! p_new )
55         return VLC_ENOMEM;
56
57     p_new->p_next = NULL;
58
59     if( psz_name )
60         p_new->psz_name = strdup( psz_name );
61     else
62         p_new->psz_name = NULL;
63
64     p_new->i_size              = i_size;
65     p_new->i_color             = i_color;
66     p_new->i_karaoke_bg_color  = i_karaoke_bg_color;
67
68     if( !*p_font )
69     {
70         *p_font = p_new;
71     }
72     else
73     {
74         font_stack_t *p_last;
75
76         for( p_last = *p_font;
77              p_last->p_next;
78              p_last = p_last->p_next )
79         ;
80
81         p_last->p_next = p_new;
82     }
83     return VLC_SUCCESS;
84 }
85
86 static int PopFont( font_stack_t **p_font )
87 {
88     font_stack_t *p_last, *p_next_to_last;
89
90     if( !p_font || !*p_font )
91         return VLC_EGENERIC;
92
93     p_next_to_last = NULL;
94     for( p_last = *p_font;
95          p_last->p_next;
96          p_last = p_last->p_next )
97     {
98         p_next_to_last = p_last;
99     }
100
101     if( p_next_to_last )
102         p_next_to_last->p_next = NULL;
103     else
104         *p_font = NULL;
105
106     free( p_last->psz_name );
107     free( p_last );
108
109     return VLC_SUCCESS;
110 }
111
112 static int PeekFont( font_stack_t **p_font, char **psz_name, int *i_size,
113                      uint32_t *i_color, uint32_t *i_karaoke_bg_color )
114 {
115     font_stack_t *p_last;
116
117     if( !p_font || !*p_font )
118         return VLC_EGENERIC;
119
120     for( p_last=*p_font;
121          p_last->p_next;
122          p_last=p_last->p_next )
123     ;
124
125     *psz_name            = p_last->psz_name;
126     *i_size              = p_last->i_size;
127     *i_color             = p_last->i_color;
128     *i_karaoke_bg_color  = p_last->i_karaoke_bg_color;
129
130     return VLC_SUCCESS;
131 }
132
133 static const struct {
134     const char *psz_name;
135     uint32_t   i_value;
136 } p_html_colors[] = {
137     /* Official html colors */
138     { "Aqua",    0x00FFFF },
139     { "Black",   0x000000 },
140     { "Blue",    0x0000FF },
141     { "Fuchsia", 0xFF00FF },
142     { "Gray",    0x808080 },
143     { "Green",   0x008000 },
144     { "Lime",    0x00FF00 },
145     { "Maroon",  0x800000 },
146     { "Navy",    0x000080 },
147     { "Olive",   0x808000 },
148     { "Purple",  0x800080 },
149     { "Red",     0xFF0000 },
150     { "Silver",  0xC0C0C0 },
151     { "Teal",    0x008080 },
152     { "White",   0xFFFFFF },
153     { "Yellow",  0xFFFF00 },
154
155     /* Common ones */
156     { "AliceBlue", 0xF0F8FF },
157     { "AntiqueWhite", 0xFAEBD7 },
158     { "Aqua", 0x00FFFF },
159     { "Aquamarine", 0x7FFFD4 },
160     { "Azure", 0xF0FFFF },
161     { "Beige", 0xF5F5DC },
162     { "Bisque", 0xFFE4C4 },
163     { "Black", 0x000000 },
164     { "BlanchedAlmond", 0xFFEBCD },
165     { "Blue", 0x0000FF },
166     { "BlueViolet", 0x8A2BE2 },
167     { "Brown", 0xA52A2A },
168     { "BurlyWood", 0xDEB887 },
169     { "CadetBlue", 0x5F9EA0 },
170     { "Chartreuse", 0x7FFF00 },
171     { "Chocolate", 0xD2691E },
172     { "Coral", 0xFF7F50 },
173     { "CornflowerBlue", 0x6495ED },
174     { "Cornsilk", 0xFFF8DC },
175     { "Crimson", 0xDC143C },
176     { "Cyan", 0x00FFFF },
177     { "DarkBlue", 0x00008B },
178     { "DarkCyan", 0x008B8B },
179     { "DarkGoldenRod", 0xB8860B },
180     { "DarkGray", 0xA9A9A9 },
181     { "DarkGrey", 0xA9A9A9 },
182     { "DarkGreen", 0x006400 },
183     { "DarkKhaki", 0xBDB76B },
184     { "DarkMagenta", 0x8B008B },
185     { "DarkOliveGreen", 0x556B2F },
186     { "Darkorange", 0xFF8C00 },
187     { "DarkOrchid", 0x9932CC },
188     { "DarkRed", 0x8B0000 },
189     { "DarkSalmon", 0xE9967A },
190     { "DarkSeaGreen", 0x8FBC8F },
191     { "DarkSlateBlue", 0x483D8B },
192     { "DarkSlateGray", 0x2F4F4F },
193     { "DarkSlateGrey", 0x2F4F4F },
194     { "DarkTurquoise", 0x00CED1 },
195     { "DarkViolet", 0x9400D3 },
196     { "DeepPink", 0xFF1493 },
197     { "DeepSkyBlue", 0x00BFFF },
198     { "DimGray", 0x696969 },
199     { "DimGrey", 0x696969 },
200     { "DodgerBlue", 0x1E90FF },
201     { "FireBrick", 0xB22222 },
202     { "FloralWhite", 0xFFFAF0 },
203     { "ForestGreen", 0x228B22 },
204     { "Fuchsia", 0xFF00FF },
205     { "Gainsboro", 0xDCDCDC },
206     { "GhostWhite", 0xF8F8FF },
207     { "Gold", 0xFFD700 },
208     { "GoldenRod", 0xDAA520 },
209     { "Gray", 0x808080 },
210     { "Grey", 0x808080 },
211     { "Green", 0x008000 },
212     { "GreenYellow", 0xADFF2F },
213     { "HoneyDew", 0xF0FFF0 },
214     { "HotPink", 0xFF69B4 },
215     { "IndianRed", 0xCD5C5C },
216     { "Indigo", 0x4B0082 },
217     { "Ivory", 0xFFFFF0 },
218     { "Khaki", 0xF0E68C },
219     { "Lavender", 0xE6E6FA },
220     { "LavenderBlush", 0xFFF0F5 },
221     { "LawnGreen", 0x7CFC00 },
222     { "LemonChiffon", 0xFFFACD },
223     { "LightBlue", 0xADD8E6 },
224     { "LightCoral", 0xF08080 },
225     { "LightCyan", 0xE0FFFF },
226     { "LightGoldenRodYellow", 0xFAFAD2 },
227     { "LightGray", 0xD3D3D3 },
228     { "LightGrey", 0xD3D3D3 },
229     { "LightGreen", 0x90EE90 },
230     { "LightPink", 0xFFB6C1 },
231     { "LightSalmon", 0xFFA07A },
232     { "LightSeaGreen", 0x20B2AA },
233     { "LightSkyBlue", 0x87CEFA },
234     { "LightSlateGray", 0x778899 },
235     { "LightSlateGrey", 0x778899 },
236     { "LightSteelBlue", 0xB0C4DE },
237     { "LightYellow", 0xFFFFE0 },
238     { "Lime", 0x00FF00 },
239     { "LimeGreen", 0x32CD32 },
240     { "Linen", 0xFAF0E6 },
241     { "Magenta", 0xFF00FF },
242     { "Maroon", 0x800000 },
243     { "MediumAquaMarine", 0x66CDAA },
244     { "MediumBlue", 0x0000CD },
245     { "MediumOrchid", 0xBA55D3 },
246     { "MediumPurple", 0x9370D8 },
247     { "MediumSeaGreen", 0x3CB371 },
248     { "MediumSlateBlue", 0x7B68EE },
249     { "MediumSpringGreen", 0x00FA9A },
250     { "MediumTurquoise", 0x48D1CC },
251     { "MediumVioletRed", 0xC71585 },
252     { "MidnightBlue", 0x191970 },
253     { "MintCream", 0xF5FFFA },
254     { "MistyRose", 0xFFE4E1 },
255     { "Moccasin", 0xFFE4B5 },
256     { "NavajoWhite", 0xFFDEAD },
257     { "Navy", 0x000080 },
258     { "OldLace", 0xFDF5E6 },
259     { "Olive", 0x808000 },
260     { "OliveDrab", 0x6B8E23 },
261     { "Orange", 0xFFA500 },
262     { "OrangeRed", 0xFF4500 },
263     { "Orchid", 0xDA70D6 },
264     { "PaleGoldenRod", 0xEEE8AA },
265     { "PaleGreen", 0x98FB98 },
266     { "PaleTurquoise", 0xAFEEEE },
267     { "PaleVioletRed", 0xD87093 },
268     { "PapayaWhip", 0xFFEFD5 },
269     { "PeachPuff", 0xFFDAB9 },
270     { "Peru", 0xCD853F },
271     { "Pink", 0xFFC0CB },
272     { "Plum", 0xDDA0DD },
273     { "PowderBlue", 0xB0E0E6 },
274     { "Purple", 0x800080 },
275     { "Red", 0xFF0000 },
276     { "RosyBrown", 0xBC8F8F },
277     { "RoyalBlue", 0x4169E1 },
278     { "SaddleBrown", 0x8B4513 },
279     { "Salmon", 0xFA8072 },
280     { "SandyBrown", 0xF4A460 },
281     { "SeaGreen", 0x2E8B57 },
282     { "SeaShell", 0xFFF5EE },
283     { "Sienna", 0xA0522D },
284     { "Silver", 0xC0C0C0 },
285     { "SkyBlue", 0x87CEEB },
286     { "SlateBlue", 0x6A5ACD },
287     { "SlateGray", 0x708090 },
288     { "SlateGrey", 0x708090 },
289     { "Snow", 0xFFFAFA },
290     { "SpringGreen", 0x00FF7F },
291     { "SteelBlue", 0x4682B4 },
292     { "Tan", 0xD2B48C },
293     { "Teal", 0x008080 },
294     { "Thistle", 0xD8BFD8 },
295     { "Tomato", 0xFF6347 },
296     { "Turquoise", 0x40E0D0 },
297     { "Violet", 0xEE82EE },
298     { "Wheat", 0xF5DEB3 },
299     { "White", 0xFFFFFF },
300     { "WhiteSmoke", 0xF5F5F5 },
301     { "Yellow", 0xFFFF00 },
302     { "YellowGreen", 0x9ACD32 },
303
304     { NULL, 0 }
305 };
306
307 static int HandleFontAttributes( xml_reader_t *p_xml_reader,
308                                   font_stack_t **p_fonts, int i_scale )
309 {
310     int        rv;
311     char      *psz_fontname = NULL;
312     uint32_t   i_font_color = 0xffffff;
313     int        i_font_alpha = 0;
314     uint32_t   i_karaoke_bg_color = 0x00ffffff;
315     int        i_font_size  = 24;
316
317     /* Default all attributes to the top font in the stack -- in case not
318      * all attributes are specified in the sub-font
319      */
320     if( VLC_SUCCESS == PeekFont( p_fonts,
321                                  &psz_fontname,
322                                  &i_font_size,
323                                  &i_font_color,
324                                  &i_karaoke_bg_color ))
325     {
326         psz_fontname = strdup( psz_fontname );
327         i_font_size = i_font_size * 1000 / i_scale;
328     }
329     i_font_alpha = (i_font_color >> 24) & 0xff;
330     i_font_color &= 0x00ffffff;
331
332     while ( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS )
333     {
334         char *psz_name = xml_ReaderName( p_xml_reader );
335         char *psz_value = xml_ReaderValue( p_xml_reader );
336
337         if( psz_name && psz_value )
338         {
339             if( !strcasecmp( "face", psz_name ) )
340             {
341                 free( psz_fontname );
342                 psz_fontname = strdup( psz_value );
343             }
344             else if( !strcasecmp( "size", psz_name ) )
345             {
346                 if( ( *psz_value == '+' ) || ( *psz_value == '-' ) )
347                 {
348                     int i_value = atoi( psz_value );
349
350                     if( ( i_value >= -5 ) && ( i_value <= 5 ) )
351                         i_font_size += ( i_value * i_font_size ) / 10;
352                     else if( i_value < -5 )
353                         i_font_size = - i_value;
354                     else if( i_value > 5 )
355                         i_font_size = i_value;
356                 }
357                 else
358                     i_font_size = atoi( psz_value );
359             }
360             else if( !strcasecmp( "color", psz_name ) )
361             {
362                 if( psz_value[0] == '#' )
363                 {
364                     i_font_color = strtol( psz_value + 1, NULL, 16 );
365                     i_font_color &= 0x00ffffff;
366                 }
367                 else
368                 {
369                     for( int i = 0; p_html_colors[i].psz_name != NULL; i++ )
370                     {
371                         if( !strncasecmp( psz_value, p_html_colors[i].psz_name, strlen(p_html_colors[i].psz_name) ) )
372                         {
373                             i_font_color = p_html_colors[i].i_value;
374                             break;
375                         }
376                     }
377                 }
378             }
379             else if( !strcasecmp( "alpha", psz_name ) &&
380                      ( psz_value[0] == '#' ) )
381             {
382                 i_font_alpha = strtol( psz_value + 1, NULL, 16 );
383                 i_font_alpha &= 0xff;
384             }
385         }
386         free( psz_name );
387         free( psz_value );
388     }
389     rv = PushFont( p_fonts,
390                    psz_fontname,
391                    i_font_size * i_scale / 1000,
392                    (i_font_color & 0xffffff) | ((i_font_alpha & 0xff) << 24),
393                    i_karaoke_bg_color );
394
395     free( psz_fontname );
396
397     return rv;
398 }
399
400 static void SetKaraokeLen( uint32_t i_runs, uint32_t *pi_run_lengths,
401                            uint32_t i_k_runs, uint32_t *pi_k_run_lengths )
402 {
403     /* Karaoke tags _PRECEDE_ the text they specify a duration
404      * for, therefore we are working out the length for the
405      * previous tag, and first time through we have nothing
406      */
407     if( pi_k_run_lengths )
408     {
409         int i_chars = 0;
410         uint32_t i;
411
412         /* Work out how many characters are presently in the string
413          */
414         for( i = 0; i < i_runs; i++ )
415             i_chars += pi_run_lengths[ i ];
416
417         /* Subtract away those we've already allocated to other
418          * karaoke tags
419          */
420         for( i = 0; i < i_k_runs; i++ )
421             i_chars -= pi_k_run_lengths[ i ];
422
423         pi_k_run_lengths[ i_k_runs - 1 ] = i_chars;
424     }
425 }
426
427 static void SetupKaraoke( xml_reader_t *p_xml_reader, uint32_t *pi_k_runs,
428                           uint32_t **ppi_k_run_lengths,
429                           uint32_t **ppi_k_durations )
430 {
431     while ( xml_ReaderNextAttr( p_xml_reader ) == VLC_SUCCESS )
432     {
433         char *psz_name = xml_ReaderName( p_xml_reader );
434         char *psz_value = xml_ReaderValue( p_xml_reader );
435
436         if( psz_name && psz_value &&
437             !strcasecmp( "t", psz_name ) )
438         {
439             if( ppi_k_durations && ppi_k_run_lengths )
440             {
441                 (*pi_k_runs)++;
442
443                 if( *ppi_k_durations )
444                 {
445                     *ppi_k_durations = (uint32_t *)
446                         realloc( *ppi_k_durations,
447                                  *pi_k_runs * sizeof( uint32_t ) );
448                 }
449                 else if( *pi_k_runs == 1 )
450                 {
451                     *ppi_k_durations = (uint32_t *)
452                         malloc( *pi_k_runs * sizeof( uint32_t ) );
453                 }
454
455                 if( *ppi_k_run_lengths )
456                 {
457                     *ppi_k_run_lengths = (uint32_t *)
458                         realloc( *ppi_k_run_lengths,
459                                  *pi_k_runs * sizeof( uint32_t ) );
460                 }
461                 else if( *pi_k_runs == 1 )
462                 {
463                     *ppi_k_run_lengths = (uint32_t *)
464                         malloc( *pi_k_runs * sizeof( uint32_t ) );
465                 }
466                 if( *ppi_k_durations )
467                     (*ppi_k_durations)[ *pi_k_runs - 1 ] = atoi( psz_value );
468
469                 if( *ppi_k_run_lengths )
470                     (*ppi_k_run_lengths)[ *pi_k_runs - 1 ] = 0;
471             }
472         }
473         free( psz_name );
474         free( psz_value );
475     }
476 }
477
478 /* Turn any multiple-whitespaces into single spaces */
479 static void HandleWhiteSpace( char *psz_node )
480 {
481     char *s = strpbrk( psz_node, "\t\r\n " );
482     while( s )
483     {
484         int i_whitespace = strspn( s, "\t\r\n " );
485
486         if( i_whitespace > 1 )
487             memmove( &s[1],
488                      &s[i_whitespace],
489                      strlen( s ) - i_whitespace + 1 );
490         *s++ = ' ';
491
492         s = strpbrk( s, "\t\r\n " );
493     }
494 }
495
496 /* */
497 static int ProcessNodes( filter_t *p_filter,
498                          xml_reader_t *p_xml_reader,
499                          text_style_t *p_font_style,
500                          UCHAR *psz_text,
501                          int *pi_len,
502
503                          uint32_t *pi_runs,
504                          uint32_t **ppi_run_lengths,
505                          TR_FONT_STYLE_PTR **ppp_styles,
506
507                          bool b_karaoke,
508                          uint32_t *pi_k_runs,
509                          uint32_t **ppi_k_run_lengths,
510                          uint32_t **ppi_k_durations )
511 {
512     int           rv             = VLC_SUCCESS;
513     filter_sys_t *p_sys          = p_filter->p_sys;
514     UCHAR        *psz_text_orig  = psz_text;
515     font_stack_t *p_fonts        = NULL;
516     vlc_value_t   val;
517     int           i_scale        = 1000;
518
519     char *psz_node  = NULL;
520
521     bool b_italic = false;
522     bool b_bold   = false;
523     bool b_uline  = false;
524
525     if( VLC_SUCCESS == var_Get( p_filter, "scale", &val ))
526         i_scale = val.i_int;
527
528     if( p_font_style )
529     {
530         rv = PushFont( &p_fonts,
531                p_font_style->psz_fontname,
532                p_font_style->i_font_size * i_scale / 1000,
533                (p_font_style->i_font_color & 0xffffff) |
534                    ((p_font_style->i_font_alpha & 0xff) << 24),
535                (p_font_style->i_karaoke_background_color & 0xffffff) |
536                    ((p_font_style->i_karaoke_background_alpha & 0xff) << 24));
537
538         if( p_font_style->i_style_flags & STYLE_BOLD )
539             b_bold = true;
540         if( p_font_style->i_style_flags & STYLE_ITALIC )
541             b_italic = true;
542         if( p_font_style->i_style_flags & STYLE_UNDERLINE )
543             b_uline = true;
544     }
545     else
546     {
547         rv = PushFont( &p_fonts,
548                        TR_DEFAULT_FONT,
549                        p_sys->i_font_size,
550                        TR_DEFAULT_COLOR,
551                        0x00ffffff );
552     }
553     if( rv != VLC_SUCCESS )
554         return rv;
555
556     while ( ( xml_ReaderRead( p_xml_reader ) == 1 ) )
557     {
558         switch ( xml_ReaderNodeType( p_xml_reader ) )
559         {
560             case XML_READER_NONE:
561                 break;
562             case XML_READER_ENDELEM:
563                 psz_node = xml_ReaderName( p_xml_reader );
564                 if( psz_node )
565                 {
566                     if( !strcasecmp( "font", psz_node ) )
567                         PopFont( &p_fonts );
568                     else if( !strcasecmp( "b", psz_node ) )
569                         b_bold   = false;
570                     else if( !strcasecmp( "i", psz_node ) )
571                         b_italic = false;
572                     else if( !strcasecmp( "u", psz_node ) )
573                         b_uline  = false;
574
575                     free( psz_node );
576                 }
577                 break;
578             case XML_READER_STARTELEM:
579                 psz_node = xml_ReaderName( p_xml_reader );
580                 if( psz_node )
581                 {
582                     if( !strcasecmp( "font", psz_node ) )
583                         rv = HandleFontAttributes( p_xml_reader, &p_fonts, i_scale );
584                     else if( !strcasecmp( "b", psz_node ) )
585                         b_bold = true;
586                     else if( !strcasecmp( "i", psz_node ) )
587                         b_italic = true;
588                     else if( !strcasecmp( "u", psz_node ) )
589                         b_uline = true;
590                     else if( !strcasecmp( "br", psz_node ) )
591                     {
592                         SetupLine( p_filter, "\n", &psz_text,
593                                    pi_runs, ppi_run_lengths, ppp_styles,
594                                    GetStyleFromFontStack( p_sys,
595                                                           &p_fonts,
596                                                           b_bold,
597                                                           b_italic,
598                                                           b_uline ) );
599                     }
600                     else if( !strcasecmp( "k", psz_node ) )
601                     {
602                         /* Only valid in karaoke */
603                         if( b_karaoke )
604                         {
605                             if( *pi_k_runs > 0 )
606                             {
607                                 SetKaraokeLen( *pi_runs, *ppi_run_lengths,
608                                                *pi_k_runs, *ppi_k_run_lengths );
609                             }
610                             SetupKaraoke( p_xml_reader, pi_k_runs,
611                                           ppi_k_run_lengths, ppi_k_durations );
612                         }
613                     }
614
615                     free( psz_node );
616                 }
617                 break;
618             case XML_READER_TEXT:
619                 psz_node = xml_ReaderValue( p_xml_reader );
620                 if( psz_node )
621                 {
622                     /* */
623                     HandleWhiteSpace( psz_node );
624                     resolve_xml_special_chars( psz_node );
625
626                     SetupLine( p_filter, psz_node, &psz_text,
627                                pi_runs, ppi_run_lengths, ppp_styles,
628                                GetStyleFromFontStack( p_sys,
629                                                       &p_fonts,
630                                                       b_bold,
631                                                       b_italic,
632                                                       b_uline ) );
633                     free( psz_node );
634                 }
635                 break;
636         }
637         if( rv != VLC_SUCCESS )
638         {
639             psz_text = psz_text_orig;
640             break;
641         }
642     }
643     if( b_karaoke )
644     {
645         SetKaraokeLen( *pi_runs, *ppi_run_lengths,
646                        *pi_k_runs, *ppi_k_run_lengths );
647     }
648
649     *pi_len = psz_text - psz_text_orig;
650
651     while( VLC_SUCCESS == PopFont( &p_fonts ) );
652
653     return rv;
654 }