Class: Fontist::Resource
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Fontist::Resource
- Defined in:
- lib/fontist/resource.rb
Overview
Resource - v5 resource with format metadata for multi-format support
Instance Method Summary collapse
- #axes_tags ⇒ Object
- #collection_file? ⇒ Boolean
- #empty? ⇒ Boolean
- #has_axis?(tag) ⇒ Boolean
- #static_font? ⇒ Boolean
- #variable_font? ⇒ Boolean
Instance Method Details
#axes_tags ⇒ Object
42 43 44 |
# File 'lib/fontist/resource.rb', line 42 def Array(variable_axes).map(&:to_s) end |
#collection_file? ⇒ Boolean
50 51 52 |
# File 'lib/fontist/resource.rb', line 50 def collection_file? %w[ttc otc].include?(format&.to_s) end |
#empty? ⇒ Boolean
30 31 32 |
# File 'lib/fontist/resource.rb', line 30 def empty? Array(urls).empty? && Array(files).empty? end |
#has_axis?(tag) ⇒ Boolean
46 47 48 |
# File 'lib/fontist/resource.rb', line 46 def has_axis?(tag) .include?(tag.to_s) end |
#static_font? ⇒ Boolean
38 39 40 |
# File 'lib/fontist/resource.rb', line 38 def static_font? !variable_font? end |
#variable_font? ⇒ Boolean
34 35 36 |
# File 'lib/fontist/resource.rb', line 34 def variable_font? variable_axes && !variable_axes.empty? end |