vlc | branch: master | Jean-Baptiste Kempf <[email protected]> | Tue Jul 28 16:27:25 2015 +0200| [e8ee1c23b9c3bb189f1bddbc7d32b602fc084beb] | committer: Jean-Baptiste Kempf
Freetype: Remove text_renderer.* > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e8ee1c23b9c3bb189f1bddbc7d32b602fc084beb --- modules/text_renderer/Makefile.am | 2 +- modules/text_renderer/freetype.c | 14 ++++++- modules/text_renderer/freetype.h | 23 +++++++++++ modules/text_renderer/text_layout.c | 1 - modules/text_renderer/text_layout.h | 2 + modules/text_renderer/text_renderer.c | 72 --------------------------------- modules/text_renderer/text_renderer.h | 48 ---------------------- 7 files changed, 39 insertions(+), 123 deletions(-) diff --git a/modules/text_renderer/Makefile.am b/modules/text_renderer/Makefile.am index 92ee067..d41bc6d 100644 --- a/modules/text_renderer/Makefile.am +++ b/modules/text_renderer/Makefile.am @@ -4,10 +4,10 @@ libtdummy_plugin_la_SOURCES = text_renderer/tdummy.c text_LTLIBRARIES = libtdummy_plugin.la libfreetype_plugin_la_SOURCES = \ - text_renderer/text_renderer.c text_renderer/text_renderer.h \ text_renderer/platform_fonts.c text_renderer/platform_fonts.h \ text_renderer/freetype.c text_renderer/freetype.h \ text_renderer/text_layout.c text_renderer/text_layout.h + libfreetype_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS) libfreetype_plugin_la_LIBADD = $(LIBM) $(FREETYPE_LIBS) if HAVE_FREETYPE diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c index e22c8a8..6b24586 100644 --- a/modules/text_renderer/freetype.c +++ b/modules/text_renderer/freetype.c @@ -72,7 +72,6 @@ #include <assert.h> -#include "text_renderer.h" #include "platform_fonts.h" #include "freetype.h" #include "text_layout.h" @@ -1343,6 +1342,19 @@ static void Destroy( vlc_object_t *p_this ) free( p_sys ); } +bool FaceStyleEquals( const text_style_t *p_style1, + const text_style_t *p_style2 ) +{ + if( !p_style1 || !p_style2 ) + return false; + if( p_style1 == p_style2 ) + return true; + + const int i_style_mask = STYLE_BOLD | STYLE_ITALIC; + return (p_style1->i_style_flags & i_style_mask) == (p_style2->i_style_flags & i_style_mask) && + !strcmp( p_style1->psz_fontname, p_style2->psz_fontname ); +} + FT_Face LoadFace( filter_t *p_filter, const text_style_t *p_style ) { diff --git a/modules/text_renderer/freetype.h b/modules/text_renderer/freetype.h index 421bc81..8ed6ab5 100644 --- a/modules/text_renderer/freetype.h +++ b/modules/text_renderer/freetype.h @@ -25,6 +25,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#ifndef VLC_FREETYPE_H +#define VLC_FREETYPE_H + +#include <vlc_text_style.h> /* text_style_t*/ + typedef struct faces_cache_t { FT_Face *p_faces; @@ -71,4 +76,22 @@ struct filter_sys_t #define FT_MulFix(v, s) (((v)*(s))>>16) #endif +#ifdef __OS2__ +typedef uint16_t uni_char_t; +# define FREETYPE_TO_UCS "UCS-2LE" +#else +typedef uint32_t uni_char_t; +# if defined(WORDS_BIGENDIAN) +# define FREETYPE_TO_UCS "UCS-4BE" +# else +# define FREETYPE_TO_UCS "UCS-4LE" +# endif +#endif + + FT_Face LoadFace( filter_t *p_filter, const text_style_t *p_style ); + +bool FaceStyleEquals( const text_style_t *p_style1, + const text_style_t *p_style2 ); + +#endif diff --git a/modules/text_renderer/text_layout.c b/modules/text_renderer/text_layout.c index a639fbc..e684354 100644 --- a/modules/text_renderer/text_layout.c +++ b/modules/text_renderer/text_layout.c @@ -56,7 +56,6 @@ # include <hb-ft.h> #endif -#include "text_renderer.h" #include "text_layout.h" #include "freetype.h" diff --git a/modules/text_renderer/text_layout.h b/modules/text_renderer/text_layout.h index d2a116a..50163be 100644 --- a/modules/text_renderer/text_layout.h +++ b/modules/text_renderer/text_layout.h @@ -25,6 +25,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#include "freetype.h" + typedef struct { FT_BitmapGlyph p_glyph; diff --git a/modules/text_renderer/text_renderer.c b/modules/text_renderer/text_renderer.c deleted file mode 100644 index ad53fae..0000000 --- a/modules/text_renderer/text_renderer.c +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** - * freetype.c : Put text on the video, using freetype2 - ***************************************************************************** - * Copyright (C) 2002 - 2012 VLC authors and VideoLAN - * $Id$ - * - * Authors: Sigmund Augdal Helberg <[email protected]> - * Gildas Bazin <[email protected]> - * Bernie Purcell <[email protected]> - * Jean-Baptiste Kempf <[email protected]> - * Felix Paul Kühne <[email protected]> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <errno.h> -#include <vlc_common.h> -#include <vlc_variables.h> -#include <vlc_filter.h> /* filter_sys_t */ -#include <vlc_xml.h> /* xml_reader */ -#include <vlc_charset.h> /* ToCharset */ -#include <vlc_strings.h> /* resolve_xml_special_chars */ - -#include "text_renderer.h" - -text_style_t *CreateStyle( char *psz_fontname, int i_font_size, - uint32_t i_font_color, uint32_t i_karaoke_bg_color, - int i_style_flags ) -{ - text_style_t *p_style = text_style_New(); - if( !p_style ) - return NULL; - - p_style->psz_fontname = psz_fontname ? strdup( psz_fontname ) : NULL; - p_style->i_font_size = i_font_size; - p_style->i_font_color = (i_font_color & 0x00ffffff) >> 0; - p_style->i_font_alpha = (i_font_color & 0xff000000) >> 24; - p_style->i_karaoke_background_color = (i_karaoke_bg_color & 0x00ffffff) >> 0; - p_style->i_karaoke_background_alpha = (i_karaoke_bg_color & 0xff000000) >> 24; - p_style->i_style_flags |= i_style_flags; - return p_style; -} - -bool FaceStyleEquals( const text_style_t *p_style1, - const text_style_t *p_style2 ) -{ - if( !p_style1 || !p_style2 ) - return false; - if( p_style1 == p_style2 ) - return true; - - const int i_style_mask = STYLE_BOLD | STYLE_ITALIC; - return (p_style1->i_style_flags & i_style_mask) == (p_style2->i_style_flags & i_style_mask) && - !strcmp( p_style1->psz_fontname, p_style2->psz_fontname ); -} - diff --git a/modules/text_renderer/text_renderer.h b/modules/text_renderer/text_renderer.h deleted file mode 100644 index 0f50eb3..0000000 --- a/modules/text_renderer/text_renderer.h +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - * text_renderer.h : fonts, text styles helpers - ***************************************************************************** - * Copyright (C) 2002 - 2013 VLC authors and VideoLAN - * $Id$ - * - * Authors: Sigmund Augdal Helberg <[email protected]> - * Gildas Bazin <[email protected]> - * Bernie Purcell <[email protected]> - * Jean-Baptiste Kempf <[email protected]> - * Felix Paul Kühne <[email protected]> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, Inc., - * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ - -#include <vlc_text_style.h> /* text_style_t*/ - -/* text_style_t functions */ -text_style_t *CreateStyle( char *psz_fontname, int i_font_size, - uint32_t i_font_color, uint32_t i_karaoke_bg_color, - int i_style_flags ); - -#ifdef __OS2__ -typedef uint16_t uni_char_t; -# define FREETYPE_TO_UCS "UCS-2LE" -#else -typedef uint32_t uni_char_t; -# if defined(WORDS_BIGENDIAN) -# define FREETYPE_TO_UCS "UCS-4BE" -# else -# define FREETYPE_TO_UCS "UCS-4LE" -# endif -#endif - -bool FaceStyleEquals( const text_style_t *p_style1, - const text_style_t *p_style2 ); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
