Class: Fontisan::Tables::CompoundGlyph::Component
- Inherits:
-
Struct
- Object
- Struct
- Fontisan::Tables::CompoundGlyph::Component
- Defined in:
- lib/fontisan/tables/glyf/compound_glyph.rb
Overview
Component data structure
Instance Attribute Summary collapse
-
#arg1 ⇒ Object
Returns the value of attribute arg1.
-
#arg2 ⇒ Object
Returns the value of attribute arg2.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#glyph_index ⇒ Object
Returns the value of attribute glyph_index.
-
#scale_01 ⇒ Object
Returns the value of attribute scale_01.
-
#scale_10 ⇒ Object
Returns the value of attribute scale_10.
-
#scale_x ⇒ Object
Returns the value of attribute scale_x.
-
#scale_y ⇒ Object
Returns the value of attribute scale_y.
Instance Method Summary collapse
-
#args_are_xy? ⇒ Boolean
Check if arguments are x,y offsets (vs point numbers).
-
#has_2x2? ⇒ Boolean
Check if component has 2x2 transformation matrix.
-
#has_scale? ⇒ Boolean
Check if component has uniform scale.
-
#has_xy_scale? ⇒ Boolean
Check if component has separate x,y scale.
-
#overlap? ⇒ Boolean
Check if component overlaps with others.
-
#transformation_matrix ⇒ Array<Float>
Get transformation matrix as array [a, b, c, d, e, f] representing affine transformation: x' = ax + cy + e, y' = bx + dy + f.
-
#use_my_metrics? ⇒ Boolean
Check if using this component's metrics.
Instance Attribute Details
#arg1 ⇒ Object
Returns the value of attribute arg1
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def arg1 @arg1 end |
#arg2 ⇒ Object
Returns the value of attribute arg2
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def arg2 @arg2 end |
#flags ⇒ Object
Returns the value of attribute flags
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def flags @flags end |
#glyph_index ⇒ Object
Returns the value of attribute glyph_index
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def glyph_index @glyph_index end |
#scale_01 ⇒ Object
Returns the value of attribute scale_01
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def scale_01 @scale_01 end |
#scale_10 ⇒ Object
Returns the value of attribute scale_10
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def scale_10 @scale_10 end |
#scale_x ⇒ Object
Returns the value of attribute scale_x
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def scale_x @scale_x end |
#scale_y ⇒ Object
Returns the value of attribute scale_y
55 56 57 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 55 def scale_y @scale_y end |
Instance Method Details
#args_are_xy? ⇒ Boolean
Check if arguments are x,y offsets (vs point numbers)
66 67 68 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 66 def args_are_xy? (flags & ARGS_ARE_XY_VALUES) != 0 end |
#has_2x2? ⇒ Boolean
Check if component has 2x2 transformation matrix
86 87 88 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 86 def has_2x2? (flags & WE_HAVE_A_TWO_BY_TWO) != 0 end |
#has_scale? ⇒ Boolean
Check if component has uniform scale
76 77 78 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 76 def has_scale? (flags & WE_HAVE_A_SCALE) != 0 end |
#has_xy_scale? ⇒ Boolean
Check if component has separate x,y scale
81 82 83 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 81 def has_xy_scale? (flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0 end |
#overlap? ⇒ Boolean
Check if component overlaps with others
91 92 93 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 91 def overlap? (flags & OVERLAP_COMPOUND) != 0 end |
#transformation_matrix ⇒ Array<Float>
Get transformation matrix as array [a, b, c, d, e, f] representing affine transformation: x' = ax + cy + e, y' = bx + dy + f
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 99 def transformation_matrix if has_2x2? [scale_x, scale_01, scale_10, scale_y, arg1, arg2] elsif has_xy_scale? [scale_x, 0.0, 0.0, scale_y, arg1, arg2] elsif has_scale? [scale_x, 0.0, 0.0, scale_x, arg1, arg2] else [1.0, 0.0, 0.0, 1.0, arg1, arg2] end end |
#use_my_metrics? ⇒ Boolean
Check if using this component's metrics
71 72 73 |
# File 'lib/fontisan/tables/glyf/compound_glyph.rb', line 71 def use_my_metrics? (flags & USE_MY_METRICS) != 0 end |