rustybuzz/hb/ot/layout/GPOS/
pos_lookup.rs

1use crate::hb::ot_layout::LayoutLookup;
2use crate::hb::ot_layout_common::PositioningLookup;
3use crate::hb::ot_layout_gsubgpos::Apply;
4use crate::hb::ot_layout_gsubgpos::OT::hb_ot_apply_context_t;
5use crate::hb::set_digest::{hb_set_digest_ext, hb_set_digest_t};
6
7impl LayoutLookup for PositioningLookup<'_> {
8    fn props(&self) -> u32 {
9        self.props
10    }
11
12    fn is_reverse(&self) -> bool {
13        false
14    }
15
16    fn digest(&self) -> &hb_set_digest_t {
17        &self.set_digest
18    }
19}
20
21impl Apply for PositioningLookup<'_> {
22    fn apply(&self, ctx: &mut hb_ot_apply_context_t) -> Option<()> {
23        if self.digest().may_have_glyph(ctx.buffer.cur(0).as_glyph()) {
24            for subtable in &self.subtables {
25                if subtable.apply(ctx).is_some() {
26                    return Some(());
27                }
28            }
29        }
30
31        None
32    }
33}