diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2021-08-08 10:44:19 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2022-02-27 15:44:58 +1030 |
commit | 90ca6354722879ab6af980aeb3aed2bab0b2a7af (patch) | |
tree | 2565c7dd52758eb35437e08cd1a593809dc0c336 /meson.build | |
parent | 1a799577b2c7bcd3757211adcc4e46abb3bdfc97 (diff) | |
download | cairo-90ca6354722879ab6af980aeb3aed2bab0b2a7af.tar.gz |
Import win32 dwrite font backend from
https://hg.mozilla.org/mozilla-central/file/7338d7d940913147f8a1b1e8bd2b25ab255f4373/gfx/cairo/cairo/src
and add to the meson build. I've omitted the
cairo_surface_set_subpixel_antialiasing() API and its use in quartz
and dwrite. Not sure if that is needed.
It compiles. Not tested.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 75a7bdfa7..f5aab34b4 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('cairo', 'c', +project('cairo', 'c', 'cpp', meson_version: '>= 0.56.0', version: run_command(find_program('version.py'), check: true).stdout().strip(), default_options: ['warning_level=2'], @@ -501,6 +501,21 @@ if host_machine.system() == 'windows' 'deps': win32_extra_deps, } ] + + cpp_compiler = meson.get_compiler('cpp') + direct2d_dep = cpp_compiler.find_library('d2d1', required: false) + dwrite_dep = cpp_compiler.find_library('dwrite', required: false) + direct2d_header = cpp_compiler.has_header('d2d1.h') + dwrite_header = cpp_compiler.has_header('dwrite.h') + + if direct2d_dep.found() and dwrite_dep.found() and direct2d_header and dwrite_header + feature_conf.set('CAIRO_HAS_DWRITE_FONT', 1) + built_features += [{ + 'name': 'cairo-win32-dwrite-font', + 'description': 'Microsoft Windows DWrite font backend', + 'deps': [dwrite_dep, direct2d_dep], + }] + endif endif # GL / GLESV2 / GLESV3 are mutually exclusive @@ -941,6 +956,7 @@ summary({ 'FreeType': feature_conf.get('CAIRO_HAS_FT_FONT', 0) == 1, 'Fontconfig': feature_conf.get('CAIRO_HAS_FC_FONT', 0) == 1, 'Win32': feature_conf.get('CAIRO_HAS_WIN32_FONT', 0) == 1, + 'Win32 DWrite': feature_conf.get('CAIRO_HAS_DWRITE_FONT', 0) == 1, 'Quartz': feature_conf.get('CAIRO_HAS_QUARTZ_FONT', 0) == 1, }, section: 'Font Backends', bool_yn: true) |