configure.ac | 108 +++++++++++++++++++++++++++++-------------------------- src/hb-icu-le.cc | 33 ++++++++++++++-- 2 files changed, 86 insertions(+), 55 deletions(-)
New commits: commit 58db2c2542717858acbdf480b3f19a8aef4918cd Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 19:10:33 2013 -0400 Disable UCDN if glib is available We only want UCDN if we don't have any other Unicode provider. I'm going to remove ICU from the list of default Unicode providers as part of moving hb-icu into its own library. As such, the only providers will be UCDN and glib. diff --git a/configure.ac b/configure.ac index 9ac0af5..2371537 100644 --- a/configure.ac +++ b/configure.ac @@ -145,6 +145,9 @@ AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) dnl =========================================================================== have_ucdn=true +if $have_glib; then + have_ucdn=false +fi if $have_ucdn; then AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions]) fi commit ca65326cbd49b48792c4e3125af6c5006364f194 Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 19:09:50 2013 -0400 Minor diff --git a/configure.ac b/configure.ac index f147435..9ac0af5 100644 --- a/configure.ac +++ b/configure.ac @@ -128,14 +128,6 @@ AM_CONDITIONAL(HAVE_HB_OLD, $have_hb_old) dnl =========================================================================== -have_ucdn=true -if $have_ucdn; then - AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions]) -fi -AM_CONDITIONAL(HAVE_UCDN, $have_ucdn) - -dnl =========================================================================== - PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false) if $have_glib; then AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library]) @@ -150,6 +142,14 @@ if $have_gobject; then fi AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) +dnl =========================================================================== + +have_ucdn=true +if $have_ucdn; then + AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions]) +fi +AM_CONDITIONAL(HAVE_UCDN, $have_ucdn) + dnl ========================================================================== PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false) commit 7ae14973ecb4614a83769d2bbd01f33d8474ffc0 Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 19:06:50 2013 -0400 Disable icu_le shaper Will add a way to enable it later. diff --git a/configure.ac b/configure.ac index b428c13..f147435 100644 --- a/configure.ac +++ b/configure.ac @@ -204,7 +204,8 @@ AM_CONDITIONAL(HAVE_ICU, $have_icu) dnl ========================================================================== -PKG_CHECK_MODULES(ICU_LE, icu-le icu-uc, have_icu_le=true, have_icu_le=false) +have_icu_le=false +dnl PKG_CHECK_MODULES(ICU_LE, icu-le icu-uc, have_icu_le=true) if $have_icu_le; then AC_DEFINE(HAVE_ICU_LE, 1, [Have ICU Layout Engine library]) fi commit 7e6ebf76236cc5ea69302e68186bdf8166d04a98 Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 19:05:23 2013 -0400 Remove icu-config fallback for icu_le shaper Bug 64878 - compile error with ICU but not ICU diff --git a/configure.ac b/configure.ac index c995f36..b428c13 100644 --- a/configure.ac +++ b/configure.ac @@ -205,24 +205,6 @@ AM_CONDITIONAL(HAVE_ICU, $have_icu) dnl ========================================================================== PKG_CHECK_MODULES(ICU_LE, icu-le icu-uc, have_icu_le=true, have_icu_le=false) -dnl Fallback to icu-config if ICU pkg-config files could not be found -if test "$have_icu_le" != "true"; then - AC_CHECK_TOOL(ICU_CONFIG, icu-config, no) - AC_MSG_CHECKING([for ICU_LE by using icu-config fallback]) - if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then - have_icu_le=true - # We don't use --cflags as this gives us a lot of things that we don't - # necessarily want, like debugging and optimization flags - # See man (1) icu-config for more info. - ICU_LE_CFLAGS=`$ICU_CONFIG --cppflags` - ICU_LE_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly --ldflags-layout` - AC_SUBST(ICU_LE_CFLAGS) - AC_SUBST(ICU_LE_LIBS) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi -fi if $have_icu_le; then AC_DEFINE(HAVE_ICU_LE, 1, [Have ICU Layout Engine library]) fi commit 932b7471479c639244051b4dbae678e7d47ae99f Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 19:04:40 2013 -0400 Bug 65053 - Add configure option to enable/disable ICU support diff --git a/configure.ac b/configure.ac index bcb0e52..c995f36 100644 --- a/configure.ac +++ b/configure.ac @@ -166,26 +166,36 @@ AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) dnl ========================================================================== -PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false) -dnl Fallback to icu-config if ICU pkg-config files could not be found -if test "$have_icu" != "true"; then - AC_CHECK_TOOL(ICU_CONFIG, icu-config, no) - AC_MSG_CHECKING([for ICU by using icu-config fallback]) - if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then - have_icu=true - # We don't use --cflags as this gives us a lot of things that we don't - # necessarily want, like debugging and optimization flags - # See man (1) icu-config for more info. - ICU_CFLAGS=`$ICU_CONFIG --cppflags` - ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly` - AC_SUBST(ICU_CFLAGS) - AC_SUBST(ICU_LIBS) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) +AC_ARG_WITH(icu, + [AS_HELP_STRING([--with-icu=@<:@yes/no/auto@:>@], + [Use ICU @<:@default=auto@:>@])],, + [with_icu=auto]) +have_icu=false +if test "x$with_icu" = "xyes" -o "x$with_icu" = "xauto"; then + PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false) + + dnl Fallback to icu-config if ICU pkg-config files could not be found + if test "$have_icu" != "true"; then + AC_CHECK_TOOL(ICU_CONFIG, icu-config, no) + AC_MSG_CHECKING([for ICU by using icu-config fallback]) + if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then + have_icu=true + # We don't use --cflags as this gives us a lot of things that we don't + # necessarily want, like debugging and optimization flags + # See man (1) icu-config for more info. + ICU_CFLAGS=`$ICU_CONFIG --cppflags` + ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly` + AC_SUBST(ICU_CFLAGS) + AC_SUBST(ICU_LIBS) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi fi fi - +if test "x$with_icu" = "xyes" -a "x$have_icu" != "xtrue"; then + AC_MSG_ERROR([icu support requested but icu-uc not found]) +fi if $have_icu; then CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) commit cf2c1c7eb81b54a344ed5cf36d5fbd3cd297eed1 Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 18:54:30 2013 -0400 Disable hb-old shaper Will add proper way to enable it later. diff --git a/configure.ac b/configure.ac index b454519..bcb0e52 100644 --- a/configure.ac +++ b/configure.ac @@ -120,7 +120,7 @@ AM_CONDITIONAL(HAVE_OT, $have_ot) dnl =========================================================================== -have_hb_old=true +have_hb_old=false if $have_hb_old; then AC_DEFINE(HAVE_HB_OLD, 1, [Have Old HarfBuzz backend]) fi commit 5a78d23f255a649353044af8e5df315f62907b7f Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 18:47:58 2013 -0400 Bug 65054 - Add configure option to enable/disable Graphite2 Add --with-graphite2. Defaults to off. diff --git a/configure.ac b/configure.ac index 16f9d28..b454519 100644 --- a/configure.ac +++ b/configure.ac @@ -220,11 +220,21 @@ AM_CONDITIONAL(HAVE_ICU_LE, $have_icu_le) dnl ========================================================================== -PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite=true, have_graphite=false) -if $have_graphite; then - AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite library]) +AC_ARG_WITH(graphite2, + [AS_HELP_STRING([--with-graphite2=@<:@yes/no/auto@:>@], + [Use the graphite2 library @<:@default=no@:>@])],, + [with_graphite2=no]) +have_graphite2=false +if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then + PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite2=true) fi -AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite) +if test "x$with_graphite2" = "xyes" -a "x$have_graphite2" != "xtrue"; then + AC_MSG_ERROR([graphite2 support requested but libgraphite2 not found]) +fi +if $have_graphite2; then + AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite2 library]) +fi +AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite2) dnl ========================================================================== @@ -350,7 +360,7 @@ Tools used for command-line utilities: Cairo: ${have_cairo} Additional shapers (the more the better): - Graphite2: ${have_graphite} + Graphite2: ${have_graphite2} Test / platform shapers (not normally needed): CoreText: ${have_coretext} commit 61e7775fa75c7c1bdc29a6992c8c215897364600 Author: Behdad Esfahbod <[email protected]> Date: Mon May 27 18:24:56 2013 -0400 Remove hb-icu dependency from hb-icu-le shaper diff --git a/src/hb-icu-le.cc b/src/hb-icu-le.cc index 114b427..634354e 100644 --- a/src/hb-icu-le.cc +++ b/src/hb-icu-le.cc @@ -30,10 +30,35 @@ #include "hb-icu-le/PortableFontInstance.h" -#include "layout/loengine.h" -#include "unicode/unistr.h" +#include <layout/LEScripts.h> +#include <layout/loengine.h> +#include <unicode/uscript.h> +#include <unicode/unistr.h> -#include "hb-icu.h" + +/* Duplicated here so we don't depend on hb-icu. */ + +static hb_script_t +_hb_icu_script_to_script (UScriptCode script) +{ + if (unlikely (script == USCRIPT_INVALID_CODE)) + return HB_SCRIPT_INVALID; + + return hb_script_from_string (uscript_getShortName (script), -1); +} + +static UScriptCode +_hb_icu_script_from_script (hb_script_t script) +{ + if (unlikely (script == HB_SCRIPT_INVALID)) + return USCRIPT_INVALID_CODE; + + for (unsigned int i = 0; i < USCRIPT_CODE_LIMIT; i++) + if (unlikely (_hb_icu_script_to_script ((UScriptCode) i) == script)) + return (UScriptCode) i; + + return USCRIPT_UNKNOWN; +} /* @@ -117,7 +142,7 @@ _hb_icu_le_shape (hb_shape_plan_t *shape_plan, unsigned int num_features) { LEFontInstance *font_instance = HB_SHAPER_DATA_GET (font); - le_int32 script_code = hb_icu_script_from_script (shape_plan->props.script); + le_int32 script_code = _hb_icu_script_from_script (shape_plan->props.script); le_int32 language_code = -1 /* TODO */; le_int32 typography_flags = 3; /* Needed for ligatures and kerning */ LEErrorCode status = LE_NO_ERROR; _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
