| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. |
| 3 * Copyright © 2010,2012 Google, Inc. | 3 * Copyright © 2010,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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 DEFINE_SIZE_ARRAY (10, pairSet); | 703 DEFINE_SIZE_ARRAY (10, pairSet); |
| 704 }; | 704 }; |
| 705 | 705 |
| 706 struct PairPosFormat2 | 706 struct PairPosFormat2 |
| 707 { | 707 { |
| 708 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const | 708 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const |
| 709 { | 709 { |
| 710 TRACE_COLLECT_GLYPHS (this); | 710 TRACE_COLLECT_GLYPHS (this); |
| 711 /* (this+coverage).add_coverage (c->input); // Don't need this. */ | 711 /* (this+coverage).add_coverage (c->input); // Don't need this. */ |
| 712 | 712 |
| 713 /* TODO only add values for pairs that have nonzero adjustments. */ | |
| 714 | |
| 715 unsigned int count1 = class1Count; | 713 unsigned int count1 = class1Count; |
| 716 const ClassDef &klass1 = this+classDef1; | 714 const ClassDef &klass1 = this+classDef1; |
| 717 for (unsigned int i = 0; i < count1; i++) | 715 for (unsigned int i = 0; i < count1; i++) |
| 718 klass1.add_class (c->input, i); | 716 klass1.add_class (c->input, i); |
| 719 | 717 |
| 720 unsigned int count2 = class2Count; | 718 unsigned int count2 = class2Count; |
| 721 const ClassDef &klass2 = this+classDef2; | 719 const ClassDef &klass2 = this+classDef2; |
| 722 for (unsigned int i = 0; i < count2; i++) | 720 for (unsigned int i = 0; i < count2; i++) |
| 723 klass2.add_class (c->input, i); | 721 klass2.add_class (c->input, i); |
| 724 } | 722 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 * mark-minor-- | 1005 * mark-minor-- |
| 1008 * ordered by class--zero-based. */ | 1006 * ordered by class--zero-based. */ |
| 1009 | 1007 |
| 1010 struct MarkBasePosFormat1 | 1008 struct MarkBasePosFormat1 |
| 1011 { | 1009 { |
| 1012 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const | 1010 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const |
| 1013 { | 1011 { |
| 1014 TRACE_COLLECT_GLYPHS (this); | 1012 TRACE_COLLECT_GLYPHS (this); |
| 1015 (this+markCoverage).add_coverage (c->input); | 1013 (this+markCoverage).add_coverage (c->input); |
| 1016 (this+baseCoverage).add_coverage (c->input); | 1014 (this+baseCoverage).add_coverage (c->input); |
| 1017 /* TODO only add combinations that have nonzero adjustment. */ | |
| 1018 } | 1015 } |
| 1019 | 1016 |
| 1020 inline const Coverage &get_coverage (void) const | 1017 inline const Coverage &get_coverage (void) const |
| 1021 { | 1018 { |
| 1022 return this+markCoverage; | 1019 return this+markCoverage; |
| 1023 } | 1020 } |
| 1024 | 1021 |
| 1025 inline bool apply (hb_apply_context_t *c) const | 1022 inline bool apply (hb_apply_context_t *c) const |
| 1026 { | 1023 { |
| 1027 TRACE_APPLY (this); | 1024 TRACE_APPLY (this); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 * tables ordered by | 1108 * tables ordered by |
| 1112 * LigatureCoverage Index */ | 1109 * LigatureCoverage Index */ |
| 1113 | 1110 |
| 1114 struct MarkLigPosFormat1 | 1111 struct MarkLigPosFormat1 |
| 1115 { | 1112 { |
| 1116 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const | 1113 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const |
| 1117 { | 1114 { |
| 1118 TRACE_COLLECT_GLYPHS (this); | 1115 TRACE_COLLECT_GLYPHS (this); |
| 1119 (this+markCoverage).add_coverage (c->input); | 1116 (this+markCoverage).add_coverage (c->input); |
| 1120 (this+ligatureCoverage).add_coverage (c->input); | 1117 (this+ligatureCoverage).add_coverage (c->input); |
| 1121 /* TODO only add combinations that have nonzero adjustment. */ | |
| 1122 } | 1118 } |
| 1123 | 1119 |
| 1124 inline const Coverage &get_coverage (void) const | 1120 inline const Coverage &get_coverage (void) const |
| 1125 { | 1121 { |
| 1126 return this+markCoverage; | 1122 return this+markCoverage; |
| 1127 } | 1123 } |
| 1128 | 1124 |
| 1129 inline bool apply (hb_apply_context_t *c) const | 1125 inline bool apply (hb_apply_context_t *c) const |
| 1130 { | 1126 { |
| 1131 TRACE_APPLY (this); | 1127 TRACE_APPLY (this); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 * mark1-minor-- | 1223 * mark1-minor-- |
| 1228 * ordered by class--zero-based. */ | 1224 * ordered by class--zero-based. */ |
| 1229 | 1225 |
| 1230 struct MarkMarkPosFormat1 | 1226 struct MarkMarkPosFormat1 |
| 1231 { | 1227 { |
| 1232 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const | 1228 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const |
| 1233 { | 1229 { |
| 1234 TRACE_COLLECT_GLYPHS (this); | 1230 TRACE_COLLECT_GLYPHS (this); |
| 1235 (this+mark1Coverage).add_coverage (c->input); | 1231 (this+mark1Coverage).add_coverage (c->input); |
| 1236 (this+mark2Coverage).add_coverage (c->input); | 1232 (this+mark2Coverage).add_coverage (c->input); |
| 1237 /* TODO only add combinations that have nonzero adjustment. */ | |
| 1238 } | 1233 } |
| 1239 | 1234 |
| 1240 inline const Coverage &get_coverage (void) const | 1235 inline const Coverage &get_coverage (void) const |
| 1241 { | 1236 { |
| 1242 return this+mark1Coverage; | 1237 return this+mark1Coverage; |
| 1243 } | 1238 } |
| 1244 | 1239 |
| 1245 inline bool apply (hb_apply_context_t *c) const | 1240 inline bool apply (hb_apply_context_t *c) const |
| 1246 { | 1241 { |
| 1247 TRACE_APPLY (this); | 1242 TRACE_APPLY (this); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 if (unlikely (!c->buffer->len || !c->lookup_mask)) | 1468 if (unlikely (!c->buffer->len || !c->lookup_mask)) |
| 1474 return false; | 1469 return false; |
| 1475 | 1470 |
| 1476 c->set_recurse_func (apply_recurse_func); | 1471 c->set_recurse_func (apply_recurse_func); |
| 1477 c->set_lookup (*this); | 1472 c->set_lookup (*this); |
| 1478 | 1473 |
| 1479 c->buffer->idx = 0; | 1474 c->buffer->idx = 0; |
| 1480 | 1475 |
| 1481 while (c->buffer->idx < c->buffer->len) | 1476 while (c->buffer->idx < c->buffer->len) |
| 1482 { | 1477 { |
| 1483 if ((c->buffer->cur().mask & c->lookup_mask) && | 1478 if (digest->may_have (c->buffer->cur().codepoint) && |
| 1484 » digest->may_have (c->buffer->cur().codepoint) && | 1479 » (c->buffer->cur().mask & c->lookup_mask) && |
| 1485 apply_once (c)) | 1480 apply_once (c)) |
| 1486 ret = true; | 1481 ret = true; |
| 1487 else | 1482 else |
| 1488 c->buffer->idx++; | 1483 c->buffer->idx++; |
| 1489 } | 1484 } |
| 1490 | 1485 |
| 1491 return ret; | 1486 return ret; |
| 1492 } | 1487 } |
| 1493 | 1488 |
| 1494 template <typename context_t> | 1489 template <typename context_t> |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 | 1634 |
| 1640 | 1635 |
| 1641 #undef attach_lookback | 1636 #undef attach_lookback |
| 1642 #undef cursive_chain | 1637 #undef cursive_chain |
| 1643 | 1638 |
| 1644 | 1639 |
| 1645 } /* namespace OT */ | 1640 } /* namespace OT */ |
| 1646 | 1641 |
| 1647 | 1642 |
| 1648 #endif /* HB_OT_LAYOUT_GPOS_TABLE_HH */ | 1643 #endif /* HB_OT_LAYOUT_GPOS_TABLE_HH */ |
| OLD | NEW |