Class: Fontisan::OpenTypeCollection
- Inherits:
-
BaseCollection
- Object
- BinData::Record
- BaseCollection
- Fontisan::OpenTypeCollection
- Defined in:
- lib/fontisan/open_type_collection.rb
Overview
OpenType Collection domain object
Represents a complete OpenType Collection file (OTC). Inherits all shared functionality from BaseCollection and implements OTC-specific behavior.
Class Method Summary collapse
-
.collection_format ⇒ String
Get the collection format identifier.
-
.font_class ⇒ Class
Get the font class for OpenType collections.
Instance Method Summary collapse
-
#extract_fonts(io) ⇒ Array<OpenTypeFont>
Extract fonts as OpenTypeFont objects.
-
#format ⇒ Symbol
High-level pipeline format identifier.
Methods inherited from BaseCollection
#collection?, #collection_info, #font, #font_count, from_file, #list_fonts, #outline_type, #table_names, #valid?, #variation_type, #version, #version_string
Methods included from Collection::SharedLogic
#calculate_table_sharing_for_fonts
Class Method Details
.collection_format ⇒ String
Get the collection format identifier
32 33 34 |
# File 'lib/fontisan/open_type_collection.rb', line 32 def self.collection_format "OTC" end |
.font_class ⇒ Class
Get the font class for OpenType collections
25 26 27 |
# File 'lib/fontisan/open_type_collection.rb', line 25 def self.font_class OpenTypeFont end |
Instance Method Details
#extract_fonts(io) ⇒ Array<OpenTypeFont>
Extract fonts as OpenTypeFont objects
Reads each font from the OTC file and returns them as OpenTypeFont objects. This method uses the from_collection method.
43 44 45 46 47 |
# File 'lib/fontisan/open_type_collection.rb', line 43 def extract_fonts(io) font_offsets.map do |offset| OpenTypeFont.from_collection(io, offset) end end |
#format ⇒ Symbol
High-level pipeline format identifier. Owned by the collection class so the conversion pipeline can dispatch without case statements (OCP).
20 |
# File 'lib/fontisan/open_type_collection.rb', line 20 def format = :otc |