Class: Fontisan::OpenTypeFont
- Extended by:
- OpenTypeFontExtensions
- Defined in:
- lib/fontisan/open_type_font.rb
Overview
OpenType Font domain object
Represents an OpenType Font file (CFF outlines). Inherits all shared SFNT functionality from SfntFont and adds OpenType-specific behavior including page-aligned lazy loading for optimal performance.
Constant Summary collapse
- PAGE_SIZE =
Page size for lazy loading alignment (typical filesystem page size)
4096
Constants inherited from SfntFont
SfntFont::PADDING_BYTES, SfntFont::SFNT_TABLE_CLASS_MAP, SfntFont::TABLE_CLASS_MAP
Instance Attribute Summary collapse
-
#page_cache ⇒ Object
Page cache for lazy loading (maps page_start_offset => page_data).
Attributes inherited from SfntFont
#io_source, #lazy_load_enabled, #loading_mode, #parsed_tables, #sfnt_tables, #table_data, #table_entry_cache
Instance Method Summary collapse
-
#cff? ⇒ Boolean
Check if font is CFF flavored.
-
#format ⇒ Symbol
High-level pipeline format identifier.
-
#initialize_storage ⇒ void
Initialize storage hashes.
-
#truetype? ⇒ Boolean
Check if font is TrueType flavored.
-
#valid? ⇒ Boolean
Validate format correctness.
Methods included from OpenTypeFontExtensions
Methods inherited from SfntFont
#all_sfnt_tables, #close, #collection?, #family_name, finalize, #find_table_entry, from_collection, from_file, #full_name, #has_table?, #head_table, #outline_type, #post_script_name, #preferred_family_name, #preferred_subfamily_name, #read_metadata_tables_batched, #read_table_data, #setup_finalizer, #sfnt_table, #subfamily_name, #table, #table_available?, #table_names, #to_file, #units_per_em, #update_checksum_adjustment_in_file, #update_checksum_adjustment_in_io, #variation_type
Instance Attribute Details
#page_cache ⇒ Object
Page cache for lazy loading (maps page_start_offset => page_data)
36 37 38 |
# File 'lib/fontisan/open_type_font.rb', line 36 def page_cache @page_cache end |
Instance Method Details
#cff? ⇒ Boolean
Check if font is CFF flavored
73 74 75 |
# File 'lib/fontisan/open_type_font.rb', line 73 def cff? true end |
#format ⇒ Symbol
High-level pipeline format identifier. Owned by the font class so the conversion pipeline can dispatch without case statements (OCP).
33 |
# File 'lib/fontisan/open_type_font.rb', line 33 def format = :otf |
#initialize_storage ⇒ void
This method returns an undefined value.
Initialize storage hashes
Extends base class to add page_cache for lazy loading.
46 47 48 49 |
# File 'lib/fontisan/open_type_font.rb', line 46 def initialize_storage super @page_cache = {} end |
#truetype? ⇒ Boolean
Check if font is TrueType flavored
66 67 68 |
# File 'lib/fontisan/open_type_font.rb', line 66 def truetype? false end |