| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Red Hat, Inc. | 2 * Copyright © 2010 Red Hat, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| 11 * | 11 * |
| 12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR | 12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
| 13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES | 13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
| 14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN | 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 | 15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 16 * DAMAGE. | 16 * DAMAGE. |
| 17 * | 17 * |
| 18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, | 18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
| 19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | 19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS | 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 | 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
| 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 23 * | 23 * |
| 24 * Red Hat Author(s): Behdad Esfahbod | 24 * Red Hat Author(s): Behdad Esfahbod |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef HB_OT_HEAD_PRIVATE_HH | 27 #ifndef HB_OT_HEAD_TABLE_HH |
| 28 #define HB_OT_HEAD_PRIVATE_HH | 28 #define HB_OT_HEAD_TABLE_HH |
| 29 | 29 |
| 30 #include "hb-open-type-private.hh" | 30 #include "hb-open-type-private.hh" |
| 31 | 31 |
| 32 HB_BEGIN_DECLS | |
| 33 | 32 |
| 34 | 33 |
| 35 /* | 34 /* |
| 36 * head | 35 * head -- Font Header |
| 37 */ | 36 */ |
| 38 | 37 |
| 39 #define HB_OT_TAG_head HB_TAG('h','e','a','d') | 38 #define HB_OT_TAG_head HB_TAG('h','e','a','d') |
| 40 | 39 |
| 41 struct head | 40 struct head |
| 42 { | 41 { |
| 43 static const hb_tag_t Tag = HB_OT_TAG_head; | 42 static const hb_tag_t Tag = HB_OT_TAG_head; |
| 44 | 43 |
| 45 inline unsigned int get_upem (void) const { | 44 inline unsigned int get_upem (void) const { |
| 46 unsigned int upem = unitsPerEm; | 45 unsigned int upem = unitsPerEm; |
| 47 /* If no valid head table found, assume 1000, which matches typicaly Type1 u
sage. */ | 46 /* If no valid head table found, assume 1000, which matches typicaly Type1 u
sage. */ |
| 48 return 16 <= upem && upem <= 16384 ? upem : 1000; | 47 return 16 <= upem && upem <= 16384 ? upem : 1000; |
| 49 } | 48 } |
| 50 | 49 |
| 51 inline bool sanitize (hb_sanitize_context_t *c) { | 50 inline bool sanitize (hb_sanitize_context_t *c) { |
| 52 TRACE_SANITIZE (); | 51 TRACE_SANITIZE (); |
| 53 /* Shall we check for magicNumber here? Who cares? */ | |
| 54 return c->check_struct (this) && likely (version.major == 1); | 52 return c->check_struct (this) && likely (version.major == 1); |
| 55 } | 53 } |
| 56 | 54 |
| 57 private: | 55 private: |
| 58 FixedVersion version; /* Version of the head table--currently | 56 FixedVersion version; /* Version of the head table--currently |
| 59 * 0x00010000 for version 1.0. */ | 57 * 0x00010000 for version 1.0. */ |
| 60 FixedVersion fontRevision; /* Set by font manufacturer. */ | 58 FixedVersion fontRevision; /* Set by font manufacturer. */ |
| 61 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the | 59 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the |
| 62 * entire font as ULONG, then store | 60 * entire font as ULONG, then store |
| 63 * 0xB1B0AFBA - sum. */ | 61 * 0xB1B0AFBA - sum. */ |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 * 2: Like 1 but also contains neutrals; | 132 * 2: Like 1 but also contains neutrals; |
| 135 * -1: Only strongly right to left; | 133 * -1: Only strongly right to left; |
| 136 * -2: Like -1 but also contains neutral
s. */ | 134 * -2: Like -1 but also contains neutral
s. */ |
| 137 SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */ | 135 SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */ |
| 138 SHORT glyphDataFormat; /* 0 for current format. */ | 136 SHORT glyphDataFormat; /* 0 for current format. */ |
| 139 public: | 137 public: |
| 140 DEFINE_SIZE_STATIC (54); | 138 DEFINE_SIZE_STATIC (54); |
| 141 }; | 139 }; |
| 142 | 140 |
| 143 | 141 |
| 144 HB_END_DECLS | |
| 145 | 142 |
| 146 #endif /* HB_OT_HEAD_PRIVATE_HH */ | 143 #endif /* HB_OT_HEAD_TABLE_HH */ |
| OLD | NEW |