| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2013 Google, Inc. | 2 * Copyright © 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 typedef OffsetListOf<PosLookup> JstfMax; | 48 typedef OffsetListOf<PosLookup> JstfMax; |
| 49 | 49 |
| 50 | 50 |
| 51 /* | 51 /* |
| 52 * JstfPriority -- Justification Priority Table | 52 * JstfPriority -- Justification Priority Table |
| 53 */ | 53 */ |
| 54 | 54 |
| 55 struct JstfPriority | 55 struct JstfPriority |
| 56 { | 56 { |
| 57 inline bool sanitize (hb_sanitize_context_t *c) { | 57 inline bool sanitize (hb_sanitize_context_t *c) const |
| 58 { |
| 58 TRACE_SANITIZE (this); | 59 TRACE_SANITIZE (this); |
| 59 return TRACE_RETURN (c->check_struct (this) && | 60 return TRACE_RETURN (c->check_struct (this) && |
| 60 shrinkageEnableGSUB.sanitize (c, this) && | 61 shrinkageEnableGSUB.sanitize (c, this) && |
| 61 shrinkageDisableGSUB.sanitize (c, this) && | 62 shrinkageDisableGSUB.sanitize (c, this) && |
| 62 shrinkageEnableGPOS.sanitize (c, this) && | 63 shrinkageEnableGPOS.sanitize (c, this) && |
| 63 shrinkageDisableGPOS.sanitize (c, this) && | 64 shrinkageDisableGPOS.sanitize (c, this) && |
| 64 shrinkageJstfMax.sanitize (c, this) && | 65 shrinkageJstfMax.sanitize (c, this) && |
| 65 extensionEnableGSUB.sanitize (c, this) && | 66 extensionEnableGSUB.sanitize (c, this) && |
| 66 extensionDisableGSUB.sanitize (c, this) && | 67 extensionDisableGSUB.sanitize (c, this) && |
| 67 extensionEnableGPOS.sanitize (c, this) && | 68 extensionEnableGPOS.sanitize (c, this) && |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 | 119 |
| 119 /* | 120 /* |
| 120 * JstfLangSys -- Justification Language System Table | 121 * JstfLangSys -- Justification Language System Table |
| 121 */ | 122 */ |
| 122 | 123 |
| 123 struct JstfLangSys : OffsetListOf<JstfPriority> | 124 struct JstfLangSys : OffsetListOf<JstfPriority> |
| 124 { | 125 { |
| 125 inline bool sanitize (hb_sanitize_context_t *c, | 126 inline bool sanitize (hb_sanitize_context_t *c, |
| 126 » » » const Record<JstfLangSys>::sanitize_closure_t * = NULL)
{ | 127 » » » const Record<JstfLangSys>::sanitize_closure_t * = NULL)
const |
| 128 { |
| 127 TRACE_SANITIZE (this); | 129 TRACE_SANITIZE (this); |
| 128 return TRACE_RETURN (OffsetListOf<JstfPriority>::sanitize (c)); | 130 return TRACE_RETURN (OffsetListOf<JstfPriority>::sanitize (c)); |
| 129 } | 131 } |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 | 134 |
| 133 /* | 135 /* |
| 134 * ExtenderGlyphs -- Extender Glyph Table | 136 * ExtenderGlyphs -- Extender Glyph Table |
| 135 */ | 137 */ |
| 136 | 138 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 156 if (i == Index::NOT_FOUND_INDEX) return get_default_lang_sys (); | 158 if (i == Index::NOT_FOUND_INDEX) return get_default_lang_sys (); |
| 157 return this+langSys[i].offset; | 159 return this+langSys[i].offset; |
| 158 } | 160 } |
| 159 inline bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const | 161 inline bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const |
| 160 { return langSys.find_index (tag, index); } | 162 { return langSys.find_index (tag, index); } |
| 161 | 163 |
| 162 inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } | 164 inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } |
| 163 inline const JstfLangSys& get_default_lang_sys (void) const { return this+defa
ultLangSys; } | 165 inline const JstfLangSys& get_default_lang_sys (void) const { return this+defa
ultLangSys; } |
| 164 | 166 |
| 165 inline bool sanitize (hb_sanitize_context_t *c, | 167 inline bool sanitize (hb_sanitize_context_t *c, |
| 166 » » » const Record<JstfScript>::sanitize_closure_t * = NULL) { | 168 » » » const Record<JstfScript>::sanitize_closure_t * = NULL) c
onst |
| 169 { |
| 167 TRACE_SANITIZE (this); | 170 TRACE_SANITIZE (this); |
| 168 return TRACE_RETURN (extenderGlyphs.sanitize (c, this) && | 171 return TRACE_RETURN (extenderGlyphs.sanitize (c, this) && |
| 169 defaultLangSys.sanitize (c, this) && | 172 defaultLangSys.sanitize (c, this) && |
| 170 langSys.sanitize (c, this)); | 173 langSys.sanitize (c, this)); |
| 171 } | 174 } |
| 172 | 175 |
| 173 protected: | 176 protected: |
| 174 OffsetTo<ExtenderGlyphs> | 177 OffsetTo<ExtenderGlyphs> |
| 175 extenderGlyphs; /* Offset to ExtenderGlyph table--from beginning | 178 extenderGlyphs; /* Offset to ExtenderGlyph table--from beginning |
| 176 * of JstfScript table-may be NULL */ | 179 * of JstfScript table-may be NULL */ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 199 { return scriptList.get_tag (i); } | 202 { return scriptList.get_tag (i); } |
| 200 inline unsigned int get_script_tags (unsigned int start_offset, | 203 inline unsigned int get_script_tags (unsigned int start_offset, |
| 201 unsigned int *script_count /* IN/OUT */, | 204 unsigned int *script_count /* IN/OUT */, |
| 202 hb_tag_t *script_tags /* OUT */) cons
t | 205 hb_tag_t *script_tags /* OUT */) cons
t |
| 203 { return scriptList.get_tags (start_offset, script_count, script_tags); } | 206 { return scriptList.get_tags (start_offset, script_count, script_tags); } |
| 204 inline const JstfScript& get_script (unsigned int i) const | 207 inline const JstfScript& get_script (unsigned int i) const |
| 205 { return this+scriptList[i].offset; } | 208 { return this+scriptList[i].offset; } |
| 206 inline bool find_script_index (hb_tag_t tag, unsigned int *index) const | 209 inline bool find_script_index (hb_tag_t tag, unsigned int *index) const |
| 207 { return scriptList.find_index (tag, index); } | 210 { return scriptList.find_index (tag, index); } |
| 208 | 211 |
| 209 inline bool sanitize (hb_sanitize_context_t *c) { | 212 inline bool sanitize (hb_sanitize_context_t *c) const |
| 213 { |
| 210 TRACE_SANITIZE (this); | 214 TRACE_SANITIZE (this); |
| 211 return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) && | 215 return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) && |
| 212 scriptList.sanitize (c, this)); | 216 scriptList.sanitize (c, this)); |
| 213 } | 217 } |
| 214 | 218 |
| 215 protected: | 219 protected: |
| 216 FixedVersion version; /* Version of the JSTF table--initially set | 220 FixedVersion version; /* Version of the JSTF table--initially set |
| 217 * to 0x00010000u */ | 221 * to 0x00010000u */ |
| 218 RecordArrayOf<JstfScript> | 222 RecordArrayOf<JstfScript> |
| 219 scriptList; /* Array of JstfScripts--listed | 223 scriptList; /* Array of JstfScripts--listed |
| 220 * alphabetically by ScriptTag */ | 224 * alphabetically by ScriptTag */ |
| 221 public: | 225 public: |
| 222 DEFINE_SIZE_ARRAY (6, scriptList); | 226 DEFINE_SIZE_ARRAY (6, scriptList); |
| 223 }; | 227 }; |
| 224 | 228 |
| 225 | 229 |
| 226 } /* namespace OT */ | 230 } /* namespace OT */ |
| 227 | 231 |
| 228 | 232 |
| 229 #endif /* HB_OT_LAYOUT_JSTF_TABLE_HH */ | 233 #endif /* HB_OT_LAYOUT_JSTF_TABLE_HH */ |
| OLD | NEW |