Behdad Esfahbod | 64aef3a | 2008-01-23 16:14:38 -0500 | [diff] [blame] | 1 | /* |
Behdad Esfahbod | ee58aae | 2009-05-17 05:14:33 -0400 | [diff] [blame] | 2 | * Copyright (C) 2007,2008,2009 Red Hat, Inc. |
Behdad Esfahbod | 64aef3a | 2008-01-23 16:14:38 -0500 | [diff] [blame] | 3 | * |
| 4 | * This is part of HarfBuzz, an OpenType Layout engine library. |
| 5 | * |
| 6 | * Permission is hereby granted, without written agreement and without |
| 7 | * license or royalty fees, to use, copy, modify, and distribute this |
| 8 | * software and its documentation for any purpose, provided that the |
| 9 | * above copyright notice and the following two paragraphs appear in |
| 10 | * all copies of this software. |
| 11 | * |
| 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
| 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
| 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
| 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 16 | * DAMAGE. |
| 17 | * |
| 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
| 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
| 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 | * |
| 24 | * Red Hat Author(s): Behdad Esfahbod |
| 25 | */ |
| 26 | |
Behdad Esfahbod | 8dd1c8b | 2008-01-23 05:00:30 -0500 | [diff] [blame] | 27 | #ifndef HB_OT_LAYOUT_OPEN_PRIVATE_H |
| 28 | #define HB_OT_LAYOUT_OPEN_PRIVATE_H |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 29 | |
Behdad Esfahbod | 54e5aac | 2008-01-27 21:19:51 -0500 | [diff] [blame] | 30 | #ifndef HB_OT_LAYOUT_CC |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 31 | #error "This file should only be included from hb-ot-layout.cc" |
Behdad Esfahbod | 54e5aac | 2008-01-27 21:19:51 -0500 | [diff] [blame] | 32 | #endif |
| 33 | |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 34 | #include "hb-ot-layout-private.h" |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 35 | |
Behdad Esfahbod | a16ecbf | 2008-01-23 17:01:55 -0500 | [diff] [blame] | 36 | |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 37 | #define NO_INDEX ((unsigned int) 0xFFFF) |
Behdad Esfahbod | 2e8fb6c | 2009-05-18 04:37:37 -0400 | [diff] [blame] | 38 | #define NO_CONTEXT ((unsigned int) 0x110000) |
| 39 | #define NOT_COVERED ((unsigned int) 0x110000) |
| 40 | #define MAX_NESTING_LEVEL 8 |
Behdad Esfahbod | 5a0b791 | 2009-04-16 04:45:30 -0400 | [diff] [blame] | 41 | |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 42 | |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 43 | /* |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 44 | * Array types |
| 45 | */ |
| 46 | |
| 47 | /* get_len() is a method returning the number of items in an array-like object */ |
| 48 | #define DEFINE_LEN(Type, array, num) \ |
| 49 | inline unsigned int get_len(void) const { return num; } \ |
| 50 | |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 51 | /* An array type is one that contains a variable number of objects |
Behdad Esfahbod | 238c855 | 2009-05-17 00:22:37 -0400 | [diff] [blame] | 52 | * as its last item. An array object is extended with get_len() |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 53 | * methods, as well as overloaded [] operator. */ |
| 54 | #define DEFINE_ARRAY_TYPE(Type, array, num) \ |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 55 | DEFINE_INDEX_OPERATOR(Type, array, num) \ |
Behdad Esfahbod | 0dff25f | 2009-05-08 21:12:18 -0400 | [diff] [blame] | 56 | DEFINE_LEN(Type, array, num) |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 57 | #define DEFINE_INDEX_OPERATOR(Type, array, num) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 58 | inline const Type& operator[] (unsigned int i) const \ |
| 59 | { \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 60 | if (HB_UNLIKELY (i >= num)) return Null(Type); \ |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 61 | return array[i]; \ |
| 62 | } |
| 63 | |
| 64 | /* An offset array type is like an array type, but it contains a table |
| 65 | * of offsets to the objects, relative to the beginning of the current |
| 66 | * object. */ |
| 67 | #define DEFINE_OFFSET_ARRAY_TYPE(Type, array, num) \ |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 68 | DEFINE_OFFSET_INDEX_OPERATOR(Type, array, num) \ |
Behdad Esfahbod | 0dff25f | 2009-05-08 21:12:18 -0400 | [diff] [blame] | 69 | DEFINE_LEN(Offset, array, num) |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 70 | #define DEFINE_OFFSET_INDEX_OPERATOR(Type, array, num) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 71 | inline const Type& operator[] (unsigned int i) const \ |
| 72 | { \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 73 | if (HB_UNLIKELY (i >= num)) return Null(Type); \ |
| 74 | if (HB_UNLIKELY (!array[i])) return Null(Type); \ |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 75 | return *(const Type)((const char*)this + array[i]); \ |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 76 | } |
| 77 | |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 78 | |
| 79 | #define DEFINE_ARRAY_INTERFACE(Type, name) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 80 | inline const Type& get_##name (unsigned int i) const { return (*this)[i]; } \ |
| 81 | inline unsigned int get_##name##_count (void) const { return this->get_len (); } |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 82 | #define DEFINE_INDEX_ARRAY_INTERFACE(name) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 83 | inline unsigned int get_##name##_index (unsigned int i) const \ |
| 84 | { \ |
Behdad Esfahbod | 4a26ea4 | 2008-01-28 07:40:10 -0500 | [diff] [blame] | 85 | if (HB_UNLIKELY (i >= get_len ())) return NO_INDEX; \ |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 86 | return (*this)[i]; \ |
| 87 | } \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 88 | inline unsigned int get_##name##_count (void) const { return get_len (); } |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 89 | |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 90 | |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 91 | /* |
| 92 | * List types |
| 93 | */ |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 94 | |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 95 | #define DEFINE_LIST_INTERFACE(Type, name) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 96 | inline const Type& get_##name (unsigned int i) const { return (this+name##List)[i]; } \ |
| 97 | inline unsigned int get_##name##_count (void) const { return (this+name##List).len; } |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 98 | |
| 99 | /* |
| 100 | * Tag types |
| 101 | */ |
| 102 | |
| 103 | #define DEFINE_TAG_ARRAY_INTERFACE(Type, name) \ |
| 104 | DEFINE_ARRAY_INTERFACE (Type, name); \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 105 | inline const Tag& get_##name##_tag (unsigned int i) const { return (*this)[i].tag; } |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 106 | #define DEFINE_TAG_LIST_INTERFACE(Type, name) \ |
| 107 | DEFINE_LIST_INTERFACE (Type, name); \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 108 | inline const Tag& get_##name##_tag (unsigned int i) const { return (this+name##List).get_tag (i); } |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 109 | |
| 110 | #define DEFINE_TAG_FIND_INTERFACE(Type, name) \ |
Behdad Esfahbod | cc6c644 | 2009-05-25 03:10:06 -0400 | [diff] [blame] | 111 | inline bool find_##name##_index (hb_tag_t tag, unsigned int *index) const { \ |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 112 | const Tag t = tag; \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 113 | for (unsigned int i = 0; i < get_##name##_count (); i++) \ |
| 114 | { \ |
| 115 | if (t == get_##name##_tag (i)) \ |
| 116 | { \ |
Behdad Esfahbod | cc6c644 | 2009-05-25 03:10:06 -0400 | [diff] [blame] | 117 | if (index) *index = i; \ |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 118 | return true; \ |
| 119 | } \ |
| 120 | } \ |
Behdad Esfahbod | cc6c644 | 2009-05-25 03:10:06 -0400 | [diff] [blame] | 121 | if (index) *index = NO_INDEX; \ |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 122 | return false; \ |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 123 | } \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 124 | inline const Type& get_##name##_by_tag (hb_tag_t tag) const \ |
| 125 | { \ |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 126 | unsigned int i; \ |
| 127 | if (find_##name##_index (tag, &i)) \ |
| 128 | return get_##name (i); \ |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 129 | else \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 130 | return Null(Type); \ |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 131 | } |
Behdad Esfahbod | 600e5eb | 2008-01-23 02:01:37 -0500 | [diff] [blame] | 132 | |
| 133 | /* |
| 134 | * Class features |
| 135 | */ |
| 136 | |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 137 | |
| 138 | /* Null objects */ |
| 139 | |
| 140 | /* Global nul-content Null pool. Enlarge as necessary. */ |
| 141 | static const char NullPool[16] = ""; |
| 142 | |
| 143 | /* Generic template for nul-content sizeof-sized Null objects. */ |
| 144 | template <typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 145 | struct Null |
| 146 | { |
Behdad Esfahbod | f8dc67b | 2009-05-17 19:47:54 -0400 | [diff] [blame] | 147 | ASSERT_STATIC (sizeof (Type) <= sizeof (NullPool)); |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 148 | static inline const Type &get () { return *(const Type*)NullPool; } |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 149 | }; |
| 150 | |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 151 | /* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ |
| 152 | #define DEFINE_NULL_DATA(Type, size, data) \ |
Behdad Esfahbod | cc6c644 | 2009-05-25 03:10:06 -0400 | [diff] [blame] | 153 | static const char _Null##Type[size] = data; \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 154 | template <> \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 155 | struct Null <Type> \ |
| 156 | { \ |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 157 | static inline const Type &get () { return *(const Type*)_Null##Type; } \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | /* Accessor macro. */ |
| 161 | #define Null(Type) (Null<Type>::get()) |
| 162 | |
| 163 | |
| 164 | #define ASSERT_SIZE_DATA(Type, size, data) \ |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 165 | ASSERT_SIZE (Type, size); \ |
| 166 | DEFINE_NULL_DATA (Type, size, data) |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 167 | |
Behdad Esfahbod | 600e5eb | 2008-01-23 02:01:37 -0500 | [diff] [blame] | 168 | /* get_for_data() is a static class method returning a reference to an |
| 169 | * instance of Type located at the input data location. It's just a |
Behdad Esfahbod | 54e5aac | 2008-01-27 21:19:51 -0500 | [diff] [blame] | 170 | * fancy, NULL-safe, cast! */ |
Behdad Esfahbod | 600e5eb | 2008-01-23 02:01:37 -0500 | [diff] [blame] | 171 | #define STATIC_DEFINE_GET_FOR_DATA(Type) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 172 | static inline const Type& get_for_data (const char *data) \ |
| 173 | { \ |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 174 | if (HB_UNLIKELY (data == NULL)) return Null(Type); \ |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 175 | return *(const Type*)data; \ |
Behdad Esfahbod | 212aba6 | 2009-05-24 00:50:27 -0400 | [diff] [blame] | 176 | } |
| 177 | /* Like get_for_data(), but checks major version first. */ |
| 178 | #define STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION(Type, Major) \ |
| 179 | static inline const Type& get_for_data (const char *data) \ |
| 180 | { \ |
| 181 | if (HB_UNLIKELY (data == NULL)) return Null(Type); \ |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 182 | const Type& t = *(const Type*)data; \ |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 183 | if (HB_UNLIKELY (!t.version.major || t.version.major > Major)) return Null(Type); \ |
Behdad Esfahbod | 212aba6 | 2009-05-24 00:50:27 -0400 | [diff] [blame] | 184 | return t; \ |
| 185 | } |
Behdad Esfahbod | 600e5eb | 2008-01-23 02:01:37 -0500 | [diff] [blame] | 186 | |
| 187 | |
Behdad Esfahbod | 2d15e72 | 2009-04-15 19:50:16 -0400 | [diff] [blame] | 188 | |
Behdad Esfahbod | f78e70c | 2006-12-21 22:30:38 -0500 | [diff] [blame] | 189 | /* |
| 190 | * |
| 191 | * The OpenType Font File |
| 192 | * |
| 193 | */ |
| 194 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 195 | |
Behdad Esfahbod | f78e70c | 2006-12-21 22:30:38 -0500 | [diff] [blame] | 196 | /* |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 197 | * Data Types |
Behdad Esfahbod | f78e70c | 2006-12-21 22:30:38 -0500 | [diff] [blame] | 198 | */ |
| 199 | |
| 200 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 201 | /* "The following data types are used in the OpenType font file. |
| 202 | * All OpenType fonts use Motorola-style byte ordering (Big Endian):" */ |
Behdad Esfahbod | f78e70c | 2006-12-21 22:30:38 -0500 | [diff] [blame] | 203 | |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 204 | /* |
| 205 | * Int types |
| 206 | */ |
| 207 | |
Behdad Esfahbod | 20cc86b | 2009-05-25 02:41:49 -0400 | [diff] [blame] | 208 | /* TODO On machines that do not allow unaligned access, fix the accessors. */ |
| 209 | #define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN, BYTES) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 210 | struct NAME \ |
| 211 | { \ |
Behdad Esfahbod | 20cc86b | 2009-05-25 02:41:49 -0400 | [diff] [blame] | 212 | inline NAME& operator = (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \ |
| 213 | inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \ |
| 214 | inline bool operator== (NAME o) const { return (TYPE&) v == (TYPE&) o.v; } \ |
| 215 | private: char v[BYTES]; \ |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 216 | }; \ |
Behdad Esfahbod | 20cc86b | 2009-05-25 02:41:49 -0400 | [diff] [blame] | 217 | ASSERT_SIZE (NAME, BYTES) |
Behdad Esfahbod | df66028 | 2009-08-01 20:46:02 -0400 | [diff] [blame^] | 218 | #define DEFINE_INT_TYPE0(NAME, type, b) DEFINE_INT_TYPE1 (NAME, type##_t, hb_be_##type, b) |
| 219 | #define DEFINE_INT_TYPE(NAME, u, w) DEFINE_INT_TYPE0 (NAME, u##int##w, (w / 8)) |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 220 | |
Behdad Esfahbod | f78e70c | 2006-12-21 22:30:38 -0500 | [diff] [blame] | 221 | |
Behdad Esfahbod | 20cc86b | 2009-05-25 02:41:49 -0400 | [diff] [blame] | 222 | DEFINE_INT_TYPE (USHORT, u, 16); /* 16-bit unsigned integer. */ |
| 223 | DEFINE_INT_TYPE (SHORT, , 16); /* 16-bit signed integer. */ |
| 224 | DEFINE_INT_TYPE (ULONG, u, 32); /* 32-bit unsigned integer. */ |
| 225 | DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */ |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 226 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 227 | /* Array of four uint8s (length = 32 bits) used to identify a script, language |
| 228 | * system, feature, or baseline */ |
Behdad Esfahbod | 20cc86b | 2009-05-25 02:41:49 -0400 | [diff] [blame] | 229 | struct Tag : ULONG |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 230 | { |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 231 | inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; } |
| 232 | inline Tag (uint32_t i) { *(ULONG*)this = i; } |
| 233 | inline Tag (const char *c) { *(ULONG*)this = *(ULONG*)c; } |
| 234 | inline bool operator== (const char *c) const { return *(ULONG*)this == *(ULONG*)c; } |
Behdad Esfahbod | befc022 | 2006-12-25 09:14:52 -0500 | [diff] [blame] | 235 | /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 236 | inline operator const char* (void) const { return (const char *)this; } |
| 237 | inline operator char* (void) { return (char *)this; } |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 238 | }; |
Behdad Esfahbod | 303fe62 | 2008-01-23 00:20:48 -0500 | [diff] [blame] | 239 | ASSERT_SIZE (Tag, 4); |
Behdad Esfahbod | da1097b | 2009-05-17 19:31:18 -0400 | [diff] [blame] | 240 | #define _NULL_TAG_INIT {' ', ' ', ' ', ' '} |
| 241 | DEFINE_NULL_DATA (Tag, 4, _NULL_TAG_INIT); |
| 242 | #undef _NULL_TAG_INIT |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 243 | |
| 244 | /* Glyph index number, same as uint16 (length = 16 bits) */ |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 245 | typedef USHORT GlyphID; |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 246 | |
Behdad Esfahbod | 1f437e6 | 2008-01-23 04:36:40 -0500 | [diff] [blame] | 247 | /* Offset to a table, same as uint16 (length = 16 bits), Null offset = 0x0000 */ |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 248 | typedef USHORT Offset; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 249 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 250 | /* LongOffset to a table, same as uint32 (length = 32 bits), Null offset = 0x00000000 */ |
| 251 | typedef ULONG LongOffset; |
| 252 | |
| 253 | /* Template subclasses of Offset and LongOffset that do the dereferencing. Use: (this+memberName) */ |
| 254 | |
Behdad Esfahbod | 9e4d9d7 | 2009-05-17 00:09:20 -0400 | [diff] [blame] | 255 | template <typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 256 | struct OffsetTo : Offset |
| 257 | { |
| 258 | inline const Type& operator() (const void *base) const |
| 259 | { |
Behdad Esfahbod | 9e4d9d7 | 2009-05-17 00:09:20 -0400 | [diff] [blame] | 260 | unsigned int offset = *this; |
| 261 | if (HB_UNLIKELY (!offset)) return Null(Type); |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 262 | return *(const Type*)((const char *) base + offset); |
Behdad Esfahbod | 9e4d9d7 | 2009-05-17 00:09:20 -0400 | [diff] [blame] | 263 | } |
| 264 | }; |
Behdad Esfahbod | 9e4d9d7 | 2009-05-17 00:09:20 -0400 | [diff] [blame] | 265 | template <typename Base, typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 266 | inline const Type& operator + (const Base &base, OffsetTo<Type> offset) { return offset (base); } |
Behdad Esfahbod | 9e4d9d7 | 2009-05-17 00:09:20 -0400 | [diff] [blame] | 267 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 268 | template <typename Type> |
| 269 | struct LongOffsetTo : LongOffset |
| 270 | { |
| 271 | inline const Type& operator() (const void *base) const |
| 272 | { |
| 273 | unsigned int offset = *this; |
| 274 | if (HB_UNLIKELY (!offset)) return Null(Type); |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 275 | return *(const Type*)((const char *) base + offset); |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 276 | } |
| 277 | }; |
| 278 | template <typename Base, typename Type> |
| 279 | inline const Type& operator + (const Base &base, LongOffsetTo<Type> offset) { return offset (base); } |
| 280 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 281 | |
| 282 | /* CheckSum */ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 283 | struct CheckSum : ULONG |
| 284 | { |
| 285 | static uint32_t CalcTableChecksum (ULONG *Table, uint32_t Length) |
| 286 | { |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 287 | uint32_t Sum = 0L; |
Behdad Esfahbod | 01e4fcb | 2006-12-21 22:31:31 -0500 | [diff] [blame] | 288 | ULONG *EndPtr = Table+((Length+3) & ~3) / sizeof(ULONG); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 289 | |
| 290 | while (Table < EndPtr) |
| 291 | Sum += *Table++; |
| 292 | return Sum; |
| 293 | } |
| 294 | }; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 295 | ASSERT_SIZE (CheckSum, 4); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 296 | |
| 297 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 298 | /* |
| 299 | * Version Numbers |
| 300 | */ |
| 301 | |
Behdad Esfahbod | 87fcdcb | 2009-05-24 01:03:24 -0400 | [diff] [blame] | 302 | struct FixedVersion |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 303 | { |
Behdad Esfahbod | 09c292e | 2009-05-26 19:48:16 -0400 | [diff] [blame] | 304 | inline operator uint32_t (void) const { return (major << 16) + minor; } |
Behdad Esfahbod | 96908b8 | 2009-05-24 12:30:40 -0400 | [diff] [blame] | 305 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 306 | USHORT major; |
Behdad Esfahbod | 87fcdcb | 2009-05-24 01:03:24 -0400 | [diff] [blame] | 307 | USHORT minor; |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 308 | }; |
Behdad Esfahbod | 87fcdcb | 2009-05-24 01:03:24 -0400 | [diff] [blame] | 309 | ASSERT_SIZE (FixedVersion, 4); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 310 | |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 311 | /* |
| 312 | * Array Types |
| 313 | */ |
| 314 | |
| 315 | /* An array with a USHORT number of elements. */ |
| 316 | template <typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 317 | struct ArrayOf |
| 318 | { |
| 319 | inline const Type& operator [] (unsigned int i) const |
| 320 | { |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 321 | if (HB_UNLIKELY (i >= len)) return Null(Type); |
| 322 | return array[i]; |
| 323 | } |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 324 | inline unsigned int get_size () const |
Behdad Esfahbod | 79420ad | 2009-05-26 12:24:16 -0400 | [diff] [blame] | 325 | { return sizeof (len) + len * sizeof (array[0]); } |
Behdad Esfahbod | e8cbaaf | 2009-05-18 02:03:58 -0400 | [diff] [blame] | 326 | |
| 327 | USHORT len; |
| 328 | Type array[]; |
| 329 | }; |
| 330 | |
| 331 | /* An array with a USHORT number of elements, |
| 332 | * starting at second element. */ |
| 333 | template <typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 334 | struct HeadlessArrayOf |
| 335 | { |
| 336 | inline const Type& operator [] (unsigned int i) const |
| 337 | { |
Behdad Esfahbod | e8cbaaf | 2009-05-18 02:03:58 -0400 | [diff] [blame] | 338 | if (HB_UNLIKELY (i >= len || !i)) return Null(Type); |
| 339 | return array[i-1]; |
| 340 | } |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 341 | inline unsigned int get_size () const |
Behdad Esfahbod | 79420ad | 2009-05-26 12:24:16 -0400 | [diff] [blame] | 342 | { return sizeof (len) + (len ? len - 1 : 0) * sizeof (array[0]); } |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 343 | |
| 344 | USHORT len; |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 345 | Type array[]; |
| 346 | }; |
| 347 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 348 | /* An array with a ULONG number of elements. */ |
| 349 | template <typename Type> |
| 350 | struct LongArrayOf |
| 351 | { |
| 352 | inline const Type& operator [] (unsigned int i) const |
| 353 | { |
| 354 | if (HB_UNLIKELY (i >= len)) return Null(Type); |
| 355 | return array[i]; |
| 356 | } |
| 357 | inline unsigned int get_size () const |
Behdad Esfahbod | 79420ad | 2009-05-26 12:24:16 -0400 | [diff] [blame] | 358 | { return sizeof (len) + len * sizeof (array[0]); } |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 359 | |
| 360 | ULONG len; |
| 361 | Type array[]; |
| 362 | }; |
| 363 | |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 364 | /* Array of Offset's */ |
| 365 | template <typename Type> |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 366 | struct OffsetArrayOf : ArrayOf<OffsetTo<Type> > {}; |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 367 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 368 | /* Array of LongOffset's */ |
| 369 | template <typename Type> |
| 370 | struct LongOffsetArrayOf : ArrayOf<LongOffsetTo<Type> > {}; |
| 371 | |
| 372 | /* LongArray of LongOffset's */ |
| 373 | template <typename Type> |
| 374 | struct LongOffsetLongArrayOf : LongArrayOf<LongOffsetTo<Type> > {}; |
| 375 | |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 376 | /* An array type is one that contains a variable number of objects |
| 377 | * as its last item. An array object is extended with get_len() |
| 378 | * methods, as well as overloaded [] operator. */ |
| 379 | #define DEFINE_ARRAY_TYPE(Type, array, num) \ |
| 380 | DEFINE_INDEX_OPERATOR(Type, array, num) \ |
| 381 | DEFINE_LEN(Type, array, num) |
| 382 | #define DEFINE_INDEX_OPERATOR(Type, array, num) \ |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 383 | inline const Type& operator[] (unsigned int i) const \ |
| 384 | { \ |
Behdad Esfahbod | 5f81036 | 2009-05-17 00:54:25 -0400 | [diff] [blame] | 385 | if (HB_UNLIKELY (i >= num)) return Null(Type); \ |
| 386 | return array[i]; \ |
| 387 | } |
| 388 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 389 | |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 390 | /* |
| 391 | * Organization of an OpenType Font |
| 392 | */ |
| 393 | |
Behdad Esfahbod | 3158d84 | 2006-12-27 20:08:07 -0500 | [diff] [blame] | 394 | struct OpenTypeFontFile; |
Behdad Esfahbod | b739c05 | 2006-12-25 05:39:20 -0500 | [diff] [blame] | 395 | struct OffsetTable; |
| 396 | struct TTCHeader; |
| 397 | |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 398 | typedef struct TableDirectory |
| 399 | { |
Behdad Esfahbod | 01e4fcb | 2006-12-21 22:31:31 -0500 | [diff] [blame] | 400 | Tag tag; /* 4-byte identifier. */ |
| 401 | CheckSum checkSum; /* CheckSum for this table. */ |
| 402 | ULONG offset; /* Offset from beginning of TrueType font |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 403 | * file. */ |
Behdad Esfahbod | 01e4fcb | 2006-12-21 22:31:31 -0500 | [diff] [blame] | 404 | ULONG length; /* Length of this table. */ |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 405 | } OpenTypeTable; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 406 | ASSERT_SIZE (TableDirectory, 16); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 407 | |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 408 | typedef struct OffsetTable |
| 409 | { |
Behdad Esfahbod | 7586089 | 2008-01-23 18:02:28 -0500 | [diff] [blame] | 410 | friend struct OpenTypeFontFile; |
| 411 | friend struct TTCHeader; |
| 412 | |
Behdad Esfahbod | 40a8131 | 2008-01-28 02:30:48 -0500 | [diff] [blame] | 413 | DEFINE_TAG_ARRAY_INTERFACE (OpenTypeTable, table); /* get_table_count(), get_table(i), get_table_tag(i) */ |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 414 | DEFINE_TAG_FIND_INTERFACE (OpenTypeTable, table); /* find_table_index(tag), get_table_by_tag(tag) */ |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 415 | |
| 416 | private: |
Behdad Esfahbod | befc022 | 2006-12-25 09:14:52 -0500 | [diff] [blame] | 417 | /* OpenTypeTables, in no particular order */ |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 418 | DEFINE_ARRAY_TYPE (TableDirectory, tableDir, numTables); |
| 419 | |
Behdad Esfahbod | 303fe62 | 2008-01-23 00:20:48 -0500 | [diff] [blame] | 420 | private: |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 421 | Tag sfnt_version; /* '\0\001\0\00' if TrueType / 'OTTO' if CFF */ |
| 422 | USHORT numTables; /* Number of tables. */ |
| 423 | USHORT searchRange; /* (Maximum power of 2 <= numTables) x 16 */ |
| 424 | USHORT entrySelector; /* Log2(maximum power of 2 <= numTables). */ |
| 425 | USHORT rangeShift; /* NumTables x 16-searchRange. */ |
| 426 | TableDirectory tableDir[]; /* TableDirectory entries. numTables items */ |
Behdad Esfahbod | 1334661 | 2006-12-27 19:58:32 -0500 | [diff] [blame] | 427 | } OpenTypeFontFace; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 428 | ASSERT_SIZE (OffsetTable, 12); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 429 | |
| 430 | /* |
| 431 | * TrueType Collections |
| 432 | */ |
| 433 | |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 434 | struct TTCHeader |
| 435 | { |
Behdad Esfahbod | 7586089 | 2008-01-23 18:02:28 -0500 | [diff] [blame] | 436 | friend struct OpenTypeFontFile; |
| 437 | |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 438 | STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION (TTCHeader, 2); |
Behdad Esfahbod | b6e62bc | 2006-12-22 02:21:55 -0500 | [diff] [blame] | 439 | |
Behdad Esfahbod | 303fe62 | 2008-01-23 00:20:48 -0500 | [diff] [blame] | 440 | private: |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 441 | Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ |
| 442 | FixedVersion version; /* Version of the TTC Header (1.0 or 2.0), |
| 443 | * 0x00010000 or 0x00020000 */ |
| 444 | LongOffsetLongArrayOf<OffsetTable> |
| 445 | table; /* Array of offsets to the OffsetTable for each font |
| 446 | * from the beginning of the file */ |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 447 | }; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 448 | ASSERT_SIZE (TTCHeader, 12); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 449 | |
| 450 | |
Behdad Esfahbod | b739c05 | 2006-12-25 05:39:20 -0500 | [diff] [blame] | 451 | /* |
| 452 | * OpenType Font File |
| 453 | */ |
| 454 | |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 455 | struct OpenTypeFontFile |
| 456 | { |
Behdad Esfahbod | c81efca | 2006-12-25 06:22:08 -0500 | [diff] [blame] | 457 | static const hb_tag_t TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ); |
| 458 | static const hb_tag_t CFFTag = HB_TAG ('O','T','T','O'); |
| 459 | static const hb_tag_t TTCTag = HB_TAG ('t','t','c','f'); |
Behdad Esfahbod | b739c05 | 2006-12-25 05:39:20 -0500 | [diff] [blame] | 460 | |
Behdad Esfahbod | 600e5eb | 2008-01-23 02:01:37 -0500 | [diff] [blame] | 461 | STATIC_DEFINE_GET_FOR_DATA (OpenTypeFontFile); |
Behdad Esfahbod | b739c05 | 2006-12-25 05:39:20 -0500 | [diff] [blame] | 462 | |
Behdad Esfahbod | 3ec0092 | 2009-05-25 02:34:25 -0400 | [diff] [blame] | 463 | unsigned int get_face_count (void) const |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 464 | { |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 465 | switch (tag) { |
| 466 | default: return 0; |
Behdad Esfahbod | c81efca | 2006-12-25 06:22:08 -0500 | [diff] [blame] | 467 | case TrueTypeTag: case CFFTag: return 1; |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 468 | case TTCTag: return TTCHeader::get_for_data ((const char *) this).table.len; |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 469 | } |
| 470 | } |
Behdad Esfahbod | 3ec0092 | 2009-05-25 02:34:25 -0400 | [diff] [blame] | 471 | const OpenTypeFontFace& get_face (unsigned int i) const |
Behdad Esfahbod | 60d77cf | 2009-05-19 23:58:54 -0400 | [diff] [blame] | 472 | { |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 473 | switch (tag) { |
Behdad Esfahbod | 23af767 | 2009-08-01 19:10:41 -0400 | [diff] [blame] | 474 | default: return Null(OpenTypeFontFace); |
| 475 | /* Note: for non-collection SFNT data we ignore index. This is because |
| 476 | * Apple dfont container is a container of SFNT's. So each SFNT is a |
| 477 | * non-TTC, but the index is more than zero. */ |
Behdad Esfahbod | 4497af0 | 2009-05-25 03:20:18 -0400 | [diff] [blame] | 478 | case TrueTypeTag: case CFFTag: return *(const OffsetTable*)this; |
Behdad Esfahbod | 6ad8d5f | 2009-05-25 02:27:29 -0400 | [diff] [blame] | 479 | case TTCTag: return this+TTCHeader::get_for_data ((const char *) this).table[i]; |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 480 | } |
| 481 | } |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 482 | |
Behdad Esfahbod | 3ec0092 | 2009-05-25 02:34:25 -0400 | [diff] [blame] | 483 | /* This is how you get a table */ |
| 484 | inline const char* get_table_data (const OpenTypeTable& table) const |
| 485 | { |
| 486 | if (HB_UNLIKELY (table.offset == 0)) return NULL; |
| 487 | return ((const char*) this) + table.offset; |
| 488 | } |
| 489 | |
Behdad Esfahbod | 808dbe2 | 2006-12-25 06:18:52 -0500 | [diff] [blame] | 490 | Tag tag; /* 4-byte identifier. */ |
Behdad Esfahbod | b739c05 | 2006-12-25 05:39:20 -0500 | [diff] [blame] | 491 | }; |
Behdad Esfahbod | 8b83580 | 2009-05-16 22:48:14 -0400 | [diff] [blame] | 492 | ASSERT_SIZE (OpenTypeFontFile, 4); |
Behdad Esfahbod | 6b4ce01 | 2006-12-21 22:31:10 -0500 | [diff] [blame] | 493 | |
| 494 | |
Behdad Esfahbod | 8dd1c8b | 2008-01-23 05:00:30 -0500 | [diff] [blame] | 495 | #endif /* HB_OT_LAYOUT_OPEN_PRIVATE_H */ |