OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2010 Red Hat, Inc. | 2 * Copyright © 2010 Red Hat, Inc. |
3 * Copyright © 2012 Google, Inc. | 3 * Copyright © 2012 Google, Inc. |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 inline unsigned int get_upem (void) const | 48 inline unsigned int get_upem (void) const |
49 { | 49 { |
50 unsigned int upem = unitsPerEm; | 50 unsigned int upem = unitsPerEm; |
51 /* If no valid head table found, assume 1000, which matches typical Type1 us
age. */ | 51 /* If no valid head table found, assume 1000, which matches typical Type1 us
age. */ |
52 return 16 <= upem && upem <= 16384 ? upem : 1000; | 52 return 16 <= upem && upem <= 16384 ? upem : 1000; |
53 } | 53 } |
54 | 54 |
55 inline bool sanitize (hb_sanitize_context_t *c) const | 55 inline bool sanitize (hb_sanitize_context_t *c) const |
56 { | 56 { |
57 TRACE_SANITIZE (this); | 57 TRACE_SANITIZE (this); |
58 return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1)); | 58 return_trace (c->check_struct (this) && likely (version.major == 1)); |
59 } | 59 } |
60 | 60 |
61 protected: | 61 protected: |
62 FixedVersion version; /* Version of the head table--currently | 62 FixedVersion version; /* Version of the head table--currently |
63 * 0x00010000u for version 1.0. */ | 63 * 0x00010000u for version 1.0. */ |
64 FixedVersion fontRevision; /* Set by font manufacturer. */ | 64 FixedVersion fontRevision; /* Set by font manufacturer. */ |
65 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the | 65 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the |
66 * entire font as ULONG, then store | 66 * entire font as ULONG, then store |
67 * 0xB1B0AFBAu - sum. */ | 67 * 0xB1B0AFBAu - sum. */ |
68 ULONG magicNumber; /* Set to 0x5F0F3CF5u. */ | 68 ULONG magicNumber; /* Set to 0x5F0F3CF5u. */ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * Bit 5: Condensed (if set to 1) | 131 * Bit 5: Condensed (if set to 1) |
132 * Bit 6: Extended (if set to 1) | 132 * Bit 6: Extended (if set to 1) |
133 * Bits 7-15: Reserved (set to 0). */ | 133 * Bits 7-15: Reserved (set to 0). */ |
134 USHORT lowestRecPPEM; /* Smallest readable size in pixels. */ | 134 USHORT lowestRecPPEM; /* Smallest readable size in pixels. */ |
135 SHORT fontDirectionHint; /* Deprecated (Set to 2). | 135 SHORT fontDirectionHint; /* Deprecated (Set to 2). |
136 * 0: Fully mixed directional glyphs; | 136 * 0: Fully mixed directional glyphs; |
137 * 1: Only strongly left to right; | 137 * 1: Only strongly left to right; |
138 * 2: Like 1 but also contains neutrals; | 138 * 2: Like 1 but also contains neutrals; |
139 * -1: Only strongly right to left; | 139 * -1: Only strongly right to left; |
140 * -2: Like -1 but also contains neutral
s. */ | 140 * -2: Like -1 but also contains neutral
s. */ |
| 141 public: |
141 SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */ | 142 SHORT indexToLocFormat; /* 0 for short offsets, 1 for long. */ |
142 SHORT glyphDataFormat; /* 0 for current format. */ | 143 SHORT glyphDataFormat; /* 0 for current format. */ |
143 public: | 144 |
144 DEFINE_SIZE_STATIC (54); | 145 DEFINE_SIZE_STATIC (54); |
145 }; | 146 }; |
146 | 147 |
147 | 148 |
148 } /* namespace OT */ | 149 } /* namespace OT */ |
149 | 150 |
150 | 151 |
151 #endif /* HB_OT_HEAD_TABLE_HH */ | 152 #endif /* HB_OT_HEAD_TABLE_HH */ |
OLD | NEW |