Module: HarfBuzz::OT::Shape

Defined in:
lib/harfbuzz/ot/shape.rb

Overview

OpenType Shape query API

Class Method Summary collapse

Class Method Details

.glyphs_closure(font, buffer, features = []) ⇒ HarfBuzz::Set

Returns the set of glyphs that could be produced by the given buffer

Parameters:

  • font (Font)

    Sized font

  • buffer (Buffer)

    Text buffer

  • features (Array<Feature>) (defaults to: [])

    Features to apply

Returns:



14
15
16
17
18
19
20
21
# File 'lib/harfbuzz/ot/shape.rb', line 14

def glyphs_closure(font, buffer, features = [])
  set = HarfBuzz::Set.new
  features_ptr = HarfBuzz.send(:build_features_ptr, features)
  C.hb_ot_shape_glyphs_closure(
    font.ptr, buffer.ptr, features_ptr, features.size, set.ptr
  )
  set
end

.plan_collect_lookups(plan, table_tag) ⇒ HarfBuzz::Set

Returns the lookup indices used by a shape plan for a given table

Parameters:

  • plan (ShapePlan)

    Shape plan

  • table_tag (Integer)

    GSUB or GPOS tag

Returns:



27
28
29
30
31
# File 'lib/harfbuzz/ot/shape.rb', line 27

def plan_collect_lookups(plan, table_tag)
  set = HarfBuzz::Set.new
  C.hb_ot_shape_plan_collect_lookups(plan.ptr, table_tag, set.ptr)
  set
end