[vlc-commits] Freetype: clean includes
Jean-Baptiste Kempf
git at videolan.org
Sun Mar 27 18:03:52 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 27 18:02:53 2011 +0200| [1a779ce3d7d227f34d7d3dcfd5bf3aa4bb4dd6c6] | committer: Jean-Baptiste Kempf
Freetype: clean includes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a779ce3d7d227f34d7d3dcfd5bf3aa4bb4dd6c6
---
modules/misc/text_renderer/freetype.c | 71 +++++++++++++---------------
modules/misc/text_renderer/text_renderer.h | 8 ++-
2 files changed, 38 insertions(+), 41 deletions(-)
diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index 2ce1380..fac4a01 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -1,7 +1,7 @@
/*****************************************************************************
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
- * Copyright (C) 2002 - 2007 the VideoLAN team
+ * Copyright (C) 2002 - 2011 the VideoLAN team
* $Id$
*
* Authors: Sigmund Augdal Helberg <dnumgis at videolan.org>
@@ -19,8 +19,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
@@ -33,18 +33,29 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_filter.h>
-#include <vlc_stream.h>
-#include <vlc_xml.h>
-#include <vlc_input.h>
-#include <vlc_strings.h>
-#include <vlc_dialog.h>
-#include <vlc_memory.h>
-#include <vlc_charset.h>
-
-#include <math.h>
-
-#include <ft2build.h>
+#include <vlc_stream.h> /* stream_MemoryNew */
+#include <vlc_input.h> /* vlc_input_attachment_* */
+#include <vlc_xml.h> /* xml_reader */
+#include <vlc_strings.h> /* resolve_xml_special_chars */
+#include <vlc_charset.h> /* ToCharset */
+#include <vlc_dialog.h> /* FcCache dialog */
+
+/* Default fonts */
+#ifdef __APPLE__
+# define DEFAULT_FONT "/Library/Fonts/Arial Black.ttf"
+# define FC_DEFAULT_FONT "Arial Black"
+#elif defined( WIN32 )
+# define DEFAULT_FONT "" /* Default font found at run-time */
+# define FC_DEFAULT_FONT "Arial"
+#elif defined( HAVE_MAEMO )
+# define DEFAULT_FONT "/usr/share/fonts/nokia/nosnb.ttf"
+# define FC_DEFAULT_FONT "Nokia Sans Bold"
+#else
+# define DEFAULT_FONT "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
+# define FC_DEFAULT_FONT "Serif Bold"
+#endif
+
+/* Freetype */
#include <freetype/ftsynth.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
@@ -54,31 +65,16 @@
#define FT_MulFix(v, s) (((v)*(s))>>16)
#endif
-#ifdef __APPLE__
-#define DEFAULT_FONT "/Library/Fonts/Arial Black.ttf"
-#define FC_DEFAULT_FONT "Arial Black"
-#elif defined( WIN32 )
-#define DEFAULT_FONT "" /* Default font found at run-time */
-#define FC_DEFAULT_FONT "Arial"
-#elif defined( HAVE_MAEMO )
-#define DEFAULT_FONT "/usr/share/fonts/nokia/nosnb.ttf"
-#define FC_DEFAULT_FONT "Nokia Sans Bold"
-#else
-#define DEFAULT_FONT "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
-#define FC_DEFAULT_FONT "Serif Bold"
-#endif
-
+/* RTL */
#if defined(HAVE_FRIBIDI)
-#include <fribidi/fribidi.h>
-#endif
-
-#ifdef HAVE_FONTCONFIG
-#include <fontconfig/fontconfig.h>
-#undef DEFAULT_FONT
-#define DEFAULT_FONT FC_DEFAULT_FONT
+# include <fribidi/fribidi.h>
#endif
+/* FontConfig */
#ifdef HAVE_FONTCONFIG
+# include <fontconfig/fontconfig.h>
+# undef DEFAULT_FONT
+# define DEFAULT_FONT FC_DEFAULT_FONT
# define HAVE_STYLES
#endif
@@ -159,7 +155,7 @@ vlc_module_begin ()
/* opacity valid on 0..255, with default 255 = fully opaque */
add_integer_with_range( "freetype-opacity", 255, 0, 255, NULL,
- OPACITY_TEXT, OPACITY_LONGTEXT, true )
+ OPACITY_TEXT, OPACITY_LONGTEXT, false )
change_safe()
/* hook to the color values list, with default 0x00ffffff = white */
@@ -186,7 +182,6 @@ vlc_module_begin ()
vlc_module_end ()
-
/*****************************************************************************
* Local prototypes
*****************************************************************************/
diff --git a/modules/misc/text_renderer/text_renderer.h b/modules/misc/text_renderer/text_renderer.h
index 8913ae4..8815902 100644
--- a/modules/misc/text_renderer/text_renderer.h
+++ b/modules/misc/text_renderer/text_renderer.h
@@ -18,11 +18,13 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <vlc_memory.h>
+#include <vlc_memory.h> /* realloc_or_free */
+#include <vlc_text_style.h> /* text_style_t*/
+#include <vlc_filter.h> /* filter_sys_t */
typedef struct font_stack_t font_stack_t;
struct font_stack_t
More information about the vlc-commits
mailing list