summaryrefslogtreecommitdiff
path: root/src/base/ftfstype.c
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2009-03-03 13:28:59 +0000
committerDavid Turner <david@freetype.org>2009-03-03 13:28:59 +0000
commit01ca4da20375cf64f7e6b8c22c038042cf849502 (patch)
treee3ff9f0ca1237256015e64083363faab7aed3a6f /src/base/ftfstype.c
parent7585683c4a93a1f08ad3289d6564fda80818b2b4 (diff)
downloadfreetype2-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.c29
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 )