[gtk/wip/fanc999/fontchooser.win32.gtk3: 5/7] meson: Enable font tweaking on Windows without PangoFT



commit 8183f333e6ba340ce0f247b7f5da816938e461af
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Apr 12 14:58:36 2019 +0800

    meson: Enable font tweaking on Windows without PangoFT
    
    We just need HarfBuzz and FreeType to enable the font tweaking on
    Windows, but we can still enable PangoFT support if that is found.

 demos/gtk-demo/meson.build | 25 +++++++++++++++++--------
 gtk/meson.build            | 10 ++++++++++
 meson.build                |  2 +-
 3 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build
index 82e08973a5..95da9efbe4 100644
--- a/demos/gtk-demo/meson.build
+++ b/demos/gtk-demo/meson.build
@@ -76,21 +76,30 @@ demos = files([
 
 gtkdemo_deps = [libgtk_dep]
 
-if harfbuzz_dep.found() and pangoft_dep.found()
+demos_extra_sources = files([
+  'gtkfishbowl.c',
+  'gtkfishbowl.h',
+  'main.c',
+])
+
+if harfbuzz_dep.found() and (pangoft_dep.found() or (os_win32 and ft2_dep.found()))
   demos += files('font_features.c')
-  gtkdemo_deps += [harfbuzz_dep, pangoft_dep]
+  demos_extra_sources += files(['../../gtk/gtkpangofontutils.c'])
+
+  gtkdemo_deps += [harfbuzz_dep]
+  if pangoft_dep.found()
+    gtkdemo_deps += [pangoft_dep]
+  endif
+  if os_win32
+    gtkdemo_deps += [pangowin32_dep, ft2_dep]
+  endif
 endif
 
 if os_unix
   demos += files('pagesetup.c')
 endif
 
-gtkdemo_sources = demos + files([
-  'gtkfishbowl.c',
-  'gtkfishbowl.h',
-  'main.c',
-])
-
+gtkdemo_sources = demos + demos_extra_sources
 
 geninclude = find_program('geninclude.py')
 demos_h = custom_target(
diff --git a/gtk/meson.build b/gtk/meson.build
index ac8c1a9926..10582d5f7c 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -671,6 +671,12 @@ if os_win32
   gtk_sources += gtk_win32_sources
 endif
 
+if harfbuzz_dep.found() and ft2_dep.found()
+  gtk_sources += files([
+    'gtkpangofontutils.c'
+  ])
+endif
+
 gen_gtk_gresources_xml = find_program('gen-gtk-gresources-xml.py')
 gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
                                     command: [
@@ -859,6 +865,10 @@ if win32_enabled
   gtk_sources += gtk_use_win32_sources
   gtk_deps += [ giowin32_dep, pangowin32_dep ]
 
+  if harfbuzz_dep.found() and not pangoft_dep.found()
+    gtk_deps += [ft2_dep]
+  endif
+
   gtk_rc_body = configure_file(
     input: 'gtk-win32.rc.body.in',
     output: 'gtk-win32.rc.body',
diff --git a/meson.build b/meson.build
index 5e3c417b00..4194082e8f 100644
--- a/meson.build
+++ b/meson.build
@@ -405,7 +405,7 @@ else
   pangoft_dep    = dependency('pangoft2', required: false)
 endif
 
-if pangoft_dep.found()
+if pangoft_dep.found() or os_win32
   # Need at least 2.7.1 for FT_Get_Var_Design_Coordinates()
   # We get the dependency itself from pango, but pango doesn't care
   # about ft2 version, so an extra check is needed.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]