move exposed ft-hb interface to public include directory

This commit is contained in:
6ziv 2025-10-29 02:46:36 +08:00
parent fa4fc2901a
commit ad211e558b
7 changed files with 53 additions and 18 deletions

View file

@ -0,0 +1,46 @@
/****************************************************************************
*
* ft-hb.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 )
#define HB_EXTERN( ret, name, args ) \
typedef ret (*ft_ ## name ## _func_t) args;
#include <freetype/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 <freetype/ft-hb-decls.h>
#undef 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([

View file

@ -137,7 +137,7 @@
if ( !funcs->name ) \
goto Fail; \
}
#include "ft-hb-decls.h"
#include <freetype/internal/ft-hb-decls.h>
#undef HB_EXTERN
#undef DLSYM

View file

@ -27,24 +27,11 @@ 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 )
# 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;
# ifdef FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC
struct AF_ModuleRec_;
@ -63,7 +50,7 @@ FT_BEGIN_HEADER
# define HB_EXTERN( ret, name, args ) \
ret name args;
# include "ft-hb-decls.h"
# include <freetype/ft-hb-decls.h>
# undef 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)