C4iOS icon indicating copy to clipboard operation
C4iOS copied to clipboard

TextShape should handle newlines and tabs

Open traviskirton opened this issue 8 years ago • 0 comments

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.

traviskirton avatar Apr 16 '16 00:04 traviskirton