1 /**************************************************************************** 2 * 3 * wofftypes.h 4 * 5 * Basic WOFF/WOFF2 type definitions and interface (specification 6 * only). 7 * 8 * Copyright (C) 1996-2019 by 9 * David Turner, Robert Wilhelm, and Werner Lemberg. 10 * 11 * This file is part of the FreeType project, and may only be used, 12 * modified, and distributed under the terms of the FreeType project 13 * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 * this file you indicate that you have read the license and 15 * understand and accept it fully. 16 * 17 */ 18 19 20 #ifndef WOFFTYPES_H_ 21 #define WOFFTYPES_H_ 22 23 24 #include <ft2build.h> 25 #include FT_TRUETYPE_TABLES_H 26 #include FT_INTERNAL_OBJECTS_H 27 28 29 FT_BEGIN_HEADER 30 31 32 /************************************************************************** 33 * 34 * @struct: 35 * WOFF_HeaderRec 36 * 37 * @description: 38 * WOFF file format header. 39 * 40 * @fields: 41 * See 42 * 43 * https://www.w3.org/TR/WOFF/#WOFFHeader 44 */ 45 typedef struct WOFF_HeaderRec_ 46 { 47 FT_ULong signature; 48 FT_ULong flavor; 49 FT_ULong length; 50 FT_UShort num_tables; 51 FT_UShort reserved; 52 FT_ULong totalSfntSize; 53 FT_UShort majorVersion; 54 FT_UShort minorVersion; 55 FT_ULong metaOffset; 56 FT_ULong metaLength; 57 FT_ULong metaOrigLength; 58 FT_ULong privOffset; 59 FT_ULong privLength; 60 61 } WOFF_HeaderRec, *WOFF_Header; 62 63 64 /************************************************************************** 65 * 66 * @struct: 67 * WOFF_TableRec 68 * 69 * @description: 70 * This structure describes a given table of a WOFF font. 71 * 72 * @fields: 73 * Tag :: 74 * A four-bytes tag describing the table. 75 * 76 * Offset :: 77 * The offset of the table from the start of the WOFF font in its 78 * resource. 79 * 80 * CompLength :: 81 * Compressed table length (in bytes). 82 * 83 * OrigLength :: 84 * Uncompressed table length (in bytes). 85 * 86 * CheckSum :: 87 * The table checksum. This value can be ignored. 88 * 89 * OrigOffset :: 90 * The uncompressed table file offset. This value gets computed while 91 * constructing the (uncompressed) SFNT header. It is not contained in 92 * the WOFF file. 93 */ 94 typedef struct WOFF_TableRec_ 95 { 96 FT_ULong Tag; /* table ID */ 97 FT_ULong Offset; /* table file offset */ 98 FT_ULong CompLength; /* compressed table length */ 99 FT_ULong OrigLength; /* uncompressed table length */ 100 FT_ULong CheckSum; /* uncompressed checksum */ 101 102 FT_ULong OrigOffset; /* uncompressed table file offset */ 103 /* (not in the WOFF file) */ 104 } WOFF_TableRec, *WOFF_Table; 105 106 107 FT_END_HEADER 108 109 #endif /* WOFFTYPES_H_ */ 110 111 112 /* END */