[vlc-devel] [PATCH 08/11] Add support for monospace font in HTML renderer

Rafaël Carré funman at videolan.org
Mon Dec 31 14:04:50 CET 2012


Le 27/12/2012 07:08, Devin Heitmueller a écrit :
> The EIA-608 decoder expects fonts to be rendered with a monospace font,
> so add the ability for decoders to make use of the "tt" tag, and tweak
> the EIA-608 decoder to use that tag.
> ---
>  modules/codec/cc.c               |    5 +++
>  modules/text_renderer/freetype.c |   64 +++++++++++++++++++++++++++++++++++++-
>  2 files changed, 68 insertions(+), 1 deletion(-)
> 

> diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
> index 6cd93af..c9b8025 100644
> --- a/modules/text_renderer/freetype.c
> +++ b/modules/text_renderer/freetype.c
> @@ -64,6 +64,8 @@
>  #else
>  # define DEFAULT_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
>  # define DEFAULT_FAMILY "Serif Bold"
> +# define DEFAULT_MONOSPACE_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeMono.ttf"
> +# define DEFAULT_MONOSPACE_FAMILY "Monospace"
>  #endif

We need a monospace font on all the other OS mentioned in this ifdef,
else freetype will not build anymore:

- OSX
- Windows
- OS/2
- Maemo
- Android

Hopefully people who are knowledgeable for an OS can suggest one?
For OS/2 we should write to KO Myung-Hun directly

>  
>  /* Freetype */
> @@ -126,6 +128,7 @@ static int  Create ( vlc_object_t * );
>  static void Destroy( vlc_object_t * );
>  
>  #define FONT_TEXT N_("Font")
> +#define MONOSPACE_FONT_TEXT N_("Monospace Font")
>  
>  #define FAMILY_LONGTEXT N_("Font family for the font you want to use")
>  #define FONT_LONGTEXT N_("Font file for the font you want to use")
> @@ -195,8 +198,10 @@ vlc_module_begin ()
>  
>  #ifdef HAVE_STYLES
>      add_font( "freetype-font", DEFAULT_FAMILY, FONT_TEXT, FAMILY_LONGTEXT, false )
> +    add_font( "freetype-monofont", DEFAULT_MONOSPACE_FAMILY, MONOSPACE_FONT_TEXT, FAMILY_LONGTEXT, false )
>  #else
>      add_loadfile( "freetype-font", DEFAULT_FONT_FILE, FONT_TEXT, FONT_LONGTEXT, false )
> +    add_loadfile( "freetype-monofont", DEFAULT_MONOSPACE_FONT_FILE, MONOSPACE_FONT_TEXT, FONT_LONGTEXT, false )
>  #endif



More information about the vlc-devel mailing list