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
43 44 45 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 43 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.
33 34 35 36 37 38 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 33 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
50 51 52 |
# File 'lib/fontisan/pipeline/strategies/preserve_strategy.rb', line 50 def strategy_name :preserve end |