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.
Methods inherited from BaseCollection
#collection_info, #font, #font_count, from_file, #list_fonts, #valid?, #version, #version_string
Class Method Details
.collection_format ⇒ String
Get the collection format identifier
29 30 31 |
# File 'lib/fontisan/open_type_collection.rb', line 29 def self.collection_format "OTC" end |
.font_class ⇒ Class
Get the font class for OpenType collections
21 22 23 24 |
# File 'lib/fontisan/open_type_collection.rb', line 21 def self.font_class require_relative "open_type_font" 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.
40 41 42 43 44 45 46 |
# File 'lib/fontisan/open_type_collection.rb', line 40 def extract_fonts(io) require_relative "open_type_font" font_offsets.map do |offset| OpenTypeFont.from_collection(io, offset) end end |