Class: Layout::Style
- Inherits:
-
Object
- Object
- Layout::Style
Overview
Graphical and text styles (value objects). Layout::Entity#style returns a copy; changes must be assigned back using Layout::Entity#style= for them to take effect, similar to LayOut. Only properties relevant to the object type will be applied.
Units: line width, arrow size, font size in points (1 point ≈ 0.353 mm).
Constants # collapse
- Layout::Style::JOIN_STYLE_MITER
Miter join.
- Layout::Style::JOIN_STYLE_ROUND
Round corner connection.
- Layout::Style::JOIN_STYLE_BEVEL
Bevel join (default).
- Layout::Style::CAP_STYLE_FLAT
Flat endpoints (default).
- Layout::Style::CAP_STYLE_ROUND
Round cap endpoint.
- Layout::Style::CAP_STYLE_SQUARE
Square cap endpoints.
- Layout::Style::STROKE_PATTERN_SOLID
Line type: Solid.
- Layout::Style::STROKE_PATTERN_DASH
Line type: Dashed.
- Layout::Style::STROKE_PATTERN_DOT
Line Type: Dot Dash.
- Layout::Style::STROKE_PATTERN_DASH_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_DOT_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_SPACE
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_DOT_DOT_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_DASH_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_DASH_DASH_DOT_DOT_DOT
Line type constant (LayOut name).
- Layout::Style::STROKE_PATTERN_CENTER
Line Type: Center Dash Dot
- Layout::Style::STROKE_PATTERN_PHANTOM
Stroke pattern: Dotted and dashed.
- Layout::Style::STROKE_PATTERN_SHORT_DASH
Line type: Short dash.
- Layout::Style::ARROW_NONE
Arrows: None.
- Layout::Style::ARROW_FILLED_TRIANGLE
Arrow: Filled Triangle.
- Layout::Style::ARROW_OPEN_TRIANGLE
Arrow: Hollow Triangle.
- Layout::Style::ARROW_FILLED_SKINNY_TRIANGLE
Arrow constant (LayOut name).
- Layout::Style::ARROW_OPEN_SKINNY_TRIANGLE
Arrow constant (LayOut name).
- Layout::Style::ARROW_OPEN_ARROW_90
Arrow constant (LayOut name).
- Layout::Style::ARROW_OPEN_ARROW_120
Arrow constant (LayOut name).
- Layout::Style::ARROW_FILLED_CIRCLE
Arrow: Filled Circle.
- Layout::Style::ARROW_OPEN_CIRCLE
Arrow constant (LayOut name).
- Layout::Style::ARROW_FILLED_SQUARE
Arrow: Filled Square.
- Layout::Style::ARROW_OPEN_SQUARE
Arrow constant (LayOut name).
- Layout::Style::ARROW_FILLED_DIAMOND
Arrow: Filled Diamond.
- Layout::Style::ARROW_OPEN_DIAMOND
Arrow constant (LayOut name).
- Layout::Style::ARROW_STAR
Arrow constant (LayOut name).
- Layout::Style::ARROW_T
Arrow constant (LayOut name).
- Layout::Style::ARROW_SLASH_RIGHT
Arrow: Slash (architectural dimension leader).
- Layout::Style::ARROW_SLASH_LEFT
Arrow constant (LayOut name).
- Layout::Style::ARROW_UNDERRUN
Arrow constant (LayOut name).
- Layout::Style::ARROW_OVERRUN
Arrow constant (LayOut name).
- Layout::Style::ALIGN_LEFT
Align text to the left.
- Layout::Style::ALIGN_RIGHT
Align text to the right.
- Layout::Style::ALIGN_CENTER
Center the text.
Class Method Summary # collapse
-
.new ⇒ Layout::Style
Empty Style: Unset properties read their default values, and when applied to an object, only set properties are applied.
Instance Method Summary # collapse
-
#initialize_copy ⇒ Layout::Style
Copy the style.
-
#stroked ⇒ Boolean
Returns whether the outline is drawn.
-
#stroked= ⇒ Boolean
Set whether to stroke.
-
#stroke_color ⇒ ModraUp::Color
Stroke color (for lines and text color).
-
#stroke_color= ⇒ ModraUp::Color, String
Sets the line color.
-
#stroke_width ⇒ Float
Line width in points.
-
#stroke_width= ⇒ Numeric
Set the line width in pounds (path as 0.05~5 mm, dimensions and leaders as 0.02~5 mm).
-
#stroke_pattern ⇒ Integer
Line patterns, STROKE_PATTERN_*.
-
#stroke_pattern= ⇒ Integer
Set the line pattern.
-
#stroke_pattern_scale ⇒ Float
Line type scale.
-
#stroke_pattern_scale= ⇒ Numeric
Set the line pattern scale.
-
#stroke_join_style ⇒ Integer
Line segment connection style, JOIN_STYLE_*.
-
#stroke_join_style= ⇒ Integer
Set the connection style.
-
#stroke_cap_style ⇒ Integer
Endpoint style, CAP_STYLE_*.
-
#stroke_cap_style= ⇒ Integer
Set the endpoint style.
-
#solid_filled ⇒ Boolean
Whether to use solid color filling.
-
#solid_filled= ⇒ Boolean
Set solid color filling.
-
#fill_color ⇒ ModraUp::Color
Fill color.
-
#fill_color= ⇒ ModraUp::Color, String
Sets the fill color.
-
#pattern_filled ⇒ Boolean
Does the pattern fill exist?
-
#pattern_filled= ⇒ Boolean
Enable or disable pattern filling; when enabled, use diagonal lines if no pattern is selected.
-
#fill_pattern ⇒ Symbol
Built-in fill patterns: :none, :horizontal, :vertical, :diagonal, :back_diagonal, :crosshatch, :dots.
-
#fill_pattern= ⇒ Symbol
Select a built-in fill pattern with 3 mm spacing on the sheet.
-
#pattern_fill_path ⇒ Object
Does not support: OpenSu has no image fill.
-
#pattern_fill_path= ⇒ Object
Does not support: OpenSu has no image fill.
-
#start_arrow_type ⇒ Integer
Start arrow, ARROW_*.
-
#start_arrow_type= ⇒ Integer
Sets the start arrow. Only applicable to open paths, leaders, and dimensions.
-
#end_arrow_type ⇒ Integer
End arrow, ARROW_*.
-
#end_arrow_type= ⇒ Integer
Set the end arrow type.
-
#start_arrow_size ⇒ Float
Start arrow size in points.
-
#start_arrow_size= ⇒ Numeric
Set the size of the start arrow.
-
#end_arrow_size ⇒ Float
The size of the end arrow, in points.
-
#end_arrow_size= ⇒ Numeric
Set the size of the end arrow.
-
#font_family ⇒ String
Font family; an empty string if unknown.
-
#font_family= ⇒ String
Set the font family. An ArgumentError is raised if the font is not installed.
-
#font_size ⇒ Float
Font size, points (point size = font_size × 0.353 mm).
-
#font_size= ⇒ Numeric
Set the font size in points. The height of the text characters is limited to 1~30 mm, with dimensions and notes ranging from 0.5~30 mm.
-
#text_color ⇒ ModraUp::Color
Text color.
-
#text_color= ⇒ ModraUp::Color, String
Set the text color.
-
#text_bold ⇒ Boolean
Is bold.
-
#text_bold= ⇒ Boolean
Set text to bold (effective only for text).
-
#text_italic ⇒ Boolean
Whether the text is italic.
-
#text_italic= ⇒ Boolean
Set text in italic (effective only for text).
-
#text_alignment ⇒ Integer
Paragraph alignment, ALIGN_*.
-
#text_alignment= ⇒ Integer
Set paragraph alignment (only effective for text).
Class Method Details
Layout::Style.new ⇒ Layout::Style
Empty Style: Unset properties read their default values, and when applied to an object, only set properties are applied.
Instance Method Details
style.dup ⇒ Layout::Style
Copy the style.
style.stroked ⇒ Boolean
Returns whether the outline is drawn.
style.stroked = stroked
Set whether to stroke.
style.stroke_color ⇒ ModraUp::Color
Stroke color (for lines and text color).
style.stroke_color = color
Sets the line color.
style.stroke_width ⇒ Float
Line width in points.
style.stroke_width = points
Set the line width in pounds (path as 0.05~5 mm, dimensions and leaders as 0.02~5 mm).
style.stroke_pattern ⇒ Integer
Line patterns, STROKE_PATTERN_*.
style.stroke_pattern = pattern
Set the line pattern.
style.stroke_pattern_scale ⇒ Float
Line type scale.
style.stroke_pattern_scale = scale
Set the line pattern scale.
style.stroke_join_style ⇒ Integer
Line segment connection style, JOIN_STYLE_*.
style.stroke_join_style = join
Set the connection style.
style.stroke_cap_style ⇒ Integer
Endpoint style, CAP_STYLE_*.
style.stroke_cap_style = cap
Set the endpoint style.
style.solid_filled ⇒ Boolean
Whether to use solid color filling.
style.solid_filled = filled
Set solid color filling.
style.fill_color ⇒ ModraUp::Color
Fill color.
style.fill_color = color
Sets the fill color.
style.pattern_filled ⇒ Boolean
Does the pattern fill exist?
style.pattern_filled = filled
Enable or disable pattern filling; when enabled, use diagonal lines if no pattern is selected.
style.fill_pattern ⇒ Symbol
Built-in fill patterns: :none, :horizontal, :vertical, :diagonal, :back_diagonal, :crosshatch, :dots.
style.fill_pattern = pattern
Select a built-in fill pattern with 3 mm spacing on the sheet.
style.pattern_fill_path ⇒ raises
Does not support: OpenSu has no image fill.
style.pattern_fill_path = path ⇒ raises
Does not support: OpenSu has no image fill.
style.start_arrow_type ⇒ Integer
Start arrow, ARROW_*.
style.start_arrow_type = type
Sets the start arrow. Only applicable to open paths, leaders, and dimensions.
style.end_arrow_type ⇒ Integer
End arrow, ARROW_*.
style.end_arrow_type = type
Set the end arrow type.
style.start_arrow_size ⇒ Float
Start arrow size in points.
style.start_arrow_size = points
Set the size of the start arrow.
style.end_arrow_size ⇒ Float
The size of the end arrow, in points.
style.end_arrow_size = points
Set the size of the end arrow.
style.font_family ⇒ String
Font family; an empty string if unknown.
style.font_family = family
Set the font family. An ArgumentError is raised if the font is not installed.
style.font_size ⇒ Float
Font size, points (point size = font_size × 0.353 mm).
style.font_size = points
Set the font size in points. The height of the text characters is limited to 1~30 mm, with dimensions and notes ranging from 0.5~30 mm.
style.text_color ⇒ ModraUp::Color
Text color.
style.text_color = color
Set the text color.
style.text_bold ⇒ Boolean
Is bold.
style.text_bold = bold
Set text to bold (effective only for text).
style.text_italic ⇒ Boolean
Whether the text is italic.
style.text_italic = italic
Set text in italic (effective only for text).
style.text_alignment ⇒ Integer
Paragraph alignment, ALIGN_*.
style.text_alignment = align
Set paragraph alignment (only effective for text).