TextStyle

public struct TextStyle : Equatable

Represents the formating and style of text Objects.

  • Text should be wrapped inside the bounding rectangle

    Declaration

    Swift

    public let wrap: Bool
  • The desired font (if any) of the text

    Declaration

    Swift

    public let fontFamily: String?
  • The size in pixels the text should be rendered at

    Declaration

    Swift

    public let pixelSize: Int
  • The color the text should be rendered in

    Declaration

    Swift

    public let color: Color
  • The vertical alignment of the text within the bounding rectangle

    Declaration

    Swift

    public let verticalAlignment: VerticalTextAlignment
  • The horizontal alignement of the text within the bounding rectangle

    Declaration

    Swift

    public let horizontalAlignment: HorizontalTextAlignment
  • Specifies if the text should be rendered in bold

    Declaration

    Swift

    public let bold: Bool
  • Specifies if the text should be rendered with italics

    Declaration

    Swift

    public let italic: Bool
  • Specifies if the text should be underlined when rendered

    Declaration

    Swift

    public let underline: Bool
  • Specifies if the text should be struck out when rendered

    Declaration

    Swift

    public let strikeout: Bool
  • Specifies if kerning should be applied to the rendered text

    Declaration

    Swift

    public let kerning: Bool
  • Creates a new instance of a TextStyle object

    Declaration

    Swift

    public init(fontFamily: String? = nil, size: Int = 16, color: Color = Color(r: 255, g: 255, b: 255), verticalAlignment: VerticalTextAlignment = .top, horizontalAlignment: HorizontalTextAlignment = .left, bold: Bool = false, italic: Bool = false, underline: Bool = false, strikeout: Bool = false, kerning: Bool = true, wrap: Bool = true)

    Parameters

    fontFamily

    The desired font family (can be and defaults to nil

    size

    The desired size of the text

    color

    The desired color of the text

    verticalAlignment

    The desired horizontal alignment of the text inside the text Objects bounding rectangle

    horizontalAlignment

    The desired vertical alignment of the text inside the text Objects bounding rectangle

    bold

    true if the text should be rendered in bold

    italic

    true if the text should be rendered in italics

    underline

    true if the text should be underlined

    strikeout

    true if the text should be struck out

    kerning

    true if the kerning should be applied during text rendering

    wrap

    true if the text should be wrapped within the text Objects bounding rectangle