| 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 (c->check_struct (this) && likely (version.major == 1)); | 58 return_trace (c->check_struct (this) && |
| 59 » » version.major == 1 && |
| 60 » » magicNumber == 0x5F0F3CF5u); |
| 59 } | 61 } |
| 60 | 62 |
| 61 protected: | 63 protected: |
| 62 FixedVersion version; /* Version of the head table--currently | 64 FixedVersion version; /* Version of the head table--currently |
| 63 * 0x00010000u for version 1.0. */ | 65 * 0x00010000u for version 1.0. */ |
| 64 FixedVersion fontRevision; /* Set by font manufacturer. */ | 66 FixedVersion fontRevision; /* Set by font manufacturer. */ |
| 65 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the | 67 ULONG checkSumAdjustment; /* To compute: set it to 0, sum the |
| 66 * entire font as ULONG, then store | 68 * entire font as ULONG, then store |
| 67 * 0xB1B0AFBAu - sum. */ | 69 * 0xB1B0AFBAu - sum. */ |
| 68 ULONG magicNumber; /* Set to 0x5F0F3CF5u. */ | 70 ULONG magicNumber; /* Set to 0x5F0F3CF5u. */ |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 SHORT glyphDataFormat; /* 0 for current format. */ | 145 SHORT glyphDataFormat; /* 0 for current format. */ |
| 144 | 146 |
| 145 DEFINE_SIZE_STATIC (54); | 147 DEFINE_SIZE_STATIC (54); |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 | 150 |
| 149 } /* namespace OT */ | 151 } /* namespace OT */ |
| 150 | 152 |
| 151 | 153 |
| 152 #endif /* HB_OT_HEAD_TABLE_HH */ | 154 #endif /* HB_OT_HEAD_TABLE_HH */ |
| OLD | NEW |