Class: TTFunk::Table::Hhea
- Inherits:
-
TTFunk::Table
- Object
- TTFunk::Table
- TTFunk::Table::Hhea
- Defined in:
- lib/ttfunk/table/hhea.rb
Overview
Horizontal Header (‘hhea`) table.
Instance Attribute Summary collapse
-
#advance_width_max ⇒ Integer
readonly
Maximum advance width value in ‘hmtx` table.
-
#ascent ⇒ Integer
readonly
Typographic ascent.
-
#caret_offset ⇒ Integer
readonly
Caret offset.
-
#caret_slope_rise ⇒ Integer
readonly
Caret slope rise.
-
#caret_slope_run ⇒ Integer
readonly
Caret slope run.
-
#carot_slope_rise ⇒ Integer
readonly
deprecated
Deprecated.
Use #caret_slope_rise instead.
-
#carot_slope_run ⇒ Integer
readonly
deprecated
Deprecated.
Use #caret_slope_run instead.
-
#descent ⇒ Integer
readonly
Typographic descent.
-
#line_gap ⇒ Integer
readonly
Typographic line gap.
-
#metric_data_format ⇒ Integer
readonly
Metric data format.
-
#min_left_side_bearing ⇒ Integer
readonly
Minimum left sidebearing value in ‘hmtx` table for glyphs with contours (empty glyphs should be ignored).
-
#min_right_side_bearing ⇒ Integer
readonly
Minimum right sidebearing value.
-
#number_of_metrics ⇒ Integer
readonly
Number of hMetric entries in ‘hmtx` table.
-
#version ⇒ Integer
readonly
Table version.
-
#x_max_extent ⇒ Integer
readonly
Maximum extent.
Attributes inherited from TTFunk::Table
Class Method Summary collapse
-
.encode(hhea, hmtx, original, mapping) ⇒ String
Encode table.
Methods inherited from TTFunk::Table
#exists?, #initialize, #raw, #tag
Constructor Details
This class inherits a constructor from TTFunk::Table
Instance Attribute Details
#advance_width_max ⇒ Integer (readonly)
Maximum advance width value in ‘hmtx` table.
27 28 29 |
# File 'lib/ttfunk/table/hhea.rb', line 27 def advance_width_max @advance_width_max end |
#ascent ⇒ Integer (readonly)
Typographic ascent.
15 16 17 |
# File 'lib/ttfunk/table/hhea.rb', line 15 def ascent @ascent end |
#caret_offset ⇒ Integer (readonly)
Caret offset.
66 67 68 |
# File 'lib/ttfunk/table/hhea.rb', line 66 def caret_offset @caret_offset end |
#caret_slope_rise ⇒ Integer (readonly)
Caret slope rise.
44 45 46 |
# File 'lib/ttfunk/table/hhea.rb', line 44 def caret_slope_rise @caret_slope_rise end |
#caret_slope_run ⇒ Integer (readonly)
Caret slope run.
55 56 57 |
# File 'lib/ttfunk/table/hhea.rb', line 55 def caret_slope_run @caret_slope_run end |
#carot_slope_rise ⇒ Integer (readonly)
Use #caret_slope_rise instead.
49 50 51 |
# File 'lib/ttfunk/table/hhea.rb', line 49 def carot_slope_rise @caret_slope_rise end |
#carot_slope_run ⇒ Integer (readonly)
Use #caret_slope_run instead.
60 61 62 |
# File 'lib/ttfunk/table/hhea.rb', line 60 def carot_slope_run @caret_slope_run end |
#descent ⇒ Integer (readonly)
Typographic descent.
19 20 21 |
# File 'lib/ttfunk/table/hhea.rb', line 19 def descent @descent end |
#line_gap ⇒ Integer (readonly)
Typographic line gap.
23 24 25 |
# File 'lib/ttfunk/table/hhea.rb', line 23 def line_gap @line_gap end |
#metric_data_format ⇒ Integer (readonly)
Metric data format. ‘0` for current format.
70 71 72 |
# File 'lib/ttfunk/table/hhea.rb', line 70 def metric_data_format @metric_data_format end |
#min_left_side_bearing ⇒ Integer (readonly)
Minimum left sidebearing value in ‘hmtx` table for glyphs with contours (empty glyphs should be ignored).
32 33 34 |
# File 'lib/ttfunk/table/hhea.rb', line 32 def min_left_side_bearing @min_left_side_bearing end |
#min_right_side_bearing ⇒ Integer (readonly)
Minimum right sidebearing value.
36 37 38 |
# File 'lib/ttfunk/table/hhea.rb', line 36 def min_right_side_bearing @min_right_side_bearing end |
#number_of_metrics ⇒ Integer (readonly)
Number of hMetric entries in ‘hmtx` table.
74 75 76 |
# File 'lib/ttfunk/table/hhea.rb', line 74 def number_of_metrics @number_of_metrics end |
#version ⇒ Integer (readonly)
Table version
11 12 13 |
# File 'lib/ttfunk/table/hhea.rb', line 11 def version @version end |
#x_max_extent ⇒ Integer (readonly)
Maximum extent.
40 41 42 |
# File 'lib/ttfunk/table/hhea.rb', line 40 def x_max_extent @x_max_extent end |
Class Method Details
.encode(hhea, hmtx, original, mapping) ⇒ String
Encode table.
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/ttfunk/table/hhea.rb', line 85 def encode(hhea, hmtx, original, mapping) ''.b.tap do |table| table << [hhea.version].pack('N') table << [ hhea.ascent, hhea.descent, hhea.line_gap, *min_max_values_for(original, mapping), hhea.caret_slope_rise, hhea.caret_slope_run, hhea.caret_offset, 0, 0, 0, 0, hhea.metric_data_format, hmtx[:number_of_metrics], ].pack('n*') end end |