我们如何使用 iOS SDK 中的 Glyph
从字符获取 UIBezierPath
。
我经历了this , 但它显示双线,我只想要单线..
因为我是这项研究的新手..请帮我解决这个问题..我不想要任何代码但想从你那里得到引用..
实际上我想获取描述每个字母形状的UIBezierPath
..
提前致谢..
最佳答案
我碰巧不得不为我正在进行的项目执行此操作,我发现此引用非常有用:Low-level text rendering .
我用来从字形创建路径的核心代码(根据您的情况进行了调整):
CGGlyph glyph = ...;
CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)@"Helvetica", 25, NULL);
CGAffineTransform transform = CGAffineTransformIdentity;
CGPathRef path = CTFontCreatePathForGlyph(font, glyph, &transform);
UIBezierPath *bezier = [UIBezierPath bezierPathWithCGPath:path];
CGPathRelease(path);
CFRelease(font);
关于iphone - 如何在 iOS SDK 中使用 Glyph 获取 UIBezierpath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10794388/