Merge branch 'master' into 'master'

Draft: Use dependency injection to call harfbuzz methods.

Closes #1198

See merge request freetype/freetype!397
This commit is contained in:
6ziv 2026-04-08 10:02:06 +00:00
commit ca40b57962
13 changed files with 301 additions and 67 deletions

View file

@ -212,9 +212,18 @@ option(FT_DISABLE_HARFBUZZ
cmake_dependent_option(FT_DYNAMIC_HARFBUZZ
"Load HarfBuzz library dynamically at runtime, if possible." ON
"NOT FT_DISABLE_HARFBUZZ" OFF)
cmake_dependent_option(FT_USE_HARFBUZZ_CALLBACKS
"Let HarfBuzz library inject callback methods at runtime." OFF
"NOT FT_DISABLE_HARFBUZZ;NOT FT_DYNAMIC_HARFBUZZ" OFF)
cmake_dependent_option(FT_REQUIRE_HARFBUZZ
"Require HarfBuzz for improving auto-hinting of OpenType fonts." OFF
"NOT FT_DISABLE_HARFBUZZ" OFF)
cmake_dependent_option(FT_USE_HARFBUZZ_CALLING_CONVENTION_CDECL
"use HarfBuzz library as cdecl." OFF
"NOT FT_DISABLE_HARFBUZZ" OFF)
cmake_dependent_option(FT_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL
"use HarfBuzz library as stdcall." OFF
"NOT FT_DISABLE_HARFBUZZ;NOT FT_USE_HARFBUZZ_CALLING_CONVENTION_CDECL" OFF)
option(FT_DISABLE_BROTLI
"Disable support of compressed WOFF2 fonts." OFF)
@ -282,10 +291,13 @@ if (NOT FT_DISABLE_HARFBUZZ)
endif()
endif()
endif()
elseif(FT_USE_HARFBUZZ_CALLBACKS)
set(FT_HARFBUZZ_CALLBACKS_ENABLED TRUE)
endif()
if (FT_DYNAMIC_HARFBUZZ_ENABLED)
message(STATUS "Enabled dynamic loading of HarfBuzz library at runtime.")
elseif (FT_HARFBUZZ_CALLBACKS_ENABLED)
message(STATUS "Enable HarfBuzz to inject callbacks into FreeType.")
elseif (FT_REQUIRE_HARFBUZZ)
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
else ()
@ -414,7 +426,7 @@ if (PNG_FOUND)
"/\\* +(#define +FT_CONFIG_OPTION_USE_PNG) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
if (HARFBUZZ_FOUND OR FT_DYNAMIC_HARFBUZZ_ENABLED)
if (HARFBUZZ_FOUND OR FT_DYNAMIC_HARFBUZZ_ENABLED OR FT_HARFBUZZ_CALLBACKS_ENABLED)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
@ -422,7 +434,20 @@ if (HARFBUZZ_FOUND OR FT_DYNAMIC_HARFBUZZ_ENABLED)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
elseif (FT_HARFBUZZ_CALLBACKS_ENABLED)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
if (FT_USE_HARFBUZZ_CALLING_CONVENTION_CDECL)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
elseif(FT_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif()
endif ()
if (BROTLIDEC_FOUND)
string(REGEX REPLACE
@ -625,7 +650,7 @@ if (FT_DYNAMIC_HARFBUZZ_ENABLED AND FT_NEED_LIBDL)
target_link_libraries(freetype PRIVATE dl)
list(APPEND PKGCONFIG_LIBS_PRIVATE " -ldl")
endif ()
if (HarfBuzz_FOUND AND (NOT FT_DYNAMIC_HARFBUZZ_ENABLED))
if (HarfBuzz_FOUND AND (NOT FT_DYNAMIC_HARFBUZZ_ENABLED) AND (NOT FT_HARFBUZZ_CALLBACKS_ENABLED))
target_link_libraries(freetype PRIVATE HarfBuzz::HarfBuzz)
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
endif ()

View file

@ -441,7 +441,7 @@ fi
# check for system libharfbuzz
AC_ARG_WITH([harfbuzz],
[AS_HELP_STRING([--with-harfbuzz=@<:@yes|dynamic|no|auto@:>@],
[AS_HELP_STRING([--with-harfbuzz=@<:@yes|dynamic|no|callbacks|auto@:>@],
[improve auto-hinting of OpenType fonts @<:@default=auto@:>@])],
[], [with_harfbuzz=auto])
@ -505,6 +505,14 @@ if test x"$have_harfbuzz" = xno; then
;;
esac
fi
have_harfbuzz_callbacks=no
if test x"$have_harfbuzz" = xno; then
if test x"$with_harfbuzz" = xcallbacks; then
have_harfbuzz_callbacks=yes
have_harfbuzz="yes (callbacks)"
fi
fi
if test x"$have_harfbuzz" = xno; then
@ -1203,6 +1211,25 @@ if test "$have_harfbuzz_dynamic" != no; then
else
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC
fi
if test "$have_harfbuzz_callbacks" != no; then
ftoption_set FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS
else
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS
fi
AC_ARG_WITH([harfbuzz-calling-convention],
[AS_HELP_STRING([--with-harfbuzz-calling-convention=@<:@auto|cdecl|stdcall@:>@],
[calling convention of harfbuzz library @<:@default=auto@:>@])],
[], [with_harfbuzz_calling_convention=auto])
if test x"$with_harfbuzz_calling_convention" = xcdecl; then
ftoption_set FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL
else
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL
fi
if test x"$with_harfbuzz_calling_convention" = xstdcall; then
ftoption_set FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL
else
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL
fi
if test "$have_brotli" != no; then
CFLAGS="$CFLAGS $BROTLI_CFLAGS"
LDFLAGS="$LDFLAGS $BROTLI_LIBS"

View file

@ -317,6 +317,64 @@ FT_BEGIN_HEADER
*/
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
/**************************************************************************
*
* HarfBuzz callbacks support.
*
* Define this macro if you want the HarfBuzz library to inject callback
* functions to FreeType
*
* This option has no effect if `FT_CONFIG_OPTION_USE_HARFBUZZ` is not
* defined.
*
* When this option is enabled, FreeType will not load or link to the
* HarfBuzz library. Instead, the HarfBuzz library is expected to set
* use property 'harfbuzz-callbacks' to pass callback functions into
* FreeType.
*
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
*/
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS */
/**************************************************************************
*
* HarfBuzz dynamic/callbacks calling convention.
*
* Define this macro if the HarfBuzz library is using cdecl calling
* convention
*
* This option has no effect if not using harfbuzz mode 'dynamic' or
* 'callbacks'.
*
* When this option is enabled, FreeType will consider loaded or
* injected HarfBuzz-related functions as __cdecl.
*
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
*/
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL */
/**************************************************************************
*
* HarfBuzz dynamic/callbacks calling convention.
*
* Define this macro if the HarfBuzz library is using stdcall calling
* convention
*
* This option has no effect if not using harfbuzz mode 'dynamic' or
* 'callbacks'.
*
* When this option is enabled, FreeType will consider loaded or
* injected HarfBuzz-related functions as __stdcall.
*
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
*/
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL */
/**************************************************************************
*

View file

@ -27,90 +27,90 @@
/* All HarfBuzz function declarations used by FreeType, taken */
/* from various public HarfBuzz header files. The wrapper macro */
/* `HB_EXTERN` is defined in `ft-hb.h`. */
/* `FT_HB_EXTERN` is defined in `ft-hb.h`. */
/* hb-blob.h */
HB_EXTERN(hb_blob_t *,
FT_HB_EXTERN(hb_blob_t *,
hb_blob_create,(const char *data,
unsigned int length,
hb_memory_mode_t mode,
void *user_data,
hb_destroy_func_t destroy))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_blob_destroy,(hb_blob_t *blob))
/* hb-buffer.h */
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_buffer_add_utf8,(hb_buffer_t *buffer,
const char *text,
int text_length,
unsigned int item_offset,
int item_length))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_buffer_clear_contents,(hb_buffer_t *buffer))
HB_EXTERN(hb_buffer_t *,
FT_HB_EXTERN(hb_buffer_t *,
hb_buffer_create,(void))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_buffer_destroy,(hb_buffer_t *buffer))
HB_EXTERN(hb_glyph_info_t *,
FT_HB_EXTERN(hb_glyph_info_t *,
hb_buffer_get_glyph_infos,(hb_buffer_t *buffer,
unsigned int *length))
HB_EXTERN(hb_glyph_position_t *,
FT_HB_EXTERN(hb_glyph_position_t *,
hb_buffer_get_glyph_positions,(hb_buffer_t *buffer,
unsigned int *length))
HB_EXTERN(unsigned int,
FT_HB_EXTERN(unsigned int,
hb_buffer_get_length,(const hb_buffer_t *buffer))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_buffer_guess_segment_properties,(hb_buffer_t *buffer))
/* hb-face.h */
HB_EXTERN(hb_face_t *,
FT_HB_EXTERN(hb_face_t *,
hb_face_create,(hb_blob_t *blob,
unsigned int index))
HB_EXTERN(hb_face_t *,
FT_HB_EXTERN(hb_face_t *,
hb_face_create_for_tables,(hb_reference_table_func_t reference_table_func,
void *user_data,
hb_destroy_func_t destroy))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_face_destroy,(hb_face_t *face))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_face_set_index,(hb_face_t *face,
unsigned int index))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_face_set_upem,(hb_face_t *face,
unsigned int upem))
/* hb-font.h */
HB_EXTERN(hb_font_t *,
FT_HB_EXTERN(hb_font_t *,
hb_font_create,(hb_face_t *face))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_font_destroy,(hb_font_t *font))
HB_EXTERN(hb_face_t *,
FT_HB_EXTERN(hb_face_t *,
hb_font_get_face,(hb_font_t *font))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_font_set_scale,(hb_font_t *font,
int x_scale,
int y_scale))
@ -118,7 +118,7 @@ hb_font_set_scale,(hb_font_t *font,
/* hb-ot-layout.h */
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_ot_layout_collect_lookups,(hb_face_t *face,
hb_tag_t table_tag,
const hb_tag_t *scripts,
@ -126,7 +126,7 @@ hb_ot_layout_collect_lookups,(hb_face_t *face,
const hb_tag_t *features,
hb_set_t *lookup_indexes /* OUT */))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_ot_layout_lookup_collect_glyphs,(hb_face_t *face,
hb_tag_t table_tag,
unsigned int lookup_index,
@ -135,14 +135,14 @@ hb_ot_layout_lookup_collect_glyphs,(hb_face_t *face,
hb_set_t *glyphs_after, /* OUT. May be NULL */
hb_set_t *glyphs_output /* OUT. May be NULL */))
HB_EXTERN(hb_bool_t,
FT_HB_EXTERN(hb_bool_t,
hb_ot_layout_lookup_would_substitute,(hb_face_t *face,
unsigned int lookup_index,
const hb_codepoint_t *glyphs,
unsigned int glyphs_length,
hb_bool_t zero_context))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_ot_tags_from_script_and_language,(hb_script_t script,
hb_language_t language,
unsigned int *script_count /* IN/OUT */,
@ -153,48 +153,48 @@ hb_ot_tags_from_script_and_language,(hb_script_t script,
/* hb-set.h */
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_set_add,(hb_set_t *set,
hb_codepoint_t codepoint))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_set_clear,(hb_set_t *set))
HB_EXTERN(hb_set_t *,
FT_HB_EXTERN(hb_set_t *,
hb_set_create,(void))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_set_destroy,(hb_set_t *set))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_set_del,(hb_set_t *set,
hb_codepoint_t codepoint))
HB_EXTERN(hb_bool_t,
FT_HB_EXTERN(hb_bool_t,
hb_set_has,(const hb_set_t *set,
hb_codepoint_t codepoint))
HB_EXTERN(hb_bool_t,
FT_HB_EXTERN(hb_bool_t,
hb_set_is_empty,(const hb_set_t *set))
HB_EXTERN(hb_bool_t,
FT_HB_EXTERN(hb_bool_t,
hb_set_next,(const hb_set_t *set,
hb_codepoint_t *codepoint))
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_set_subtract,(hb_set_t *set,
const hb_set_t *other))
/* hb-shape.h */
HB_EXTERN(void,
FT_HB_EXTERN(void,
hb_shape,(hb_font_t *font,
hb_buffer_t *buffer,
const hb_feature_t *features,
unsigned int num_features))
HB_EXTERN(hb_bool_t,
FT_HB_EXTERN(hb_bool_t,
hb_version_atleast,(unsigned int major,
unsigned int minor,
unsigned int micro))

View file

@ -0,0 +1,70 @@
/****************************************************************************
*
* ft-hb-functype.h
*
* FreeType-HarfBuzz bridge (specification).
*
* Copyright (C) 2025 by
* 6ziv.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*
* Originally located in src/autofit/ft-hb.h
* Move to a public header so that external projects can rely on this.
*
*/
#ifndef FT_HB_FUNCTYPE_H
#define FT_HB_FUNCTYPE_H
#include <freetype/ft-hb-types.h>
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) || \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS )
#include <freetype/config/ftoption.h>
#if defined(FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL)
#if defined( __GNUC__ )
#define FT_HB_CALLBACK
#elif defined( _MSC_VER)
#define FT_HB_CALLBACK __cdecl
#endif
#elif defined(FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL) /* FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL */
#if defined( __GNUC__ )
#define FT_HB_CALLBACK __attribute__((stdcall))
#elif defined( _MSC_VER)
#define FT_HB_CALLBACK __stdcall
#endif
#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL */
#ifndef FT_HB_CALLBACK
#define FT_HB_CALLBACK
#endif
#define FT_HB_EXTERN( ret, name, args ) \
typedef ret (FT_HB_CALLBACK *ft_ ## name ## _func_t) args;
#include <freetype/ft-hb-decls.h>
#undef FT_HB_EXTERN
typedef struct ft_hb_funcs_t
{
#define FT_HB_EXTERN( ret, name, args ) \
ft_ ## name ## _func_t name;
#include <freetype/ft-hb-decls.h>
#undef FT_HB_EXTERN
} ft_hb_funcs_t;
#endif
#endif /* FT_HB_FUNCTYPE_H */

View file

@ -183,6 +183,9 @@ ft2_public_headers = files([
'include/freetype/ttnameid.h',
'include/freetype/tttables.h',
'include/freetype/tttags.h',
'include/freetype/ft-hb-types.h',
'include/freetype/ft-hb-decls.h',
'include/freetype/ft-hb-functype.h'
])
ft2_config_headers = files([
@ -388,10 +391,31 @@ if not harfbuzz_dep.found() and \
endif
endif
if harfbuzz_opt == 'callbacks'
ftoption_command += [
'--enable=FT_CONFIG_OPTION_USE_HARFBUZZ',
'--enable=FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS',
]
endif
if harfbuzz_opt == 'disabled' or harfbuzz_opt == 'auto'
harfbuzz_opt = 'NO'
endif
if harfbuzz_opt == 'dynamic' or harfbuzz_opt == 'callbacks'
harfbuzz_calling_convention = get_option('harfbuzz_calling_convention')
if harfbuzz_calling_convention == 'cdecl'
ftoption_command += [
'--enable=FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_CDECL',
]
endif
if harfbuzz_calling_convention == 'stdcall'
ftoption_command += [
'--enable=FT_CONFIG_OPTION_USE_HARFBUZZ_CALLING_CONVENTION_STDCALL',
]
endif
endif
# Brotli decompression support.
brotli_dep = dependency('libbrotlidec',
required: get_option('brotli'))

View file

@ -24,12 +24,21 @@ option('bzip2',
option('harfbuzz',
type: 'combo',
choices: ['auto', 'enabled', 'dynamic', 'disabled'],
choices: ['auto', 'enabled', 'dynamic', 'disabled', 'callbacks'],
value: 'auto',
description: 'Use Harfbuzz library to improve auto-hinting;'
+ ' if available, many glyphs not directly addressable'
+ ' by a font\'s character map will be hinted also')
option('harfbuzz_calling_convention',
type: 'combo',
choices: ['auto', 'stdcall', 'cdecl'],
value: 'auto',
description: 'Calling-convention for HarfBuzz. Only used when using'
+ ' harfbuzz=\'dynamic\' or harfbuzz=\'callbacks\'. If'
+ ' unspecified or set to \'auto\', no specifier will'
+ ' be added.')
option('mmap',
type: 'feature',
value: 'auto',

View file

@ -275,7 +275,16 @@
return error;
}
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS )
#if defined ( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
#error "Can not set both dynamic harfbuzz and injected harfbuzz callbacks"
#endif
else if ( !ft_strcmp( property_name, "harfbuzz-callbacks" ) )
{
module->hb_funcs = (ft_hb_funcs_t*)value;
}
#endif
FT_TRACE2(( "af_property_set: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
@ -362,7 +371,17 @@
return error;
}
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS )
#if defined ( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
#error "Can not set both dynamic harfbuzz and injected harfbuzz callbacks"
#endif
else if ( !ft_strcmp( property_name, "harfbuzz-callbacks" ) )
{
ft_hb_funcs_t **val = (ft_hb_funcs_t **)value;
*val = module->hb_funcs;
}
#endif
FT_TRACE2(( "af_property_get: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );

View file

@ -41,8 +41,9 @@ FT_BEGIN_HEADER
FT_Bool no_stem_darkening;
FT_Int darken_params[8];
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
( defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) || \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS ) )
ft_hb_funcs_t* hb_funcs;
#endif

View file

@ -131,14 +131,14 @@
goto Fail;
/* Load all symbols we use. */
#define HB_EXTERN( ret, name, args ) \
#define FT_HB_EXTERN( ret, name, args ) \
{ \
funcs->name = DLSYM( lib, name ); \
if ( !funcs->name ) \
goto Fail; \
}
#include "ft-hb-decls.h"
#undef HB_EXTERN
#include <freetype/internal/ft-hb-decls.h>
#undef FT_HB_EXTERN
#undef DLSYM
@ -179,6 +179,14 @@
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS )
FT_LOCAL_DEF( FT_Bool )
ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals )
{
return globals->module->hb_funcs != NULL;
}
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS*/
FT_LOCAL_DEF( FT_Bool )
ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals )
{
@ -191,6 +199,8 @@
#endif
}
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS */
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */

View file

@ -27,23 +27,13 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
# include "ft-hb-types.h"
# include <freetype/ft-hb-functype.h>
# if defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC ) || \
defined( FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS )
# ifdef FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC
# define HB_EXTERN( ret, name, args ) \
typedef ret (*ft_ ## name ## _func_t) args;
# include "ft-hb-decls.h"
# undef HB_EXTERN
typedef struct ft_hb_funcs_t
{
# define HB_EXTERN( ret, name, args ) \
ft_ ## name ## _func_t name;
# include "ft-hb-decls.h"
# undef HB_EXTERN
} ft_hb_funcs_t;
struct AF_ModuleRec_;
FT_LOCAL( void )
@ -52,14 +42,16 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
ft_hb_funcs_done( struct AF_ModuleRec_ *af_module );
# endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
# define hb( x ) globals->module->hb_funcs->hb_ ## x
# else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
# else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC && !FT_CONFIG_OPTION_USE_HARFBUZZ_CALLBACKS*/
# define HB_EXTERN( ret, name, args ) \
# define FT_HB_EXTERN( ret, name, args ) \
ret name args;
# include "ft-hb-decls.h"
# undef HB_EXTERN
# include <freetype/ft-hb-decls.h>
# undef FT_HB_EXTERN
# define hb( x ) hb_ ## x

View file

@ -53,8 +53,7 @@ AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \
$(AUTOF_DIR)/afstyles.h \
$(AUTOF_DIR)/aftypes.h \
$(AUTOF_DIR)/afws-decl.h \
$(AUTOF_DIR)/afws-iter.h \
$(AUTOF_DIR)/ft-hb-decls.h
$(AUTOF_DIR)/afws-iter.h
# AUTOF driver object(s)