Class: HarfBuzz::GlyphPosition
- Inherits:
-
Object
- Object
- HarfBuzz::GlyphPosition
- Defined in:
- lib/harfbuzz/glyph_position.rb
Overview
Wraps hb_glyph_position_t, providing access to advance and offset values
Instance Method Summary collapse
-
#initialize(struct_ptr) ⇒ GlyphPosition
constructor
A new instance of GlyphPosition.
- #inspect ⇒ Object
- #to_h ⇒ Object
-
#x_advance ⇒ Integer
Horizontal advance (in font units).
-
#x_offset ⇒ Integer
Horizontal offset (in font units).
-
#y_advance ⇒ Integer
Vertical advance (in font units).
-
#y_offset ⇒ Integer
Vertical offset (in font units).
Constructor Details
#initialize(struct_ptr) ⇒ GlyphPosition
Returns a new instance of GlyphPosition.
6 7 8 |
# File 'lib/harfbuzz/glyph_position.rb', line 6 def initialize(struct_ptr) @struct = C::HbGlyphPositionT.new(struct_ptr) end |
Instance Method Details
#inspect ⇒ Object
37 38 39 |
# File 'lib/harfbuzz/glyph_position.rb', line 37 def inspect "#<HarfBuzz::GlyphPosition adv=(#{x_advance},#{y_advance}) off=(#{x_offset},#{y_offset})>" end |
#to_h ⇒ Object
30 31 32 33 34 35 |
# File 'lib/harfbuzz/glyph_position.rb', line 30 def to_h { x_advance: x_advance, y_advance: y_advance, x_offset: x_offset, y_offset: y_offset } end |
#x_advance ⇒ Integer
Returns Horizontal advance (in font units).
11 12 13 |
# File 'lib/harfbuzz/glyph_position.rb', line 11 def x_advance @struct[:x_advance] end |
#x_offset ⇒ Integer
Returns Horizontal offset (in font units).
21 22 23 |
# File 'lib/harfbuzz/glyph_position.rb', line 21 def x_offset @struct[:x_offset] end |
#y_advance ⇒ Integer
Returns Vertical advance (in font units).
16 17 18 |
# File 'lib/harfbuzz/glyph_position.rb', line 16 def y_advance @struct[:y_advance] end |
#y_offset ⇒ Integer
Returns Vertical offset (in font units).
26 27 28 |
# File 'lib/harfbuzz/glyph_position.rb', line 26 def y_offset @struct[:y_offset] end |