Class: Fontisan::Woff2TableDirectoryEntry
- Inherits:
-
Object
- Object
- Fontisan::Woff2TableDirectoryEntry
- Defined in:
- lib/fontisan/woff2_font.rb
Overview
WOFF2 Table Directory Entry structure
WOFF2 table directory entries are more complex than WOFF, with transformation flags and variable-length sizes.
Constant Summary collapse
- TRANSFORM_NONE =
Transformation version flags
0- TRANSFORM_GLYF_LOCA =
0- TRANSFORM_LOCA =
1- TRANSFORM_HMTX =
2- KNOWN_TAGS =
Known table tags with assigned indices (0-62)
[ "cmap", "head", "hhea", "hmtx", "maxp", "name", "OS/2", "post", "cvt ", "fpgm", "glyf", "loca", "prep", "CFF ", "VORG", "EBDT", "EBLC", "gasp", "hdmx", "kern", "LTSH", "PCLT", "VDMX", "vhea", "vmtx", "BASE", "GDEF", "GPOS", "GSUB", "EBSC", "JSTF", "MATH", "CBDT", "CBLC", "COLR", "CPAL", "SVG ", "sbix", "acnt", "avar", "bdat", "bloc", "bsln", "cvar", "fdsc", "feat", "fmtx", "fvar", "gvar", "hsty", "just", "lcar", "mort", "morx", "opbd", "prop", "trak", "Zapf", "Silf", "Glat", "Gloc", "Feat", "Sill" ].freeze
Instance Attribute Summary collapse
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#orig_length ⇒ Object
Returns the value of attribute orig_length.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#transform_length ⇒ Object
Returns the value of attribute transform_length.
-
#transform_version ⇒ Object
Get transform version for this table.
Instance Method Summary collapse
-
#initialize ⇒ Woff2TableDirectoryEntry
constructor
A new instance of Woff2TableDirectoryEntry.
-
#transformed? ⇒ Boolean
Check if table is transformed.
Constructor Details
#initialize ⇒ Woff2TableDirectoryEntry
Returns a new instance of Woff2TableDirectoryEntry.
57 58 59 60 |
# File 'lib/fontisan/woff2_font.rb', line 57 def initialize @flags = 0 @transform_version = TRANSFORM_NONE end |
Instance Attribute Details
#flags ⇒ Object
Returns the value of attribute flags.
36 37 38 |
# File 'lib/fontisan/woff2_font.rb', line 36 def flags @flags end |
#offset ⇒ Object
Returns the value of attribute offset.
36 37 38 |
# File 'lib/fontisan/woff2_font.rb', line 36 def offset @offset end |
#orig_length ⇒ Object
Returns the value of attribute orig_length.
36 37 38 |
# File 'lib/fontisan/woff2_font.rb', line 36 def orig_length @orig_length end |
#tag ⇒ Object
Returns the value of attribute tag.
36 37 38 |
# File 'lib/fontisan/woff2_font.rb', line 36 def tag @tag end |
#transform_length ⇒ Object
Returns the value of attribute transform_length.
36 37 38 |
# File 'lib/fontisan/woff2_font.rb', line 36 def transform_length @transform_length end |
#transform_version ⇒ Object
Get transform version for this table
68 69 70 |
# File 'lib/fontisan/woff2_font.rb', line 68 def transform_version @transform_version end |
Instance Method Details
#transformed? ⇒ Boolean
Check if table is transformed
63 64 65 |
# File 'lib/fontisan/woff2_font.rb', line 63 def transformed? (@flags & 0x3F) != 0x3F && KNOWN_TAGS[tag_index]&.start_with?(/glyf|loca|hmtx/) end |