Class: Fontisan::Ufo::Image
- Inherits:
-
Object
- Object
- Fontisan::Ufo::Image
- Defined in:
- lib/fontisan/ufo/image.rb
Overview
A background image anchored to a glyph (common in color fonts).
In UFO 3, images live in UFO/images/ as binary blobs (PNG in
practice). Each image is referenced from a glyph's GLIF via
<image fileName="..."/>. The image set stores the actual bytes
and deduplicates by sha256 content hash.
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Instance Method Summary collapse
-
#initialize(file_name:, transformation: nil, color: nil, sha: nil, bytes: nil) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(file_name:, transformation: nil, color: nil, sha: nil, bytes: nil) ⇒ Image
Returns a new instance of Image.
19 20 21 22 23 24 25 26 |
# File 'lib/fontisan/ufo/image.rb', line 19 def initialize(file_name:, transformation: nil, color: nil, sha: nil, bytes: nil) @file_name = file_name.to_s @transformation = transformation @color = color @sha = sha @bytes = bytes end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes.
12 13 14 |
# File 'lib/fontisan/ufo/image.rb', line 12 def bytes @bytes end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
12 13 14 |
# File 'lib/fontisan/ufo/image.rb', line 12 def color @color end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
12 13 14 |
# File 'lib/fontisan/ufo/image.rb', line 12 def file_name @file_name end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
12 13 14 |
# File 'lib/fontisan/ufo/image.rb', line 12 def sha @sha end |
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
12 13 14 |
# File 'lib/fontisan/ufo/image.rb', line 12 def transformation @transformation end |