Class: HexaPDF::Font::TrueType::Table::Head
- Inherits:
-
HexaPDF::Font::TrueType::Table
- Object
- HexaPDF::Font::TrueType::Table
- HexaPDF::Font::TrueType::Table::Head
- Extended by:
- Utils::BitField
- Defined in:
- lib/hexapdf/font/true_type/table/head.rb
Overview
The ‘head’ table contains global information about the font.
See: developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html
Constant Summary
Constants inherited from HexaPDF::Font::TrueType::Table
Instance Attribute Summary collapse
-
#bbox ⇒ Object
The bounding box for all glyphs of the font in the form [xmin, ymin, xmax, ymax].
-
#checksum_adjustment ⇒ Object
The adjustment value for the checksum.
-
#created ⇒ Object
The creation time of the font.
-
#flags ⇒ Object
Various font flags.
-
#font_direction_hint ⇒ Object
Represents an indication of the direction of the glyphs of the font.
-
#font_revision ⇒ Object
The revision of the font as set by the manufacturer (a Rational).
-
#index_to_loc_format ⇒ Object
Indicates the type of offset format used in the ‘loca’ table, 0 for short offsets, 1 for long offsets.
-
#mac_style ⇒ Object
Apple Mac style information.
-
#modified ⇒ Object
The modification time of the font.
-
#smallest_readable_size ⇒ Object
The smallest readable size in pixels per em for this font.
-
#units_per_em ⇒ Object
The number of units per em for the font.
-
#version ⇒ Object
The version of the font (a Rational).
Attributes inherited from HexaPDF::Font::TrueType::Table
Instance Method Summary collapse
-
#checksum_valid? ⇒ Boolean
The checksum for the head table is calculated differently because the checksum_adjustment value is not used during the calculation.
Methods included from Utils::BitField
Methods inherited from HexaPDF::Font::TrueType::Table
calculate_checksum, #directory_entry, #initialize, #raw_data
Constructor Details
This class inherits a constructor from HexaPDF::Font::TrueType::Table
Instance Attribute Details
#bbox ⇒ Object
The bounding box for all glyphs of the font in the form [xmin, ymin, xmax, ymax].
75 76 77 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 75 def bbox @bbox end |
#checksum_adjustment ⇒ Object
The adjustment value for the checksum.
59 60 61 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 59 def checksum_adjustment @checksum_adjustment end |
#created ⇒ Object
The creation time of the font.
69 70 71 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 69 def created @created end |
#flags ⇒ Object
Various font flags. See Flags.
62 63 64 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 62 def flags @flags end |
#font_direction_hint ⇒ Object
Represents an indication of the direction of the glyphs of the font.
- 0
-
Mixed directional font
- 1
-
Font with only left-to-right glyphs
- -1
-
Font with only right-to-left glyphs
- 2
-
Font with left-to-right and neutral (e.g. punctuation) glyphs
- -2
-
Font with right-to-left and neutral (e.g. punctuation) glyphs
93 94 95 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 93 def font_direction_hint @font_direction_hint end |
#font_revision ⇒ Object
The revision of the font as set by the manufacturer (a Rational).
56 57 58 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 56 def font_revision @font_revision end |
#index_to_loc_format ⇒ Object
Indicates the type of offset format used in the ‘loca’ table, 0 for short offsets, 1 for long offsets.
See: Loca
99 100 101 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 99 def index_to_loc_format @index_to_loc_format end |
#mac_style ⇒ Object
Apple Mac style information.
78 79 80 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 78 def mac_style @mac_style end |
#modified ⇒ Object
The modification time of the font.
72 73 74 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 72 def modified @modified end |
#smallest_readable_size ⇒ Object
The smallest readable size in pixels per em for this font.
84 85 86 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 84 def smallest_readable_size @smallest_readable_size end |
#units_per_em ⇒ Object
The number of units per em for the font. Should be a power of 2 in the range from 64 through 16384.
66 67 68 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 66 def units_per_em @units_per_em end |
#version ⇒ Object
The version of the font (a Rational).
53 54 55 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 53 def version @version end |
Instance Method Details
#checksum_valid? ⇒ Boolean
The checksum for the head table is calculated differently because the checksum_adjustment value is not used during the calculation.
See: Table#checksum_valid?
105 106 107 108 109 |
# File 'lib/hexapdf/font/true_type/table/head.rb', line 105 def checksum_valid? data = raw_data data[8, 4] = 0.chr * 4 directory_entry.checksum == self.class.calculate_checksum(data) end |