[vlc-devel] [PATCH 1/9] freetype: update configure.ac and Makefile.am to use HarfBuzz

Salah-Eddin Shaban salshaaban at gmail.com
Sat Apr 18 19:56:13 CEST 2015


---
 configure.ac                      | 17 ++++++++++++++++-
 modules/text_renderer/Makefile.am |  7 ++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0d7e48a..27709bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3101,6 +3101,8 @@ AC_ARG_ENABLE(freetype,
   [  --enable-freetype       freetype support   (default auto)])
 AC_ARG_ENABLE(fribidi,
   [  --enable-fribidi        fribidi support    (default auto)])
+AC_ARG_ENABLE(harfbuzz,
+  [  --enable-harfbuzz       harfbuzz support   (default auto)])
 AC_ARG_ENABLE(fontconfig,
   [  --enable-fontconfig     fontconfig support (default auto)])
 
@@ -3129,6 +3131,7 @@ AC_ARG_WITH([default-monospace-font-family],
 have_freetype="no"
 have_fontconfig="no"
 have_fribidi="no"
+have_harfbuzz="no"
 
 if test "${enable_freetype}" != "no"; then
    PKG_CHECK_MODULES(FREETYPE, freetype2, [
@@ -3151,7 +3154,18 @@ if test "${enable_freetype}" != "no"; then
           have_fribidi="yes"
           VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
           VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
-        ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional support will be disabled in FreeType.])])
+        ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
+      fi
+
+      dnl harfbuzz support
+      if test "${have_fribidi}" != "no"; then
+        if test "${enable_harfbuzz}" != "no"; then
+          PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
+            have_harfbuzz="yes"
+            VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
+            VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
+          ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
+        fi
       fi
   ],[
   AS_IF([test -n "${enable_freetype}"],[
@@ -3163,6 +3177,7 @@ fi
 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
+AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
 
 
 dnl
diff --git a/modules/text_renderer/Makefile.am b/modules/text_renderer/Makefile.am
index f75be77..92ee067 100644
--- a/modules/text_renderer/Makefile.am
+++ b/modules/text_renderer/Makefile.am
@@ -6,7 +6,8 @@ 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.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
@@ -20,6 +21,10 @@ if HAVE_FRIBIDI
 libfreetype_plugin_la_CPPFLAGS += $(FRIBIDI_CFLAGS) -DHAVE_FRIBIDI
 libfreetype_plugin_la_LIBADD += $(FRIBIDI_LIBS)
 endif
+if HAVE_HARFBUZZ
+libfreetype_plugin_la_CPPFLAGS += $(HARFBUZZ_CFLAGS) -DHAVE_HARFBUZZ
+libfreetype_plugin_la_LIBADD += $(HARFBUZZ_LIBS)
+endif
 libfreetype_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(FREETYPE_LDFLAGS) -rpath '$(textdir)'
 if HAVE_DARWIN
 libfreetype_plugin_la_LDFLAGS += -Wl,-framework,Carbon
-- 
1.9.1




More information about the vlc-devel mailing list