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.
Source Code
27 | def advance_width_max |
28 | @advance_width_max
|
29 | end
|
#ascent ⇒ Integer (readonly)
Typographic ascent.
Source Code
15 | def ascent |
16 | @ascent
|
17 | end
|
#caret_offset ⇒ Integer (readonly)
Caret offset.
Source Code
66 | def caret_offset |
67 | @caret_offset
|
68 | end
|
#caret_slope_rise ⇒ Integer (readonly)
Caret slope rise.
Source Code
44 | def caret_slope_rise |
45 | @caret_slope_rise
|
46 | end
|
#caret_slope_run ⇒ Integer (readonly)
Caret slope run.
Source Code
55 | def caret_slope_run |
56 | @caret_slope_run
|
57 | end
|
#carot_slope_rise ⇒ Integer (readonly)
Use #caret_slope_rise instead.
Source Code
49 | def carot_slope_rise |
50 | @caret_slope_rise
|
51 | end
|
#carot_slope_run ⇒ Integer (readonly)
Use #caret_slope_run instead.
Source Code
60 | def carot_slope_run |
61 | @caret_slope_run
|
62 | end
|
#descent ⇒ Integer (readonly)
Typographic descent.
Source Code
19 | def descent |
20 | @descent
|
21 | end
|
#line_gap ⇒ Integer (readonly)
Typographic line gap.
Source Code
23 | def line_gap |
24 | @line_gap
|
25 | end
|
#metric_data_format ⇒ Integer (readonly)
Metric data format. 0
for current format.
Source Code
70 | def metric_data_format |
71 | @metric_data_format
|
72 | end
|
#min_left_side_bearing ⇒ Integer (readonly)
Minimum left sidebearing value in hmtx
table for glyphs with contours
(empty glyphs should be ignored).
Source Code
32 | def min_left_side_bearing |
33 | @min_left_side_bearing
|
34 | end
|
#min_right_side_bearing ⇒ Integer (readonly)
Minimum right sidebearing value.
Source Code
36 | def min_right_side_bearing |
37 | @min_right_side_bearing
|
38 | end
|
#number_of_metrics ⇒ Integer (readonly)
Number of hMetric entries in hmtx
table.
Source Code
74 | def number_of_metrics |
75 | @number_of_metrics
|
76 | end
|
#version ⇒ Integer (readonly)
Table version
Source Code
11 | def version |
12 | @version
|
13 | end
|
#x_max_extent ⇒ Integer (readonly)
Maximum extent.
Source Code
40 | def x_max_extent |
41 | @x_max_extent
|
42 | end
|
Class Method Details
.encode(hhea, hmtx, original, mapping) ⇒ String
Encode table.
Source Code
85 | def encode(hhea, hmtx, original, mapping) |
86 | ''.b.tap do |table| |
87 | table << [hhea.version].pack('N') |
88 | table << [ |
89 | hhea.ascent, hhea.descent, hhea.line_gap, |
90 | *min_max_values_for(original, mapping), |
91 | hhea.caret_slope_rise, hhea.caret_slope_run, hhea.caret_offset, |
92 | 0, 0, 0, 0, hhea.metric_data_format, hmtx[:number_of_metrics], |
93 | ].pack('n*') |
94 | end
|
95 | end
|