From efa555bfe624587c55c88d6683825ab659f23da2 Mon Sep 17 00:00:00 2001 From: Craig White Date: Sun, 28 Jan 2024 07:38:41 +0100 Subject: [PATCH] [base] Make `find_unicode_charmap` a base function. This is needed for forthcoming changes in the auto-hinter. * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: Updated. --- include/freetype/internal/ftobjs.h | 22 ++++++++++++++++++++++ src/base/ftobjs.c | 18 +++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index e6333c2aa..b6b35a912 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -275,6 +275,28 @@ FT_BEGIN_HEADER FT_GlyphSlot slot, FT_Render_Mode mode ); + + /************************************************************************** + * + * @Function: + * find_unicode_charmap + * + * @Description: + * This function finds a Unicode charmap, if there is one. And if there + * is more than one, it tries to favour the more extensive one, i.e., one + * that supports UCS-4 against those which are limited to the BMP (UCS-2 + * encoding.) + * + * If a unicode charmap is found, `face->charmap` is set to it. + * + * This function is called from `open_face`, from `FT_Select_Charmap(..., + * FT_ENCODING_UNICODE)`, and also from `afadjust.c` in the 'autofit' + * module. + */ + FT_BASE( FT_Error ) + find_unicode_charmap( FT_Face face ); + + #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap, diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 9b97820c3..348bb2a26 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -1359,21 +1359,9 @@ } - /************************************************************************** - * - * @Function: - * find_unicode_charmap - * - * @Description: - * This function finds a Unicode charmap, if there is one. - * And if there is more than one, it tries to favour the more - * extensive one, i.e., one that supports UCS-4 against those which - * are limited to the BMP (said UCS-2 encoding.) - * - * This function is called from open_face() (just below), and also - * from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ). - */ - static FT_Error + /* documentation is in ftobjs.h */ + + FT_BASE_DEF( FT_Error ) find_unicode_charmap( FT_Face face ) { FT_CharMap* first;