Class: Fontisan::Pipeline::Strategies::PreserveStrategy
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- Fontisan::Pipeline::Strategies::PreserveStrategy
- Defined in:
- lib/fontisan/pipeline/strategies/preserve_strategy.rb
Overview
Strategy for preserving variation data during conversion
This strategy maintains all variation tables intact, making it suitable for conversions between compatible formats:
- Variable TTF → Variable TTF (same format)
- Variable OTF → Variable OTF (same format)
- Variable TTF → Variable WOFF/WOFF2 (packaging change only)
- Variable OTF → Variable WOFF/WOFF2 (packaging change only)
The strategy copies all font tables including:
- Variation tables: fvar, gvar/CFF2, avar, HVAR, VVAR, MVAR
- Base tables: All non-variation tables
Instance Attribute Summary
Attributes inherited from BaseStrategy
Instance Method Summary collapse
-
#preserves_variation? ⇒ Boolean
Check if strategy preserves variation data.
-
#resolve(font) ⇒ Hash<String, String>
Resolve by preserving all variation data.
-
#strategy_name ⇒ Symbol
Get strategy name.
Methods inherited from BaseStrategy
Constructor Details
This class inherits a constructor from Fontisan::Pipeline::Strategies::BaseStrategy
Instance Method Details
#preserves_variation? ⇒ Boolean
Check if strategy preserves variation data
41 42 43 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 41 def preserves_variation? true end |
#resolve(font) ⇒ Hash<String, String>
Resolve by preserving all variation data
Returns all font tables including variation tables. This is a simple copy operation that maintains the variable font's full capabilities.
31 32 33 34 35 36 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 31 def resolve(font) # Return a copy of all font tables # This preserves variation tables (fvar, gvar, CFF2, avar, HVAR, etc.) # and all base tables font.table_data.dup end |
#strategy_name ⇒ Symbol
Get strategy name
48 49 50 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 48 def strategy_name :preserve end |