Class: Fontist::Macos::Catalog::FontInfo
- Inherits:
-
Object
- Object
- Fontist::Macos::Catalog::FontInfo
- Defined in:
- lib/fontist/macos/catalog/asset.rb
Overview
Represents metadata for a single font within an asset
Instance Attribute Summary collapse
-
#font_family_name ⇒ Object
readonly
Returns the value of attribute font_family_name.
-
#font_style_name ⇒ Object
readonly
Returns the value of attribute font_style_name.
-
#platform_delivery ⇒ Object
readonly
Returns the value of attribute platform_delivery.
-
#postscript_name ⇒ Object
readonly
Returns the value of attribute postscript_name.
-
#preferred_family_name ⇒ Object
readonly
Returns the value of attribute preferred_family_name.
-
#preferred_style_name ⇒ Object
readonly
Returns the value of attribute preferred_style_name.
Instance Method Summary collapse
- #display_names ⇒ Object
-
#initialize(data) ⇒ FontInfo
constructor
A new instance of FontInfo.
- #macos_compatible? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ FontInfo
Returns a new instance of FontInfo.
74 75 76 77 78 79 80 81 82 |
# File 'lib/fontist/macos/catalog/asset.rb', line 74 def initialize(data) @data = data @postscript_name = data["PostScriptFontName"] @font_family_name = data["FontFamilyName"] @font_style_name = data["FontStyleName"] @preferred_family_name = data["PreferredFamilyName"] @preferred_style_name = data["PreferredStyleName"] @platform_delivery = data["PlatformDelivery"] || [] end |
Instance Attribute Details
#font_family_name ⇒ Object (readonly)
Returns the value of attribute font_family_name.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def font_family_name @font_family_name end |
#font_style_name ⇒ Object (readonly)
Returns the value of attribute font_style_name.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def font_style_name @font_style_name end |
#platform_delivery ⇒ Object (readonly)
Returns the value of attribute platform_delivery.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def platform_delivery @platform_delivery end |
#postscript_name ⇒ Object (readonly)
Returns the value of attribute postscript_name.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def postscript_name @postscript_name end |
#preferred_family_name ⇒ Object (readonly)
Returns the value of attribute preferred_family_name.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def preferred_family_name @preferred_family_name end |
#preferred_style_name ⇒ Object (readonly)
Returns the value of attribute preferred_style_name.
70 71 72 |
# File 'lib/fontist/macos/catalog/asset.rb', line 70 def preferred_style_name @preferred_style_name end |
Instance Method Details
#display_names ⇒ Object
84 85 86 |
# File 'lib/fontist/macos/catalog/asset.rb', line 84 def display_names @data["DisplayNames"] || {} end |
#macos_compatible? ⇒ Boolean
88 89 90 91 92 93 94 95 96 |
# File 'lib/fontist/macos/catalog/asset.rb', line 88 def macos_compatible? # No platform delivery means compatible with all return true if @platform_delivery.empty? # Check if any platform delivery includes macOS (but not invisible) @platform_delivery.any? do |platform| platform.include?("macOS") && platform != "macOS-invisible" end end |