Module: Fontisan::SfntSource
Overview
Marks a class as providing the SFNT font source interface.
SfntFont, WoffFont, and Woff2Font all expose the same table-access surface (#table, #tables, #table_data, #table_names, #has_table?) but don't share a common base class (WOFF/WOFF2 wrap an SfntFont but inherit from BinData::Record directly).
Including this module lets callers type-check with is_a?(SfntSource)
instead of respond_to?(:table) duck-typing.
Instance Method Summary collapse
- #has_table?(tag) ⇒ Boolean
-
#table(tag) ⇒ Object?
Parsed table or nil.
-
#table_data(tag = nil) ⇒ Hash<String, String>
Raw table bytes by tag.
-
#table_names ⇒ Array<String>
Table tags present in this font.
Instance Method Details
#has_table?(tag) ⇒ Boolean
26 |
# File 'lib/fontisan/sfnt_source.rb', line 26 def has_table?(tag); end |
#table(tag) ⇒ Object?
Returns parsed table or nil.
16 |
# File 'lib/fontisan/sfnt_source.rb', line 16 def table(tag); end |
#table_data(tag = nil) ⇒ Hash<String, String>
Returns raw table bytes by tag.
19 |
# File 'lib/fontisan/sfnt_source.rb', line 19 def table_data(tag = nil); end |
#table_names ⇒ Array<String>
Returns table tags present in this font.
22 |
# File 'lib/fontisan/sfnt_source.rb', line 22 def table_names; end |