Class: Pdfrb::Font::TrueType::Hhea
- Inherits:
-
Object
- Object
- Pdfrb::Font::TrueType::Hhea
- Defined in:
- lib/pdfrb/font/true_type/hhea.rb
Overview
hhea (Horizontal Header) table parser. Exposes ascender,
descender, line_gap, number_of_hmetrics (used by hmtx).
Spec: OpenType "hhea" v1.0 — 36 bytes.
Instance Attribute Summary collapse
-
#advance_width_max ⇒ Object
readonly
Returns the value of attribute advance_width_max.
-
#ascender ⇒ Object
readonly
Returns the value of attribute ascender.
-
#descender ⇒ Object
readonly
Returns the value of attribute descender.
-
#line_gap ⇒ Object
readonly
Returns the value of attribute line_gap.
-
#number_of_hmetrics ⇒ Object
readonly
Returns the value of attribute number_of_hmetrics.
Instance Method Summary collapse
-
#initialize(data) ⇒ Hhea
constructor
A new instance of Hhea.
Constructor Details
#initialize(data) ⇒ Hhea
Returns a new instance of Hhea.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 14 def initialize(data) @data = data return unless data && data.bytesize >= 36 @ascender = s16(4) @descender = s16(6) @line_gap = s16(8) @advance_width_max = u16(10) @number_of_hmetrics = u16(34) end |
Instance Attribute Details
#advance_width_max ⇒ Object (readonly)
Returns the value of attribute advance_width_max.
11 12 13 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 11 def advance_width_max @advance_width_max end |
#ascender ⇒ Object (readonly)
Returns the value of attribute ascender.
11 12 13 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 11 def ascender @ascender end |
#descender ⇒ Object (readonly)
Returns the value of attribute descender.
11 12 13 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 11 def descender @descender end |
#line_gap ⇒ Object (readonly)
Returns the value of attribute line_gap.
11 12 13 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 11 def line_gap @line_gap end |
#number_of_hmetrics ⇒ Object (readonly)
Returns the value of attribute number_of_hmetrics.
11 12 13 |
# File 'lib/pdfrb/font/true_type/hhea.rb', line 11 def number_of_hmetrics @number_of_hmetrics end |