OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2011,2012 Google, Inc. | 2 * Copyright © 2011,2012 Google, 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. |
(...skipping 25 matching lines...) Expand all Loading... |
36 /* | 36 /* |
37 * maxp -- The Maximum Profile Table | 37 * maxp -- The Maximum Profile Table |
38 */ | 38 */ |
39 | 39 |
40 #define HB_OT_TAG_maxp HB_TAG('m','a','x','p') | 40 #define HB_OT_TAG_maxp HB_TAG('m','a','x','p') |
41 | 41 |
42 struct maxp | 42 struct maxp |
43 { | 43 { |
44 static const hb_tag_t tableTag = HB_OT_TAG_maxp; | 44 static const hb_tag_t tableTag = HB_OT_TAG_maxp; |
45 | 45 |
46 inline unsigned int get_num_glyphs (void) const { | 46 inline unsigned int get_num_glyphs (void) const |
| 47 { |
47 return numGlyphs; | 48 return numGlyphs; |
48 } | 49 } |
49 | 50 |
50 inline bool sanitize (hb_sanitize_context_t *c) { | 51 inline bool sanitize (hb_sanitize_context_t *c) const |
| 52 { |
51 TRACE_SANITIZE (this); | 53 TRACE_SANITIZE (this); |
52 return TRACE_RETURN (c->check_struct (this) && | 54 return TRACE_RETURN (c->check_struct (this) && |
53 likely (version.major == 1 || (version.major == 0 && ve
rsion.minor == 0x5000u))); | 55 likely (version.major == 1 || (version.major == 0 && ve
rsion.minor == 0x5000u))); |
54 } | 56 } |
55 | 57 |
56 /* We only implement version 0.5 as none of the extra fields in version 1.0 ar
e useful. */ | 58 /* We only implement version 0.5 as none of the extra fields in version 1.0 ar
e useful. */ |
57 protected: | 59 protected: |
58 FixedVersion version; /* Version of the maxp table (0.5 or 1.0
), | 60 FixedVersion version; /* Version of the maxp table (0.5 or 1.0
), |
59 * 0x00005000u or 0x00010000u. */ | 61 * 0x00005000u or 0x00010000u. */ |
60 USHORT numGlyphs; /* The number of glyphs in the font. */ | 62 USHORT numGlyphs; /* The number of glyphs in the font. */ |
61 public: | 63 public: |
62 DEFINE_SIZE_STATIC (6); | 64 DEFINE_SIZE_STATIC (6); |
63 }; | 65 }; |
64 | 66 |
65 | 67 |
66 } /* namespace OT */ | 68 } /* namespace OT */ |
67 | 69 |
68 | 70 |
69 #endif /* HB_OT_MAXP_TABLE_HH */ | 71 #endif /* HB_OT_MAXP_TABLE_HH */ |
OLD | NEW |