Skip to content

TextShape should handle newlines and tabs #652

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions