src/autofit/ft-hb.h

Branch


Log

Author Commit Date CI Message
Behdad Esfahbod (بهداد اسفهبد) 97bb53ee 2025-04-28T07:24:41 [autofit] Enable dynamic loading of HarfBuzz. (2/2) Handle the case where loading HarfBuzz dynamically fails. * src/autofit/ft-hb.c, src/autofit/ft-hb.h (ft_hb_enabled): New function. * src/autofit/afglobal.c (af_face_globals_new, af_face_globals_free): Guard HarfBuzz functions with `ft_hb_enabled`. * src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_metrics_init_blues, af_latin_metrics_check_digits): Simplify setup of `shaper_buf`. Guard calls of `af_shaper_buf_create` with `ft_hb_enabled`. * src/autofit/afcjk.c (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Dito. * src/autofit/afshaper.c: Guard all HarfBuzz function calls with `ft_hb_enabled`.
Behdad Esfahbod (بهداد اسفهبد) 7651fe00 2025-04-27T18:44:49 [autofit] Enable dynamic loading of HarfBuzz. (1/2) This commit activates the mini-HarfBuzz header files and provides the necessary infrastructure for dynamically loading HarfBuzz if `FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC` is defined (this macro gets set up in a follow-up commit). * src/autofit/ft-hb.c: New file, providing `ft_hb_funcs_init` and `ft_hb_funcs_done` for loading HarfBuzz dynamically. The name of the library is hold in the macro `FT_LIBHARFBUZZ`, which can be overridden. * src/autofit/ft-hb.h: Don't include `hb.h` but `ft-hb-types.h`. (hb): Modified to handle both standard linking and dynamically loading of HarfBuzz. (HB_EXTERN): New macro to load `ft-hb-decls.h`. * src/autofit/afadjust.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: For the sake of dynamically loading the HarfBuzz library, replace the compile-time macro `HB_VERSION_ATLEAST` with a call to the run-time function `hb_version_atleast` where necessary – a follow-up commit will set the minimum version of HarfBuzz to 2.6.8, which provides all necessary functions needed by FreeType. * src/autofit/afmodule.h: Include `ft-hb.h`. (AF_ModuleRec) [FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC]: Add `hb_funcs` structure to hold pointers to the dynamically loaded HarfBuzz functions. * src/autofit/afmodule.c (af_autofitter_init, af_autofitter_done) [FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC]: Call `ft_hb_funcs_init` and `ft_hb_funcs_done`. * src/autofit/afshaper.h: Updated. * src/autofit/autofit.c: Include `ft-hb.c`. * src/autofit/rules.mk (AUTOF_DRV_SRC, AUTOF_DRV_H): Updated.
Behdad Esfahbod (بهداد اسفهبد) 8b443d70 2025-04-26T12:22:23 [autofit] Some preparations for loading HarfBuzz dynamically. (1/4) * src/autofit/ft-hb.h: New file, defining the `hb` macro. Later on, we provide a different definition of this macro depending on a yet-to-come configuration option to support dynamic loading of HarfBuzz functions. * src/autofit/afadjust.c, src/autofit/afglobal.c, src/autofit/afshaper.c, stc/ft-hb-ft.c: Use it.
Behdad Esfahbod (بهداد اسفهبد) 3eb4eade 2025-04-12T00:44:46 [autofit] Rename 'ft-hb' to 'ft-hb-ft'. Since it's a (shrinked) copy of 'hb-ft'. * src/autofit/afglobal.c (af_face_globals_new), src/autofit/afshaper.h, src/autofit/autofit.c: Updated. * src/autofit/ft-hb.c, src/autofit/ft-hb.h: Renamed to... * src/autofit/ft-hb-ft.c, src/autofit/ft-hb-ft.h: ...this; updated. * src/autofit/rules.mk (AUTOF_DRV_SRC): Updated.
Werner Lemberg 995ccfac 2023-02-08T21:49:56 [autofit] Fix 'multi' compilation. * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`. Add ANSI boilerplate code for otherwise empty file. * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`. Use `FT_BEGIN_HEADER` and `FT_END_HEADER`. Decorate with `FT_LOCAL`. * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
Werner Lemberg 37bc7c26 2023-02-07T07:37:07 Avoid reserved identifiers that are globally defined. This is mandated by the C99 standard, and clang 15 produces zillions of warnings otherwise. * devel/ftoption.h, include/freetype/config/ftoption.h, include/freetype/internal/ftmemory.h, src/autofit/afhints.h, src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
Matthias Clasen ebe7e912 2023-01-02T20:13:22 [autofit] Don't depend on 'hb-ft'. The circular dependency is still there, but at least we no longer depend on the HarfBuzz API that is only present if HarfBuzz has been built with FreeType support, making the bootstrapping a bit easier. * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing `_hb_ft_font_create`, which is more or less a verbatim copy of the corresponding HarfBuzz code from file `hb-ft.cc`. * src/autofit/afglobal.c (af_face_globals_new): Use it. * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`. * src/autofit/autofit.c: Include `ft-hb.c`. * LICENSE.TXT: Updated.