Skip to content

Commit

Permalink
freetype: use HarfBuzz for text shaping
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
salshaaban authored and jbkempf committed May 1, 2015
1 parent 063cba9 commit 57cb3e5
Show file tree
Hide file tree
Showing 6 changed files with 1,559 additions and 749 deletions.
17 changes: 16 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,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)])

Expand Down Expand Up @@ -3130,6 +3132,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, [
Expand All @@ -3152,7 +3155,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}"],[
Expand All @@ -3164,6 +3178,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
Expand Down
7 changes: 6 additions & 1 deletion modules/text_renderer/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 57cb3e5

Please sign in to comment.