From d75e093e68fe674b696ed4920a214d0036261539 Mon Sep 17 00:00:00 2001 From: Jjgod Jiang Date: Tue, 28 Apr 2015 17:33:30 +0000 Subject: [cff] Use `name' table for PS name if we have a SFNT-CFF. This follows the OpenType 1.7 specification. See http://tug.org/pipermail/tex-live/2015-April/036634.html for a discussion. * src/cff/cffdrivr.c (cff_get_ps_name): Use the `sfnt' service if we have an SFNT. git-svn-id: svn://tug.org/texlive/trunk@37096 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/freetype2/freetype-2.5.5-PATCHES/TL-Changes | 2 ++ .../libs/freetype2/freetype-2.5.5/src/cff/cffdrivr.c | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'Build/source/libs') diff --git a/Build/source/libs/freetype2/freetype-2.5.5-PATCHES/TL-Changes b/Build/source/libs/freetype2/freetype-2.5.5-PATCHES/TL-Changes index 87255205014..9bf9a23bd9d 100644 --- a/Build/source/libs/freetype2/freetype-2.5.5-PATCHES/TL-Changes +++ b/Build/source/libs/freetype2/freetype-2.5.5-PATCHES/TL-Changes @@ -13,3 +13,5 @@ Added newline at end of file: builds/wince/vc2005-ce/freetype.vcproj builds/windows/vc2005/freetype.vcproj +Backported a fix from git (3cc076dae): + src/cff/cffdrivr.c diff --git a/Build/source/libs/freetype2/freetype-2.5.5/src/cff/cffdrivr.c b/Build/source/libs/freetype2/freetype-2.5.5/src/cff/cffdrivr.c index 3e8898e343c..65e5ba44135 100644 --- a/Build/source/libs/freetype2/freetype-2.5.5/src/cff/cffdrivr.c +++ b/Build/source/libs/freetype2/freetype-2.5.5/src/cff/cffdrivr.c @@ -383,9 +383,27 @@ static const char* cff_get_ps_name( CFF_Face face ) { - CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Font cff = (CFF_Font)face->extra.data; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; + + + /* following the OpenType specification 1.7, we return the name stored */ + /* in the `name' table for a CFF wrapped into an SFNT container */ + + if ( sfnt ) + { + FT_Library library = FT_FACE_LIBRARY( face ); + FT_Module sfnt_module = FT_Get_Module( library, "sfnt" ); + FT_Service_PsFontName service = + (FT_Service_PsFontName)ft_module_get_service( + sfnt_module, + FT_SERVICE_ID_POSTSCRIPT_FONT_NAME ); + if ( service && service->get_ps_font_name ) + return service->get_ps_font_name( FT_FACE( face ) ); + } + return (const char*)cff->font_name; } -- cgit v1.2.3