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



commit 51644a2623abec5261f7a75f7ae887c06eaaab73
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 | 22 +++++++++++++++++-----
 gtk/meson.build            | 10 ++++++++++
 meson.build                |  2 +-
 3 files changed, 28 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build
index e2af42c8c4..d28fd9cfef 100644
--- a/demos/gtk-demo/meson.build
+++ b/demos/gtk-demo/meson.build
@@ -73,18 +73,30 @@ demos = files([
 
 gtkdemo_deps = [libgtk_dep]
 
-if harfbuzz_dep.found() and pangoft_dep.found()
+demos_extra_sources = files([
+  '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([
-  'main.c',
-])
+gtkdemo_sources = demos + demos_extra_sources
 
 
 geninclude = find_program('geninclude.py')
diff --git a/gtk/meson.build b/gtk/meson.build
index 93e029f42c..fbdb643cfa 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 fb3454c545..9c7ba1b1b7 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]