如何从NSGlyph转到CGGlyph?
let ctGlyph = glyph as CGGlyph
我明白了:
typealias CGGlyph = CGFontIndex
typealias CGFontIndex = UInt16
typealias NSGlyph = UInt32
那么如何进行类型转换?
我试过了:
let ctGlyph = glyph as CGGlyph
但它给了我:
错误:' NSGlyph'不能转换为' CGGlyph'
答案 0 :(得分:3)
您无法投射,但您可以使用初始值设定项:
let ctGlyph = CGGlyph(glyph)