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