Style

open class Style : Hashable, Equatable

Encapsulates the appearance properties of an element. Implements Hashable and Equatable.

  • Initializes a new instance of the Style class.

    Declaration

    Swift

    public init()
  • Initializes a new instance of the Style class from the specified prototype.

    Declaration

    Swift

    public init(prototype: Style)

    Parameters

    prototype

    The Style to use as a prototype.

  • Loads this Style from the specified XML context and element.

    Declaration

    Swift

    open func loadFromXml(_ element: XmlElement?, context: XmlContext)

    Parameters

    element

    The XmlElement, which contains this style. The value can be nil.

    context

    The XmlContext, which contains this style.

  • Saves this style into the specified XML element.

    Declaration

    Swift

    open func saveToXml(_ element: XmlElement?)

    Parameters

    element

    The XmlElement, where the Style will be saved. The value can be nil.

  • Checks if there is a brush associated with this Style.

    Declaration

    Swift

    open func hasBrush() -> Bool

    Return Value

    true if there is a brush; otherwise false.

  • Checks if there is a back brush associated with this Style.

    Declaration

    Swift

    open func hasBackBrush() -> Bool

    Return Value

    true if there is a back brush; otherwise false.

  • Checks if there is a stroke associated with this Style.

    Declaration

    Swift

    open func hasStroke() -> Bool

    Return Value

    true if there is a stroke; otherwise false.

  • Checks if the stroke associated with this Style has thickness.

    Declaration

    Swift

    open func hasStrokeThickness() -> Bool

    Return Value

    true if there is stroke thickness; otherwise false.

  • Checks if there is text color associated with this Style.

    Declaration

    Swift

    open func hasTextColor() -> Bool

    Return Value

    true if there is text color; otherwise false.

  • Checks if there font name associated with this Style.

    Declaration

    Swift

    open func hasFontName() -> Bool

    Return Value

    true if there is font name; otherwise false.

  • Checks if there font size associated with this Style.

    Declaration

    Swift

    open func hasFontSize() -> Bool

    Return Value

    true if there is font size; otherwise false.

  • Checks if there font unit associated with this Style.

    Declaration

    Swift

    open func hasFontUnit() -> Bool

    Return Value

    true if there is font unit; otherwise false.

  • Checks if this Style defines vertical alignment for text.

    Declaration

    Swift

    open func hasVerticalTextAlignment() -> Bool

    Return Value

    true if there is vertical alignment for text; otherwise false.

  • Checks if this Style defines horizontal alignment for text.

    Declaration

    Swift

    open func hasHorizontalTextAlignment() -> Bool

    Return Value

    true if there is horizontal alignment for text; otherwise false.

  • Checks if this Style defines head stroke.

    Declaration

    Swift

    open func hasHeadStroke() -> Bool

    Return Value

    true if there is head stroke; otherwise false.

  • Checks if this Style defines thickness for the head stroke.

    Declaration

    Swift

    open func hasHeadStrokeThickness() -> Bool

    Return Value

    true if there is thickness for the head stroke; otherwise false.

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Specifies the brush for this Style.

    Declaration

    Swift

    open var brush: Brush?
  • Specifies the back brush for this Style.

    Declaration

    Swift

    open var backBrush: Brush?
  • Specifies the stroke for this Style.

    Declaration

    Swift

    open var stroke: Color
  • Specifies the stroke thickness for this Style.

    Declaration

    Swift

    open var strokeThickness: Double
  • Specifies the text color for this Style.

    Declaration

    Swift

    open var textColor: Color
  • Specifies the font name for text in this Style.

    Declaration

    Swift

    open var fontName: String
  • Specifies the font size for text in this Style.

    Declaration

    Swift

    open var fontSize: Double
  • Specifies the font measure unit for text in this Style.

    Declaration

    Swift

    open var fontUnit: MeasureUnit?
  • Specifies the vertical alignment for text in this Style.

    Declaration

    Swift

    open var verticalTextAlignment: VerticalAlignment
  • Specifies the horizontal alignment for text in this Style.

    Declaration

    Swift

    open var horizontalTextAlignment: HorizontalAlignment
  • Specifies the head stroke in this Style.

    Declaration

    Swift

    open var headStroke: Color
  • Specifies the thickness for the head stroke.

    Declaration

    Swift

    open var headStrokeThickness: Double