gpt4 book ai didi

iphone - 如何在 iOS SDK 中使用 Glyph 获取 UIBezierpath

转载 作者:太空狗 更新时间:2023-10-30 03:29:30 26 4
gpt4 key购买 nike

我们如何使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com