Class: Clef::Engraving::Style
- Inherits:
-
Object
- Object
- Clef::Engraving::Style
- Defined in:
- lib/clef/engraving/style.rb
Instance Attribute Summary collapse
-
#beam_thickness ⇒ Object
readonly
Returns the value of attribute beam_thickness.
-
#line_width ⇒ Object
readonly
Returns the value of attribute line_width.
-
#margin ⇒ Object
readonly
Returns the value of attribute margin.
-
#measure_padding ⇒ Object
readonly
Returns the value of attribute measure_padding.
-
#min_note_spacing ⇒ Object
readonly
Returns the value of attribute min_note_spacing.
-
#notehead_width ⇒ Object
readonly
Returns the value of attribute notehead_width.
-
#page_size ⇒ Object
readonly
Returns the value of attribute page_size.
-
#staff_gap ⇒ Object
readonly
Returns the value of attribute staff_gap.
-
#staff_size ⇒ Object
readonly
Returns the value of attribute staff_size.
-
#staff_space ⇒ Object
readonly
Returns the value of attribute staff_space.
-
#system_gap ⇒ Object
readonly
Returns the value of attribute system_gap.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page_size: "A4", margin: 36, staff_size: 20, staff_space: 10, min_note_spacing: nil, line_width: 820, system_gap: 72, staff_gap: 90, measure_padding: 14, notehead_width: 7, beam_thickness: nil) ⇒ Style
constructor
A new instance of Style.
Constructor Details
#initialize(page_size: "A4", margin: 36, staff_size: 20, staff_space: 10, min_note_spacing: nil, line_width: 820, system_gap: 72, staff_gap: 90, measure_padding: 14, notehead_width: 7, beam_thickness: nil) ⇒ Style
Returns a new instance of Style.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/clef/engraving/style.rb', line 21 def initialize(page_size: "A4", margin: 36, staff_size: 20, staff_space: 10, min_note_spacing: nil, line_width: 820, system_gap: 72, staff_gap: 90, measure_padding: 14, notehead_width: 7, beam_thickness: nil) min_note_spacing ||= Rules::MIN_NOTE_SPACING * staff_space beam_thickness ||= Rules::BEAM_THICKNESS * staff_space validate_positive!( margin: margin, staff_size: staff_size, staff_space: staff_space, min_note_spacing: min_note_spacing, line_width: line_width, system_gap: system_gap, staff_gap: staff_gap, measure_padding: measure_padding, notehead_width: notehead_width, beam_thickness: beam_thickness ) @page_size = page_size @margin = margin @staff_size = staff_size @staff_space = staff_space @min_note_spacing = min_note_spacing @line_width = line_width @system_gap = system_gap @staff_gap = staff_gap @measure_padding = measure_padding @notehead_width = notehead_width @beam_thickness = beam_thickness end |
Instance Attribute Details
#beam_thickness ⇒ Object (readonly)
Returns the value of attribute beam_thickness.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def beam_thickness @beam_thickness end |
#line_width ⇒ Object (readonly)
Returns the value of attribute line_width.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def line_width @line_width end |
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def margin @margin end |
#measure_padding ⇒ Object (readonly)
Returns the value of attribute measure_padding.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def measure_padding @measure_padding end |
#min_note_spacing ⇒ Object (readonly)
Returns the value of attribute min_note_spacing.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def min_note_spacing @min_note_spacing end |
#notehead_width ⇒ Object (readonly)
Returns the value of attribute notehead_width.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def notehead_width @notehead_width end |
#page_size ⇒ Object (readonly)
Returns the value of attribute page_size.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def page_size @page_size end |
#staff_gap ⇒ Object (readonly)
Returns the value of attribute staff_gap.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def staff_gap @staff_gap end |
#staff_size ⇒ Object (readonly)
Returns the value of attribute staff_size.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def staff_size @staff_size end |
#staff_space ⇒ Object (readonly)
Returns the value of attribute staff_space.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def staff_space @staff_space end |
#system_gap ⇒ Object (readonly)
Returns the value of attribute system_gap.
6 7 8 |
# File 'lib/clef/engraving/style.rb', line 6 def system_gap @system_gap end |