summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-05-31 11:30:36 +0300
committerEli Zaretskii <eliz@gnu.org>2019-05-31 11:30:36 +0300
commitfba3687db414306da780d1faeb13fe947d2e6da6 (patch)
tree5518fa631be611f8534bc67ed0a9140788a39650 /configure.ac
parentb40dde705af4d53853de6185a2468153b442dc9a (diff)
downloademacs-fba3687db414306da780d1faeb13fe947d2e6da6.tar.gz
Add HarfBuzz font backend for MS-Windows
* src/w32uniscribe.c [HAVE_HARFBUZZ]: Include math.h and hb.h. (bswap_32): Define for GCC 4.3.0 and later; else include <byteswap.h> from Gnulib. (struct uniscribe_font_info): Extend for HarfBuzz; 'cache' is now a 'void *' (all users changed). [HAVE_HARFBUZZ]: Define typedefs for HarfBuzz functions to be loaded dynamically from the HarfBuzz DLL. Define macros to call those functions via function pointers. (uniscribe_open) [HAVE_HARFBUZZ]: Use the HarfBuzz font driver if the type of the font entity is 'harfbuzz'. (uniscribe_close) [HAVE_HARFBUZZ]: For fonts using the HarfBuzz backend, call hb_font_destroy to free memory used for the cached hb_font data. (uniscribe_shape): Fix assignment of character codepoints to glyphs from a single cluster. (w32hb_list, w32hb_match, free_cb, w32hb_get_font_table) (w32hb_get_font, w32hb_encode_char, w32hb_begin_font) (w32uni_combining, w32uni_general, w32uni_mirroring) (get_hb_unicode_funcs, w32hb_shape) (w32hb_combining_capability, load_harfbuzz_funcs) [HAVE_HARFBUZZ]: New functions. (syms_of_w32uniscribe_for_pdumper) [HAVE_HARFBUZZ]: Load the HarfBuzz DLL and register the HarfBuzz backend with its functions. * src/w32font.c (syms_of_w32font) <Qharfbuzz>: New DEFSYM. * src/w32fns.c (Fx_create_frame, w32_create_tip_frame) [HAVE_HARFBUZZ]: Register the harfbuzz font backend. * src/lisp.h (get_unicode_property): Declare prototype. * src/font.h (harfbuzz_font_driver) [HAVE_NTGUI]: Declare. * src/chartab.c (get_unicode_property): New function, body taken from get-unicode-property-internal. (Fget_unicode_property_internal): Call get_unicode_property after validating input. * doc/lispref/frames.texi (Font and Color Parameters): * doc/emacs/msdos.texi (Windows Fonts): Document support for HarfBuzz text shaping on MS-Windows. * configure.ac (HAVE_HARFBUZZ): Move out of the X-specific part, and consider HarfBuzz also for HAVE_W32 systems. Require HarfBuzz v1.2.3 for w32.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac94
1 files changed, 54 insertions, 40 deletions
diff --git a/configure.ac b/configure.ac
index e9001fd1b7a..ab6b03f5462 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3409,56 +3409,70 @@ if test "${HAVE_X11}" = "yes"; then
fi
fi # $HAVE_CAIRO != yes
- HAVE_HARFBUZZ=no
- HAVE_LIBOTF=no
- if test "${HAVE_FREETYPE}" = "yes"; then
- AC_DEFINE(HAVE_FREETYPE, 1,
- [Define to 1 if using the freetype and fontconfig libraries.])
- if test "${with_harfbuzz}" != "no"; then
- EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 0.9.42])
- if test "$HAVE_HARFBUZZ" = "yes"; then
- AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.])
+ HAVE_LIBOTF=no
+ if test "${HAVE_FREETYPE}" = "yes"; then
+ AC_DEFINE(HAVE_FREETYPE, 1,
+ [Define to 1 if using the freetype and fontconfig libraries.])
+ if test "${with_libotf}" != "no"; then
+ EMACS_CHECK_MODULES([LIBOTF], [libotf])
+ if test "$HAVE_LIBOTF" = "yes"; then
+ AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
+ AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
+ HAVE_OTF_GET_VARIATION_GLYPHS=yes,
+ HAVE_OTF_GET_VARIATION_GLYPHS=no)
+ if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
+ AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1,
+ [Define to 1 if libotf has OTF_get_variation_glyphs.])
fi
- fi
- if test "${with_libotf}" != "no"; then
- EMACS_CHECK_MODULES([LIBOTF], [libotf])
- if test "$HAVE_LIBOTF" = "yes"; then
- AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
- AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
- HAVE_OTF_GET_VARIATION_GLYPHS=yes,
- HAVE_OTF_GET_VARIATION_GLYPHS=no)
- if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
- AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1,
- [Define to 1 if libotf has OTF_get_variation_glyphs.])
- fi
- if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then
- AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1,
+ if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then
+ AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1,
[Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.])
- fi
fi
fi
- dnl FIXME should there be an error if HAVE_FREETYPE != yes?
- dnl Does the new font backend require it, or can it work without it?
fi
+ dnl FIXME should there be an error if HAVE_FREETYPE != yes?
+ dnl Does the new font backend require it, or can it work without it?
+ fi
- HAVE_M17N_FLT=no
- if test "${HAVE_LIBOTF}" = yes; then
- if test "${with_m17n_flt}" != "no"; then
- EMACS_CHECK_MODULES([M17N_FLT], [m17n-flt])
- if test "$HAVE_M17N_FLT" = "yes"; then
- AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.])
- fi
+ HAVE_M17N_FLT=no
+ if test "${HAVE_LIBOTF}" = yes; then
+ if test "${with_m17n_flt}" != "no"; then
+ EMACS_CHECK_MODULES([M17N_FLT], [m17n-flt])
+ if test "$HAVE_M17N_FLT" = "yes"; then
+ AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.])
fi
fi
-else
- HAVE_XFT=no
- HAVE_FREETYPE=no
- HAVE_HARFBUZZ=no
- HAVE_LIBOTF=no
- HAVE_M17N_FLT=no
+ fi
+else # "${HAVE_X11}" != "yes"
+ HAVE_XFT=no
+ HAVE_FREETYPE=no
+ HAVE_LIBOTF=no
+ HAVE_M17N_FLT=no
+fi # "${HAVE_X11}" != "yes"
+
+HAVE_HARFBUZZ=no
+if test "${HAVE_X11}" = "yes" && test "${HAVE_FREETYPE}" = "yes" \
+ || test "${HAVE_W32}" = "yes"; then
+ if test "${with_harfbuzz}" != "no"; then
+ ### On MS-Windows we use hb_font_get_nominal_glyph, which appeared
+ ### in HarfBuzz version 1.2.3
+ if test "${HAVE_W32}" = "yes"; then
+ EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 1.2.3])
+ else
+ EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 0.9.42])
+ fi
+ if test "$HAVE_HARFBUZZ" = "yes"; then
+ AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.])
+ ### mingw32 and Cygwin-w32 don't use -lharfbuzz, since they load
+ ### the library dynamically.
+ if test "${HAVE_W32}" = "yes"; then
+ HARFBUZZ_LIBS=
+ fi
+ fi
+ fi
fi
-### End of font-backend (under X11) section.
+### End of font-backend section.
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)