Skip to content

TextShape should handle newlines and tabs #652

Open
@traviskirton

Description

@traviskirton

Here is a sample:

let newline: unichar = "\n"
if unichars[i] == newline {
    origin.x = 0.0
    origin.y += CGFloat(font.lineHeight)
}

Including:

extension unichar : UnicodeScalarLiteralConvertible {
    public typealias UnicodeScalarLiteralType = UnicodeScalar

    public init(unicodeScalarLiteral scalar: UnicodeScalar) {
        self.init(scalar.value)
    }
}

This shows proof of concept. We should figure out a more robust solution and add this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions