TextShape

public class TextShape: Shape

TextShape defines a concrete subclass of Shape that draws a bezier curve whose shape looks like text.

  • The text used to define the shape’s path. Defaults to C4.

    Declaration

    Swift

    public var text: String = "C4"
  • The font used to define the shape’s path. Defaults to AvenirNext-DemiBold, 80pt.

    Declaration

    Swift

    public var font = Font(name: "AvenirNext-DemiBold", size: 80)!
  • Initializes a new TextShape from a specifed string and a font

    let f = Font(name:"Avenir Next", size: 120)
    let t = TextShape(text:"C4", font: f)
    t.center = canvas.center
    canvas.add(t)
    

    Declaration

    Swift

    public convenience init?(text: String, font: Font)

    Parameters

    text

    The string to be rendered as a shape

    font

    The font used to define the shape of the text

  • Initializes a new TextShape from a specifed string, using C4’s default font.

    let t = TextShape(text:"C4")
    t.center = canvas.center
    canvas.add(t)
    

    Declaration

    Swift

    public convenience init?(text: String)

    Parameters

    text

    text The string to be rendered as a shape