• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  *
3  * ftbase.h
4  *
5  *   Private functions used in the `base' module (specification).
6  *
7  * Copyright 2008-2018 by
8  * David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
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 
19 #ifndef FTBASE_H_
20 #define FTBASE_H_
21 
22 
23 #include <ft2build.h>
24 #include FT_INTERNAL_OBJECTS_H
25 
26 
27 FT_BEGIN_HEADER
28 
29 
30 #ifdef FT_CONFIG_OPTION_MAC_FONTS
31 
32   /* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
33   /* see https://support.microsoft.com/en-us/kb/130437                */
34 #define FT_MAC_RFORK_MAX_LEN  0x00FFFFFFUL
35 
36 
37   /* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
38   /* font, and try to load a face specified by the face_index.            */
39   FT_LOCAL( FT_Error )
40   open_face_PS_from_sfnt_stream( FT_Library     library,
41                                  FT_Stream      stream,
42                                  FT_Long        face_index,
43                                  FT_Int         num_params,
44                                  FT_Parameter  *params,
45                                  FT_Face       *aface );
46 
47 
48   /* Create a new FT_Face given a buffer and a driver name. */
49   /* From ftmac.c.                                          */
50   FT_LOCAL( FT_Error )
51   open_face_from_buffer( FT_Library   library,
52                          FT_Byte*     base,
53                          FT_ULong     size,
54                          FT_Long      face_index,
55                          const char*  driver_name,
56                          FT_Face     *aface );
57 
58 
59 #if  defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \
60     !defined( FT_MACINTOSH )
61   /* Mac OS X/Darwin kernel often changes recommended method to access */
62   /* the resource fork and older methods makes the kernel issue the    */
63   /* warning of deprecated method.  To calm it down, the methods based */
64   /* on Darwin VFS should be grouped and skip the rest methods after   */
65   /* the case the resource is opened but found to lack a font in it.   */
66   FT_LOCAL( FT_Bool )
67   ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt  rule_index );
68 #endif
69 
70 #endif /* FT_CONFIG_OPTION_MAC_FONTS */
71 
72 
73 FT_END_HEADER
74 
75 #endif /* FTBASE_H_ */
76 
77 
78 /* END */
79