| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) const | 57 inline bool sanitize (hb_sanitize_context_t *c) const |
| 58 { | 58 { |
| 59 TRACE_SANITIZE (this); | 59 TRACE_SANITIZE (this); |
| 60 return TRACE_RETURN (c->check_struct (this) && | 60 return_trace (c->check_struct (this) && |
| 61 » » » shrinkageEnableGSUB.sanitize (c, this) && | 61 » » shrinkageEnableGSUB.sanitize (c, this) && |
| 62 » » » shrinkageDisableGSUB.sanitize (c, this) && | 62 » » shrinkageDisableGSUB.sanitize (c, this) && |
| 63 » » » shrinkageEnableGPOS.sanitize (c, this) && | 63 » » shrinkageEnableGPOS.sanitize (c, this) && |
| 64 » » » shrinkageDisableGPOS.sanitize (c, this) && | 64 » » shrinkageDisableGPOS.sanitize (c, this) && |
| 65 » » » shrinkageJstfMax.sanitize (c, this) && | 65 » » shrinkageJstfMax.sanitize (c, this) && |
| 66 » » » extensionEnableGSUB.sanitize (c, this) && | 66 » » extensionEnableGSUB.sanitize (c, this) && |
| 67 » » » extensionDisableGSUB.sanitize (c, this) && | 67 » » extensionDisableGSUB.sanitize (c, this) && |
| 68 » » » extensionEnableGPOS.sanitize (c, this) && | 68 » » extensionEnableGPOS.sanitize (c, this) && |
| 69 » » » extensionDisableGPOS.sanitize (c, this) && | 69 » » extensionDisableGPOS.sanitize (c, this) && |
| 70 » » » extensionJstfMax.sanitize (c, this)); | 70 » » extensionJstfMax.sanitize (c, this)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 OffsetTo<JstfModList> | 74 OffsetTo<JstfModList> |
| 75 shrinkageEnableGSUB; /* Offset to Shrinkage Enable GSUB | 75 shrinkageEnableGSUB; /* Offset to Shrinkage Enable GSUB |
| 76 * JstfModList table--from beginning of | 76 * JstfModList table--from beginning of |
| 77 * JstfPriority table--may be NULL */ | 77 * JstfPriority table--may be NULL */ |
| 78 OffsetTo<JstfModList> | 78 OffsetTo<JstfModList> |
| 79 shrinkageDisableGSUB; /* Offset to Shrinkage Disable GSUB | 79 shrinkageDisableGSUB; /* Offset to Shrinkage Disable GSUB |
| 80 * JstfModList table--from beginning of | 80 * JstfModList table--from beginning of |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 /* | 120 /* |
| 121 * JstfLangSys -- Justification Language System Table | 121 * JstfLangSys -- Justification Language System Table |
| 122 */ | 122 */ |
| 123 | 123 |
| 124 struct JstfLangSys : OffsetListOf<JstfPriority> | 124 struct JstfLangSys : OffsetListOf<JstfPriority> |
| 125 { | 125 { |
| 126 inline bool sanitize (hb_sanitize_context_t *c, | 126 inline bool sanitize (hb_sanitize_context_t *c, |
| 127 const Record<JstfLangSys>::sanitize_closure_t * = NULL)
const | 127 const Record<JstfLangSys>::sanitize_closure_t * = NULL)
const |
| 128 { | 128 { |
| 129 TRACE_SANITIZE (this); | 129 TRACE_SANITIZE (this); |
| 130 return TRACE_RETURN (OffsetListOf<JstfPriority>::sanitize (c)); | 130 return_trace (OffsetListOf<JstfPriority>::sanitize (c)); |
| 131 } | 131 } |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 | 134 |
| 135 /* | 135 /* |
| 136 * ExtenderGlyphs -- Extender Glyph Table | 136 * ExtenderGlyphs -- Extender Glyph Table |
| 137 */ | 137 */ |
| 138 | 138 |
| 139 typedef SortedArrayOf<GlyphID> ExtenderGlyphs; | 139 typedef SortedArrayOf<GlyphID> ExtenderGlyphs; |
| 140 | 140 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 161 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 |
| 162 { return langSys.find_index (tag, index); } | 162 { return langSys.find_index (tag, index); } |
| 163 | 163 |
| 164 inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } | 164 inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } |
| 165 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; } |
| 166 | 166 |
| 167 inline bool sanitize (hb_sanitize_context_t *c, | 167 inline bool sanitize (hb_sanitize_context_t *c, |
| 168 const Record<JstfScript>::sanitize_closure_t * = NULL) c
onst | 168 const Record<JstfScript>::sanitize_closure_t * = NULL) c
onst |
| 169 { | 169 { |
| 170 TRACE_SANITIZE (this); | 170 TRACE_SANITIZE (this); |
| 171 return TRACE_RETURN (extenderGlyphs.sanitize (c, this) && | 171 return_trace (extenderGlyphs.sanitize (c, this) && |
| 172 » » » defaultLangSys.sanitize (c, this) && | 172 » » defaultLangSys.sanitize (c, this) && |
| 173 » » » langSys.sanitize (c, this)); | 173 » » langSys.sanitize (c, this)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 protected: | 176 protected: |
| 177 OffsetTo<ExtenderGlyphs> | 177 OffsetTo<ExtenderGlyphs> |
| 178 extenderGlyphs; /* Offset to ExtenderGlyph table--from beginning | 178 extenderGlyphs; /* Offset to ExtenderGlyph table--from beginning |
| 179 * of JstfScript table-may be NULL */ | 179 * of JstfScript table-may be NULL */ |
| 180 OffsetTo<JstfLangSys> | 180 OffsetTo<JstfLangSys> |
| 181 defaultLangSys; /* Offset to DefaultJstfLangSys table--from | 181 defaultLangSys; /* Offset to DefaultJstfLangSys table--from |
| 182 * beginning of JstfScript table--may be Null */ | 182 * beginning of JstfScript table--may be Null */ |
| 183 RecordArrayOf<JstfLangSys> | 183 RecordArrayOf<JstfLangSys> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 205 hb_tag_t *script_tags /* OUT */) cons
t | 205 hb_tag_t *script_tags /* OUT */) cons
t |
| 206 { return scriptList.get_tags (start_offset, script_count, script_tags); } | 206 { return scriptList.get_tags (start_offset, script_count, script_tags); } |
| 207 inline const JstfScript& get_script (unsigned int i) const | 207 inline const JstfScript& get_script (unsigned int i) const |
| 208 { return this+scriptList[i].offset; } | 208 { return this+scriptList[i].offset; } |
| 209 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 |
| 210 { return scriptList.find_index (tag, index); } | 210 { return scriptList.find_index (tag, index); } |
| 211 | 211 |
| 212 inline bool sanitize (hb_sanitize_context_t *c) const | 212 inline bool sanitize (hb_sanitize_context_t *c) const |
| 213 { | 213 { |
| 214 TRACE_SANITIZE (this); | 214 TRACE_SANITIZE (this); |
| 215 return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) && | 215 return_trace (version.sanitize (c) && |
| 216 » » » scriptList.sanitize (c, this)); | 216 » » likely (version.major == 1) && |
| 217 » » scriptList.sanitize (c, this)); |
| 217 } | 218 } |
| 218 | 219 |
| 219 protected: | 220 protected: |
| 220 FixedVersion version; /* Version of the JSTF table--initially set | 221 FixedVersion version; /* Version of the JSTF table--initially set |
| 221 * to 0x00010000u */ | 222 * to 0x00010000u */ |
| 222 RecordArrayOf<JstfScript> | 223 RecordArrayOf<JstfScript> |
| 223 scriptList; /* Array of JstfScripts--listed | 224 scriptList; /* Array of JstfScripts--listed |
| 224 * alphabetically by ScriptTag */ | 225 * alphabetically by ScriptTag */ |
| 225 public: | 226 public: |
| 226 DEFINE_SIZE_ARRAY (6, scriptList); | 227 DEFINE_SIZE_ARRAY (6, scriptList); |
| 227 }; | 228 }; |
| 228 | 229 |
| 229 | 230 |
| 230 } /* namespace OT */ | 231 } /* namespace OT */ |
| 231 | 232 |
| 232 | 233 |
| 233 #endif /* HB_OT_LAYOUT_JSTF_TABLE_HH */ | 234 #endif /* HB_OT_LAYOUT_JSTF_TABLE_HH */ |
| OLD | NEW |