diff options
author | David Turner <david@freetype.org> | 2009-03-03 13:28:59 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 2009-03-03 13:28:59 +0000 |
commit | 01ca4da20375cf64f7e6b8c22c038042cf849502 (patch) | |
tree | e3ff9f0ca1237256015e64083363faab7aed3a6f /src/base/ftfstype.c | |
parent | 7585683c4a93a1f08ad3289d6564fda80818b2b4 (diff) | |
download | freetype2-01ca4da20375cf64f7e6b8c22c038042cf849502.tar.gz |
Remove ABI-breaking field in public PS_InfoFontRec definition.
Instead, we define a new internal PS_FontExtraRec structure to
hold the additionnal field, then place it in various internal
positions of the corresponding FT_Face derived objects.
Diffstat (limited to 'src/base/ftfstype.c')
-rw-r--r-- | src/base/ftfstype.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/base/ftfstype.c b/src/base/ftfstype.c index 0d4e53307..7060ac914 100644 --- a/src/base/ftfstype.c +++ b/src/base/ftfstype.c @@ -18,6 +18,8 @@ #include <ft2build.h> #include FT_TYPE1_TABLES_H #include FT_TRUETYPE_TABLES_H +#include FT_INTERNAL_SERVICE_H +#include FT_SERVICE_POSTSCRIPT_INFO_H /* documentation is in freetype.h */ @@ -25,15 +27,30 @@ FT_EXPORT_DEF( FT_UShort ) FT_Get_FSType_Flags( FT_Face face ) { - PS_FontInfoRec font_info; - TT_OS2* os2; + TT_OS2* os2; - /* look at FSType before fsType for Type42 */ + /* first, try to get the fs_type directly from the font */ + if ( face ) + { + FT_Service_PsInfo service = NULL; + + + FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); - if ( !FT_Get_PS_Font_Info( face, &font_info ) && - font_info.fs_type != 0 ) - return font_info.fs_type; + if ( service && service->ps_get_font_extra ) + { + PS_FontExtraRec extra; + + if ( !service->ps_get_font_extra( face, &extra ) && + extra.fs_type != 0 ) + { + return extra.fs_type; + } + } + } + + /* look at FSType before fsType for Type42 */ if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL && os2->version != 0xFFFFU ) |