From 5182264a40e70ff31be0a0ec8a0d5ffb5f65582e Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 10 Oct 2022 12:31:53 +0200 Subject: [PATCH] [cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`. This ancient option stayed completely undocumented. Given that the 'cff' driver requires the 'psnames' module, it makes no sense today to have this macro. * src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init): Remove corresponding conditional code. --- docs/CHANGES | 6 ++++++ include/freetype/freetype.h | 18 +++++++++++------- src/cff/cffdrivr.c | 31 ++----------------------------- src/cff/cffobjs.c | 2 -- 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/docs/CHANGES b/docs/CHANGES index 8612aab0f..fe2a202fe 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -11,7 +11,13 @@ CHANGES BETWEEN 2.12.1 and 2.12.2 provides an excelent alternative. This is the last FreeType version with TT_INTERPRETER_VERSION_38 and TT_INTERPRETER_VERSION_40 treated differently. + + I. MISCELLANEOUS + + - The only referenced but never documented configuration macro + `FT_CONFIG_OPTION_NO_GLYPH_NAMES` has been removed. + ====================================================================== CHANGES BETWEEN 2.12.0 and 2.12.1 diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 18f3c13d4..81ca12ad7 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -4174,12 +4174,14 @@ FT_BEGIN_HEADER * The glyph index. 0~means 'undefined character code'. * * @note: - * The acceptable glyph name might come from - * [Adobe Glyph List](https://github.com/adobe-type-tools/agl-aglfn). - * See @FT_Get_Glyph_Name for the resiprocal function. + * Acceptable glyph names might come from the [Adobe Glyph + * List](https://github.com/adobe-type-tools/agl-aglfn). See + * @FT_Get_Glyph_Name for the inverse functionality. * - * This function always returns~0 if the config macro - * `FT_CONFIG_OPTION_NO_GLYPH_NAMES` is not defined in `ftoption.h`. + * This function has limited capabilities if the config macro + * `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` is not defined in `ftoption.h`: + * It then works only for fonts that actually embed glyph names (which + * many recent OpenType fonts do not). */ FT_EXPORT( FT_UInt ) FT_Get_Name_Index( FT_Face face, @@ -4223,8 +4225,10 @@ FT_BEGIN_HEADER * Be aware that FreeType reorders glyph indices internally so that glyph * index~0 always corresponds to the 'missing glyph' (called '.notdef'). * - * This function always returns an error if the config macro - * `FT_CONFIG_OPTION_NO_GLYPH_NAMES` is not defined in `ftoption.h`. + * This function has limited capabilities if the config macro + * `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` is not defined in `ftoption.h`: + * It then works only for fonts that actually embed glyph names (which + * many recent OpenType fonts do not). */ FT_EXPORT( FT_Error ) FT_Get_Glyph_Name( FT_Face face, diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index 17f7f2f03..0ee966cb5 100644 --- a/src/cff/cffdrivr.c +++ b/src/cff/cffdrivr.c @@ -1108,8 +1108,7 @@ /*************************************************************************/ /*************************************************************************/ -#if !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES && \ - defined TT_CONFIG_OPTION_GX_VAR_SUPPORT +#if defined TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_DEFINE_SERVICEDESCREC10( cff_services, @@ -1124,7 +1123,7 @@ FT_SERVICE_ID_PROPERTIES, &cff_service_properties, FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load ) -#elif !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES +#else FT_DEFINE_SERVICEDESCREC8( cff_services, @@ -1137,32 +1136,6 @@ FT_SERVICE_ID_PROPERTIES, &cff_service_properties, FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load ) -#elif defined TT_CONFIG_OPTION_GX_VAR_SUPPORT - FT_DEFINE_SERVICEDESCREC9( - cff_services, - - FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF, - FT_SERVICE_ID_MULTI_MASTERS, &cff_service_multi_masters, - FT_SERVICE_ID_METRICS_VARIATIONS, &cff_service_metrics_var, - FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info, - FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name, - FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info, - FT_SERVICE_ID_CID, &cff_service_cid_info, - FT_SERVICE_ID_PROPERTIES, &cff_service_properties, - FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load - ) -#else - FT_DEFINE_SERVICEDESCREC7( - cff_services, - - FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF, - FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info, - FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cff_service_ps_name, - FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info, - FT_SERVICE_ID_CID, &cff_service_cid_info, - FT_SERVICE_ID_PROPERTIES, &cff_service_properties, - FT_SERVICE_ID_CFF_LOAD, &cff_service_cff_load - ) #endif diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index fa42accb6..60c226882 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -1031,12 +1031,10 @@ cffface->style_flags = flags; } -#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES /* CID-keyed CFF or CFF2 fonts don't have glyph names -- the SFNT */ /* loader has unset this flag because of the 3.0 `post' table. */ if ( dict->cid_registry == 0xFFFFU && !cff2 ) cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES; -#endif if ( dict->cid_registry != 0xFFFFU && pure_cff ) cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;