Skip to main content

harfrust/ot/gsub/
mod.rs

1//! OpenType GSUB lookups.
2
3use crate::buffer::Buffer;
4use crate::ot::layout::*;
5use crate::plan::ShapePlan;
6use crate::ShaperFont;
7
8pub fn substitute(plan: &ShapePlan, font: &ShaperFont<'_, '_>, buffer: &mut Buffer) {
9    #[cfg(feature = "tracing")]
10    let tag = crate::ot::map::MessageTag(plan.ot_map.chosen_script(LayoutTableKind::Gsub));
11    if !buffer_message!(buffer, font, "start table GSUB script tag '{tag:#}'") {
12        return;
13    }
14    let table = font.layout().ot.gsub();
15    apply_layout_table(plan, font, buffer, table.as_ref());
16    buffer_message!(buffer, font, "end table GSUB script tag '{tag:#}'");
17}