Exception: Fontisan::MissingVariationTableError

Inherits:
VariationError show all
Defined in:
lib/fontisan/error.rb

Overview

Missing required variation table

Raised when font lacks required variation tables.

Instance Attribute Summary

Attributes inherited from VariationError

#context, #suggestion

Instance Method Summary collapse

Methods inherited from VariationError

#detailed_message

Constructor Details

#initialize(table: nil, message: nil) ⇒ MissingVariationTableError

Initialize with table tag

Parameters:

  • table (String) (defaults to: nil)

    Missing table tag

  • message (String, nil) (defaults to: nil)

    Custom message



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/fontisan/error.rb', line 85

def initialize(table: nil, message: nil)
  if message
    super(message, context: { table: table })
  else
    super(
      "Missing required variation table: #{table}",
      context: { table: table },
      suggestion: "This font is not a variable font or lacks #{table} table"
    )
  end
end