TextStyle
public struct TextStyle : Equatable
Represents the formating and style of text Object
s.
-
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
TextStyle
objectDeclaration
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
Object
s bounding rectanglehorizontalAlignment
The desired vertical alignment of the text inside the text
Object
s bounding rectanglebold
true
if the text should be rendered in bolditalic
true
if the text should be rendered in italicsunderline
true
if the text should be underlinedstrikeout
true
if the text should be struck outkerning
true
if the kerning should be applied during text renderingwrap
true
if the text should be wrapped within the textObject
s bounding rectangle