Skip to content

Instantly share code, notes, and snippets.

View victorchee's full-sized avatar
🎯
Focusing

Victor Chee victorchee

🎯
Focusing
View GitHub Profile
func p_setupTextLayer(text: String) -> CAShapeLayer {
var letters = CGPathCreateMutable()
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil)
let attrs = [kCTFontAttributeName: font]
var attrString = NSAttributedString(string: text, attributes: attrs)
let line = CTLineCreateWithAttributedString(attrString)
let runArray = CTLineGetGlyphRuns(line)