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 -
init(fontFamily:size: color: verticalAlignment: horizontalAlignment: bold: italic: underline: strikeout: kerning: wrap: ) Creates a new instance of a
TextStyleobjectDeclaration
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
fontFamilyThe desired font family (can be and defaults to
nilsizeThe desired size of the text
colorThe desired color of the text
verticalAlignmentThe desired horizontal alignment of the text inside the text
Objects bounding rectanglehorizontalAlignmentThe desired vertical alignment of the text inside the text
Objects bounding rectangleboldtrueif the text should be rendered in bolditalictrueif the text should be rendered in italicsunderlinetrueif the text should be underlinedstrikeouttrueif the text should be struck outkerningtrueif the kerning should be applied during text renderingwraptrueif the text should be wrapped within the textObjects bounding rectangle
View on GitHub
TextStyle Structure Reference