diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2018-06-20 18:13:44 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2018-06-26 16:40:18 +0800 |
commit | eebf151f2a0277c12210c0cf73ecc1963cee847d (patch) | |
tree | 5bb2e01dc0bed48390c4a039adde3a787e5d18b8 | |
parent | e8d38994611df4b44c7418279833a8f5ab0d1daa (diff) | |
download | gtk+-eebf151f2a0277c12210c0cf73ecc1963cee847d.tar.gz |
gtk/: Fix build without PangoFT2 and HarfBuzz
On Windows HarfBuzz and PangoFT2 are optional, so we need to ensure that
we only build the bits that require HarfBuzz and PangoFT2 when needed.
We may need to see later whether we can get the needed functionality in
gtkfontchooserwidget.c with the Windows APIs without the need of
HarfBuzz nor PangoFT2 (and starting programs on Windows using FontConfig
is very slow).
-rw-r--r-- | gtk/gtkfontchooserwidget.c | 2 | ||||
-rw-r--r-- | gtk/language-names.c | 3 | ||||
-rw-r--r-- | gtk/script-names.c | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index b34f28fcda..b858d92c29 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -862,7 +862,9 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser) /* Load data and set initial style-dependent parameters */ gtk_font_chooser_widget_load_fonts (fontchooser, TRUE); +#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT) gtk_font_chooser_widget_populate_features (fontchooser); +#endif gtk_font_chooser_widget_set_cell_size (fontchooser); gtk_font_chooser_widget_take_font_desc (fontchooser, NULL); } diff --git a/gtk/language-names.c b/gtk/language-names.c index 6fa6eaa2f2..571dc67c0d 100644 --- a/gtk/language-names.c +++ b/gtk/language-names.c @@ -15,6 +15,8 @@ #include <glib.h> #include <glib/gi18n.h> #include <glib/gstdio.h> + +#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT) #include <hb-ot.h> #include "language-names.h" @@ -237,3 +239,4 @@ get_language_name_for_tag (guint32 tag) return get_language_name (pango_language_from_string (s)); } +#endif diff --git a/gtk/script-names.c b/gtk/script-names.c index 216fd40f5a..394c888aaf 100644 --- a/gtk/script-names.c +++ b/gtk/script-names.c @@ -1,6 +1,8 @@ #include "config.h" #include <glib.h> #include <glib/gi18n-lib.h> + +#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT) #include <hb-ot.h> #include "script-names.h" @@ -182,3 +184,4 @@ get_script_name_for_tag (guint32 tag) return NULL; } +#endif |