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,2013 Google, Inc. | 3 * Copyright © 2010,2012,2013 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 /* Shared Tables: ValueRecord, Anchor Table, and MarkArray */ | 43 /* Shared Tables: ValueRecord, Anchor Table, and MarkArray */ |
44 | 44 |
45 typedef USHORT Value; | 45 typedef USHORT Value; |
46 | 46 |
47 typedef Value ValueRecord[VAR]; | 47 typedef Value ValueRecord[VAR]; |
48 | 48 |
49 struct ValueFormat : USHORT | 49 struct ValueFormat : USHORT |
50 { | 50 { |
51 enum Flags { | 51 enum Flags { |
52 xPlacement» = 0x0001,» /* Includes horizontal adjustment for placement
*/ | 52 xPlacement» = 0x0001u,» /* Includes horizontal adjustment for placement
*/ |
53 yPlacement» = 0x0002,» /* Includes vertical adjustment for placement */ | 53 yPlacement» = 0x0002u,» /* Includes vertical adjustment for placement */ |
54 xAdvance» = 0x0004,» /* Includes horizontal adjustment for advance */ | 54 xAdvance» = 0x0004u,» /* Includes horizontal adjustment for advance */ |
55 yAdvance» = 0x0008,» /* Includes vertical adjustment for advance */ | 55 yAdvance» = 0x0008u,» /* Includes vertical adjustment for advance */ |
56 xPlaDevice» = 0x0010,» /* Includes horizontal Device table for placemen
t */ | 56 xPlaDevice» = 0x0010u,» /* Includes horizontal Device table for placemen
t */ |
57 yPlaDevice» = 0x0020,» /* Includes vertical Device table for placement
*/ | 57 yPlaDevice» = 0x0020u,» /* Includes vertical Device table for placement
*/ |
58 xAdvDevice» = 0x0040,» /* Includes horizontal Device table for advance
*/ | 58 xAdvDevice» = 0x0040u,» /* Includes horizontal Device table for advance
*/ |
59 yAdvDevice» = 0x0080,» /* Includes vertical Device table for advance */ | 59 yAdvDevice» = 0x0080u,» /* Includes vertical Device table for advance */ |
60 ignored» = 0x0F00,» /* Was used in TrueType Open for MM fonts */ | 60 ignored» = 0x0F00u,» /* Was used in TrueType Open for MM fonts */ |
61 reserved» = 0xF000,» /* For future use */ | 61 reserved» = 0xF000u,» /* For future use */ |
62 | 62 |
63 devices» = 0x00F0» /* Mask for having any Device table */ | 63 devices» = 0x00F0u» /* Mask for having any Device table */ |
64 }; | 64 }; |
65 | 65 |
66 /* All fields are options. Only those available advance the value pointer. */ | 66 /* All fields are options. Only those available advance the value pointer. */ |
67 #if 0 | 67 #if 0 |
68 SHORT xPlacement; /* Horizontal adjustment for | 68 SHORT xPlacement; /* Horizontal adjustment for |
69 * placement--in design units */ | 69 * placement--in design units */ |
70 SHORT yPlacement; /* Vertical adjustment for | 70 SHORT yPlacement; /* Vertical adjustment for |
71 * placement--in design units */ | 71 * placement--in design units */ |
72 SHORT xAdvance; /* Horizontal adjustment for | 72 SHORT xAdvance; /* Horizontal adjustment for |
73 * advance--in design units (only used | 73 * advance--in design units (only used |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 for (unsigned int i = 0; i < len; i++) | 1601 for (unsigned int i = 0; i < len; i++) |
1602 fix_mark_attachment (pos, i, direction); | 1602 fix_mark_attachment (pos, i, direction); |
1603 | 1603 |
1604 _hb_buffer_deallocate_gsubgpos_vars (buffer); | 1604 _hb_buffer_deallocate_gsubgpos_vars (buffer); |
1605 } | 1605 } |
1606 | 1606 |
1607 | 1607 |
1608 /* Out-of-class implementation for methods recursing */ | 1608 /* Out-of-class implementation for methods recursing */ |
1609 | 1609 |
1610 template <typename context_t> | 1610 template <typename context_t> |
1611 inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t
*c, unsigned int lookup_index) | 1611 /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func
(context_t *c, unsigned int lookup_index) |
1612 { | 1612 { |
1613 const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos); | 1613 const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos); |
1614 const PosLookup &l = gpos.get_lookup (lookup_index); | 1614 const PosLookup &l = gpos.get_lookup (lookup_index); |
1615 return l.dispatch (c); | 1615 return l.dispatch (c); |
1616 } | 1616 } |
1617 | 1617 |
1618 inline bool PosLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int l
ookup_index) | 1618 /*static*/ inline bool PosLookup::apply_recurse_func (hb_apply_context_t *c, uns
igned int lookup_index) |
1619 { | 1619 { |
1620 const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos); | 1620 const GPOS &gpos = *(hb_ot_layout_from_face (c->face)->gpos); |
1621 const PosLookup &l = gpos.get_lookup (lookup_index); | 1621 const PosLookup &l = gpos.get_lookup (lookup_index); |
1622 unsigned int saved_lookup_props = c->lookup_props; | 1622 unsigned int saved_lookup_props = c->lookup_props; |
1623 c->set_lookup (l); | 1623 c->set_lookup (l); |
1624 bool ret = l.apply_once (c); | 1624 bool ret = l.apply_once (c); |
1625 c->lookup_props = saved_lookup_props; | 1625 c->lookup_props = saved_lookup_props; |
1626 return ret; | 1626 return ret; |
1627 } | 1627 } |
1628 | 1628 |
1629 | 1629 |
1630 #undef attach_lookback | 1630 #undef attach_lookback |
1631 #undef cursive_chain | 1631 #undef cursive_chain |
1632 | 1632 |
1633 | 1633 |
1634 } /* namespace OT */ | 1634 } /* namespace OT */ |
1635 | 1635 |
1636 | 1636 |
1637 #endif /* HB_OT_LAYOUT_GPOS_TABLE_HH */ | 1637 #endif /* HB_OT_LAYOUT_GPOS_TABLE_HH */ |
OLD | NEW |