1 /* Copyright 2014 Google Inc. All Rights Reserved.
3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
7 /* Common definition for WOFF2 encoding/decoding */
9 #ifndef WOFF2_WOFF2_COMMON_H_
10 #define WOFF2_WOFF2_COMMON_H_
19 static const uint32_t kWoff2Signature
= 0x774f4632; // "wOF2"
21 // Leave the first byte open to store flag_byte
22 const unsigned int kWoff2FlagsTransform
= 1 << 8;
24 // TrueType Collection ID string: 'ttcf'
25 static const uint32_t kTtcFontFlavor
= 0x74746366;
27 static const size_t kSfntHeaderSize
= 12;
28 static const size_t kSfntEntrySize
= 16;
42 uint32_t transform_length
;
46 const uint8_t* dst_data
;
48 bool operator<(const Table
& other
) const {
49 return tag
< other
.tag
;
54 // Size of the collection header. 0 if version indicates this isn't a
55 // collection. Ref http://www.microsoft.com/typography/otspec/otff.htm,
56 // True Type Collections
57 size_t CollectionHeaderSize(uint32_t header_version
, uint32_t num_fonts
);
59 // Compute checksum over size bytes of buf
60 uint32_t ComputeULongSum(const uint8_t* buf
, size_t size
);
64 #endif // WOFF2_WOFF2_COMMON_H_