Merge pull request #4046 from harfbuzz/hb-features-docs

[doc] Try to fix generating hb-features docs
This commit is contained in:
Behdad Esfahbod 2023-01-23 16:06:26 -07:00 committed by GitHub
commit 00cf322e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 29 deletions

View File

@ -56,6 +56,7 @@
<xi:include href="xml/hb-blob.xml"/> <xi:include href="xml/hb-blob.xml"/>
<xi:include href="xml/hb-buffer.xml"/> <xi:include href="xml/hb-buffer.xml"/>
<xi:include href="xml/hb-common.xml"/> <xi:include href="xml/hb-common.xml"/>
<xi:include href="xml/hb-features.xml"/>
<xi:include href="xml/hb-draw.xml"/> <xi:include href="xml/hb-draw.xml"/>
<xi:include href="xml/hb-paint.xml"/> <xi:include href="xml/hb-paint.xml"/>
<xi:include href="xml/hb-deprecated.xml"/> <xi:include href="xml/hb-deprecated.xml"/>

View File

@ -166,16 +166,6 @@ HB_TAG_MAX_SIGNED
HB_LANGUAGE_INVALID HB_LANGUAGE_INVALID
HB_FEATURE_GLOBAL_END HB_FEATURE_GLOBAL_END
HB_FEATURE_GLOBAL_START HB_FEATURE_GLOBAL_START
HB_HAS_CAIRO
HB_HAS_CORETEXT
HB_HAS_DIRECTWRITE
HB_HAS_FREETYPE
HB_HAS_GDI
HB_HAS_GLIB
HB_HAS_GOBJECT
HB_HAS_GRAPHITE
HB_HAS_ICU
HB_HAS_UNISCRIBE
<SUBSECTION Private> <SUBSECTION Private>
HB_BEGIN_DECLS HB_BEGIN_DECLS
HB_END_DECLS HB_END_DECLS
@ -194,6 +184,20 @@ HB_DEPRECATED
HB_DEPRECATED_FOR HB_DEPRECATED_FOR
</SECTION> </SECTION>
<SECTION>
<FILE>hb-features</FILE>
HB_HAS_CAIRO
HB_HAS_CORETEXT
HB_HAS_DIRECTWRITE
HB_HAS_FREETYPE
HB_HAS_GDI
HB_HAS_GLIB
HB_HAS_GOBJECT
HB_HAS_GRAPHITE
HB_HAS_ICU
HB_HAS_UNISCRIBE
</SECTION>
<SECTION> <SECTION>
<FILE>hb-draw</FILE> <FILE>hb-draw</FILE>
hb_draw_funcs_create hb_draw_funcs_create

View File

@ -36,6 +36,7 @@ html_images = [
] ]
ignore_headers = [ ignore_headers = [
'hb-features.h',
'hb-gobject.h', 'hb-gobject.h',
'hb-gobject-enums.h', 'hb-gobject-enums.h',
'hb-gobject-enums-tmp.h', 'hb-gobject-enums-tmp.h',

View File

@ -27,6 +27,14 @@
HB_BEGIN_DECLS HB_BEGIN_DECLS
/**
* SECTION: hb-features
* @title: hb-features
* @short_description: Feature detection
* @include: hb-features.h
*
* Macros for detecting optional HarfBuzz features at build time.
**/
/** /**
* HB_HAS_CAIRO: * HB_HAS_CAIRO:

View File

@ -422,24 +422,16 @@ harfbuzz_deps = [thread_dep, m_dep] + harfbuzz_extra_deps
libharfbuzz_link_language = 'c' libharfbuzz_link_language = 'c'
hb_features = configuration_data()
if conf.get('HAVE_FREETYPE', 0) == 1 if conf.get('HAVE_FREETYPE', 0) == 1
hb_sources += hb_ft_sources hb_sources += hb_ft_sources
hb_headers += hb_ft_headers hb_headers += hb_ft_headers
harfbuzz_deps += [freetype_dep] harfbuzz_deps += [freetype_dep]
hb_features.set('HB_HAS_FREETYPE', 1)
endif endif
if conf.get('HAVE_GLIB', 0) == 1 if conf.get('HAVE_GLIB', 0) == 1
hb_sources += hb_glib_sources hb_sources += hb_glib_sources
hb_headers += hb_glib_headers hb_headers += hb_glib_headers
harfbuzz_deps += [glib_dep] harfbuzz_deps += [glib_dep]
hb_features.set('HB_HAS_GLIB', 1)
endif
if conf.get('HAVE_GOBJECT', 0) == 1
hb_features.set('HB_HAS_GOBJECT', 1)
endif endif
# We set those here to not include the sources below that are of no use to # We set those here to not include the sources below that are of no use to
@ -451,20 +443,17 @@ if conf.get('HAVE_GDI', 0) == 1
hb_sources += hb_gdi_sources hb_sources += hb_gdi_sources
hb_headers += hb_gdi_headers hb_headers += hb_gdi_headers
harfbuzz_deps += gdi_uniscribe_deps harfbuzz_deps += gdi_uniscribe_deps
hb_features.set('HB_HAS_GDI', 1)
endif endif
if conf.get('HAVE_GRAPHITE2', 0) == 1 if conf.get('HAVE_GRAPHITE2', 0) == 1
hb_sources += hb_graphite2_sources hb_sources += hb_graphite2_sources
hb_headers += hb_graphite2_headers hb_headers += hb_graphite2_headers
harfbuzz_deps += [graphite2_dep, graphite_dep] harfbuzz_deps += [graphite2_dep, graphite_dep]
hb_features.set('HB_HAS_GRAPHITE', 1)
endif endif
if conf.get('HAVE_UNISCRIBE', 0) == 1 if conf.get('HAVE_UNISCRIBE', 0) == 1
hb_sources += hb_uniscribe_sources hb_sources += hb_uniscribe_sources
hb_headers += hb_uniscribe_headers hb_headers += hb_uniscribe_headers
hb_features.set('HB_HAS_UNISCRIBE', 1)
endif endif
if conf.get('HAVE_DIRECTWRITE', 0) == 1 if conf.get('HAVE_DIRECTWRITE', 0) == 1
@ -472,36 +461,58 @@ if conf.get('HAVE_DIRECTWRITE', 0) == 1
hb_headers += hb_directwrite_headers hb_headers += hb_directwrite_headers
# hb-directwrite needs a C++ linker # hb-directwrite needs a C++ linker
libharfbuzz_link_language = 'cpp' libharfbuzz_link_language = 'cpp'
hb_features.set('HB_HAS_DIRECTWRITE', 1)
endif endif
if conf.get('HAVE_CORETEXT', 0) == 1 if conf.get('HAVE_CORETEXT', 0) == 1
hb_sources += hb_coretext_sources hb_sources += hb_coretext_sources
hb_headers += hb_coretext_headers hb_headers += hb_coretext_headers
harfbuzz_deps += coretext_deps harfbuzz_deps += coretext_deps
hb_features.set('HB_HAS_CORETEXT', 1)
endif endif
have_icu = conf.get('HAVE_ICU', 0) == 1 have_icu = conf.get('HAVE_ICU', 0) == 1
have_icu_builtin = conf.get('HAVE_ICU_BUILTIN', 0) == 1 have_icu_builtin = conf.get('HAVE_ICU_BUILTIN', 0) == 1
if have_icu and have_icu_builtin if have_icu and have_icu_builtin
hb_sources += hb_icu_sources hb_sources += hb_icu_sources
hb_headers += hb_icu_headers hb_headers += hb_icu_headers
harfbuzz_deps += [icu_dep] harfbuzz_deps += [icu_dep]
hb_features.set('HB_HAS_ICU', 1)
endif endif
if conf.get('HAVE_CAIRO', 0) == 1 features = [
hb_features.set('HB_HAS_CAIRO', 1) 'CAIRO',
endif 'CORETEXT',
'DIRECTWRITE',
'FREETYPE',
'GDI',
'GLIB',
'GOBJECT',
'GRAPHITE',
'ICU',
'UNISCRIBE',
]
hb_enabled_features = configuration_data()
hb_supported_features = configuration_data()
foreach feature : features
key = 'HB_HAS_@0@'.format(feature)
hb_enabled_features.set(key, conf.get('HAVE_@0@'.format(feature), false))
hb_supported_features.set(key, 1)
endforeach
# The enabled features. This file is installed.
hb_features_h = configure_file(input: 'hb-features.h.in', hb_features_h = configure_file(input: 'hb-features.h.in',
output: 'hb-features.h', output: 'hb-features.h',
configuration: hb_features, configuration: hb_enabled_features,
install: true, install: true,
install_dir: get_option('includedir') / meson.project_name()) install_dir: get_option('includedir') / meson.project_name())
# This file is generated to convince gtk-doc to generate documentation for all
# HB_HAS_* macros, whether they are enabled for the current build or not.
# This file should not be installed.
hb_supported_features_h = configure_file(input: 'hb-features.h.in',
output: 'hb-supported-features.h',
configuration: hb_supported_features,
install: false)
# Base and default-included sources and headers # Base and default-included sources and headers
# harfbuzz # harfbuzz