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