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