【问题标题】:How to get UIBezierpath using Glyph in iOS SDK如何在 iOS SDK 中使用 Glyph 获取 UIBezierpath
【发布时间】:2012-05-29 06:52:02
【问题描述】:

我们如何在 iOS SDK 中使用 Glyph 从角色中获取 UIBezierPath

我已经通过this,但它显示双线,我只想要单线..

由于我是这项研究的新手..请帮我解决这个问题..我不想要任何代码但想从你那里得到参考..

其实我想得到UIBezierPath描述每个字母的形状..

提前谢谢..

【问题讨论】:

    标签: iphone objective-c ipad uibezierpath glyph


    【解决方案1】:

    我碰巧不得不为我正在从事的项目这样做,我发现此参考资料非常有帮助: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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-13
      • 2015-08-08
      • 1970-01-01
      • 1970-01-01
      • 2015-06-09
      相关资源
      最近更新 更多