Class: HarfBuzz::GlyphInfo
- Inherits:
-
Object
- Object
- HarfBuzz::GlyphInfo
- Defined in:
- lib/harfbuzz/glyph_info.rb
Overview
Wraps hb_glyph_info_t, providing access to glyph ID and cluster index
Instance Method Summary collapse
-
#cluster ⇒ Integer
Cluster index in source text.
-
#codepoint ⇒ Integer
(also: #glyph_id)
Glyph ID (after shaping) or Unicode codepoint (before shaping).
-
#initialize(struct_ptr) ⇒ GlyphInfo
constructor
A new instance of GlyphInfo.
- #inspect ⇒ Object
-
#mask ⇒ Integer
Glyph flags bitmask.
- #to_h ⇒ Object
Constructor Details
#initialize(struct_ptr) ⇒ GlyphInfo
Returns a new instance of GlyphInfo.
6 7 8 |
# File 'lib/harfbuzz/glyph_info.rb', line 6 def initialize(struct_ptr) @struct = C::HbGlyphInfoT.new(struct_ptr) end |
Instance Method Details
#cluster ⇒ Integer
Returns Cluster index in source text.
18 19 20 |
# File 'lib/harfbuzz/glyph_info.rb', line 18 def cluster @struct[:cluster] end |
#codepoint ⇒ Integer Also known as: glyph_id
Returns Glyph ID (after shaping) or Unicode codepoint (before shaping).
11 12 13 |
# File 'lib/harfbuzz/glyph_info.rb', line 11 def codepoint @struct[:codepoint] end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/harfbuzz/glyph_info.rb', line 31 def inspect "#<HarfBuzz::GlyphInfo glyph_id=#{codepoint} cluster=#{cluster}>" end |
#mask ⇒ Integer
Returns Glyph flags bitmask.
23 24 25 |
# File 'lib/harfbuzz/glyph_info.rb', line 23 def mask @struct[:mask] end |
#to_h ⇒ Object
27 28 29 |
# File 'lib/harfbuzz/glyph_info.rb', line 27 def to_h { codepoint: codepoint, cluster: cluster, mask: mask } end |