OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2007,2008,2009 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009 Red Hat, Inc. |
3 * Copyright © 2010,2011,2012 Google, Inc. | 3 * Copyright © 2010,2011,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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 DEFINE_SIZE_UNION (2, format); | 317 DEFINE_SIZE_UNION (2, format); |
318 }; | 318 }; |
319 | 319 |
320 | 320 |
321 /* | 321 /* |
322 * GDEF -- The Glyph Definition Table | 322 * GDEF -- The Glyph Definition Table |
323 */ | 323 */ |
324 | 324 |
325 struct GDEF | 325 struct GDEF |
326 { | 326 { |
327 static const hb_tag_t Tag» = HB_OT_TAG_GDEF; | 327 static const hb_tag_t tableTag» = HB_OT_TAG_GDEF; |
328 | 328 |
329 enum GlyphClasses { | 329 enum GlyphClasses { |
330 UnclassifiedGlyph = 0, | 330 UnclassifiedGlyph = 0, |
331 BaseGlyph = 1, | 331 BaseGlyph = 1, |
332 LigatureGlyph = 2, | 332 LigatureGlyph = 2, |
333 MarkGlyph = 3, | 333 MarkGlyph = 3, |
334 ComponentGlyph = 4 | 334 ComponentGlyph = 4 |
335 }; | 335 }; |
336 | 336 |
337 inline bool has_glyph_classes (void) const { return glyphClassDef != 0; } | 337 inline bool has_glyph_classes (void) const { return glyphClassDef != 0; } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 | 378 |
379 /* glyph_props is a 16-bit integer where the lower 8-bit have bits representin
g | 379 /* glyph_props is a 16-bit integer where the lower 8-bit have bits representin
g |
380 * glyph class and other bits, and high 8-bit gthe mark attachment type (if an
y). | 380 * glyph class and other bits, and high 8-bit gthe mark attachment type (if an
y). |
381 * Not to be confused with lookup_props which is very similar. */ | 381 * Not to be confused with lookup_props which is very similar. */ |
382 inline unsigned int get_glyph_props (hb_codepoint_t glyph) const | 382 inline unsigned int get_glyph_props (hb_codepoint_t glyph) const |
383 { | 383 { |
384 unsigned int klass = get_glyph_class (glyph); | 384 unsigned int klass = get_glyph_class (glyph); |
385 | 385 |
| 386 ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsign
ed int) LookupFlag::IgnoreBaseGlyphs); |
| 387 ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned
int) LookupFlag::IgnoreLigatures); |
| 388 ASSERT_STATIC ((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int
) LookupFlag::IgnoreMarks); |
| 389 |
386 switch (klass) { | 390 switch (klass) { |
387 default: | 391 default:» » » return 0; |
388 case UnclassifiedGlyph:» return HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED; | |
389 case BaseGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH; | 392 case BaseGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH; |
390 case LigatureGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE; | 393 case LigatureGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE; |
391 case ComponentGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_COMPONENT; | |
392 case MarkGlyph: | 394 case MarkGlyph: |
393 klass = get_mark_attachment_type (glyph); | 395 klass = get_mark_attachment_type (glyph); |
394 return HB_OT_LAYOUT_GLYPH_PROPS_MARK | (klass << 8); | 396 return HB_OT_LAYOUT_GLYPH_PROPS_MARK | (klass << 8); |
395 } | 397 } |
396 } | 398 } |
397 | 399 |
398 | 400 |
399 protected: | 401 protected: |
400 FixedVersion version; /* Version of the GDEF table--currently | 402 FixedVersion version; /* Version of the GDEF table--currently |
401 * 0x00010002 */ | 403 * 0x00010002 */ |
(...skipping 20 matching lines...) Expand all Loading... |
422 * in version 00010002. */ | 424 * in version 00010002. */ |
423 public: | 425 public: |
424 DEFINE_SIZE_ARRAY (12, markGlyphSetsDef); | 426 DEFINE_SIZE_ARRAY (12, markGlyphSetsDef); |
425 }; | 427 }; |
426 | 428 |
427 | 429 |
428 } /* namespace OT */ | 430 } /* namespace OT */ |
429 | 431 |
430 | 432 |
431 #endif /* HB_OT_LAYOUT_GDEF_TABLE_HH */ | 433 #endif /* HB_OT_LAYOUT_GDEF_TABLE_HH */ |
OLD | NEW |