class Fontist::Import::Google::Models::Axis
Constants
- STANDARD_TAGS
-
Standard OpenType variable font axis tags
Public Instance Methods
Source
# File lib/fontist/import/google/models/axis.rb, line 51 def custom_axis? !STANDARD_TAGS.key?(tag) end
Check if this is a custom (non-standard) axis
@return [Boolean] true if tag is not a standard OpenType axis
Source
# File lib/fontist/import/google/models/axis.rb, line 65 def description type = STANDARD_TAGS[tag] || "custom" start_val = format_value(start) end_val = format_value(self.end) "#{tag} (#{type}): #{start_val}β#{end_val}" end
Get a human-readable description of the axis
@return [String] description of the axis
Source
# File lib/fontist/import/google/models/axis.rb, line 58 def range [start, self.end] end
Get the range of values as an array
@return [Array<Float>] [start, end]
Source
# File lib/fontist/import/google/models/axis.rb, line 44 def slant_axis? tag == "slnt" end
Check if this is the slant axis
@return [Boolean] true if tag is βslntβ
Source
# File lib/fontist/import/google/models/axis.rb, line 30 def weight_axis? tag == "wght" end
Check if this is the weight axis
@return [Boolean] true if tag is βwghtβ
Source
# File lib/fontist/import/google/models/axis.rb, line 37 def width_axis? tag == "wdth" end
Check if this is the width axis
@return [Boolean] true if tag is βwdthβ