TextPreferences

public struct TextPreferences

Text preferemces

  • Text font

    Declaration

    Swift

    public var font: SFWFont
  • Text color type

    Declaration

    Swift

    public var textColorType: SFWConfiguration.ColorType
  • Horizontal offset in slice from the center, default value is 0

    Declaration

    Swift

    public var horizontalOffset: CGFloat
  • Vertical offset in slice from the center

    Declaration

    Swift

    public var verticalOffset: CGFloat
  • Flip the text upside down, default value is true

    Declaration

    Swift

    public var flipUpsideDown: Bool
  • Is text curved or not, works only with orientation equal to horizontal, default value is true

    Declaration

    Swift

    public var isCurved: Bool
  • Text orientation, default value is .horizontal

    Declaration

    Swift

    public var orientation: Orientation
  • The technique to use for wrapping and truncating the label’s text, default value is .clip

    Declaration

    Swift

    public var lineBreakMode: LineBreakMode
  • The maximum number of lines to use for rendering text., default valie is 1

    Declaration

    Swift

    public var numberOfLines: Int
  • Spacing between lines, default value is 3

    Declaration

    Swift

    public var spacing: CGFloat
  • The technique to use for aligning the text, default value is .left

    Declaration

    Swift

    public var alignment: NSTextAlignment
  • Maximum width that will be available for text

    Declaration

    Swift

    public var maxWidth: CGFloat
  • Initiates a text preferences

    Declaration

    Swift

    public init(textColorType: SFWConfiguration.ColorType,
                font: SFWFont,
                verticalOffset: CGFloat = 0)

    Parameters

    textColorType

    Text color type

    font

    Font

    verticalOffset

    Vertical offset in slice from the center, default value is 0

  • Text orientation, horizontal or vertical

    See more

    Declaration

    Swift

    enum Orientation
  • The technique to use for wrapping and truncating the label’s text

    See more

    Declaration

    Swift

    enum LineBreakMode
  • Creates a color for text, relative to slice index position

    Declaration

    Swift

    func color(for index: Int) -> SFWColor

    Parameters

    index

    Slice index

    Return Value

    Color

  • Creates text attributes, relative to slice index position

    Declaration

    Swift

    func textAttributes(for index: Int) -> [NSAttributedString.Key : Any]

    Parameters

    index

    Slice index

    Return Value

    Text attributes