ReactOS  0.4.14-dev-342-gdc047f9
ftfstype.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftfstype.c */
4 /* */
5 /* FreeType utility file to access FSType data (body). */
6 /* */
7 /* Copyright 2008-2018 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
15 /* */
16 /***************************************************************************/
17 
18 #include <ft2build.h>
19 #include FT_TYPE1_TABLES_H
20 #include FT_TRUETYPE_TABLES_H
21 #include FT_INTERNAL_SERVICE_H
22 #include FT_SERVICE_POSTSCRIPT_INFO_H
23 
24 
25  /* documentation is in freetype.h */
26 
29  {
30  TT_OS2* os2;
31 
32 
33  /* first, try to get the fs_type directly from the font */
34  if ( face )
35  {
36  FT_Service_PsInfo service = NULL;
37 
38 
39  FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
40 
41  if ( service && service->ps_get_font_extra )
42  {
44 
45 
46  if ( !service->ps_get_font_extra( face, &extra ) &&
47  extra.fs_type != 0 )
48  return extra.fs_type;
49  }
50  }
51 
52  /* look at FSType before fsType for Type42 */
53 
54  if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL &&
55  os2->version != 0xFFFFU )
56  return os2->fsType;
57 
58  return 0;
59  }
60 
61 
62 /* END */
#define U(x)
Definition: wordpad.c:44
FT_UShort fsType
Definition: tttables.h:386
FT_Get_Sfnt_Table(FT_Face face, FT_Sfnt_Tag tag)
Definition: ftobjs.c:4113
smooth NULL
Definition: ftsmooth.c:416
FT_UShort version
Definition: tttables.h:382
Definition: id3.c:18
#define FT_EXPORT_DEF(x)
Definition: ftconfig.h:483
#define FT_FACE_FIND_SERVICE(face, ptr, id)
Definition: ftserv.h:75
unsigned short FT_UShort
Definition: fttypes.h:209
FT_Get_FSType_Flags(FT_Face face)
Definition: ftfstype.c:28
GLenum GLuint GLint GLenum face
Definition: glext.h:7025