StringToPath 0.1

StringToPath 0.1

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2016年3月
SPM支持 SPM

Cem Olcay 维护。



  • cemolcay

NSString-Glyphs

NSString 的分类,用于返回一个使用 Core Text 的您选择的字体的 UIBezierPath。您还需要将 Core Text 框架添加到您的项目中。

然后您可以创建这样的精美效果

Lovely example

使用这个分类非常简单

// Obtain a string with your desired character in it
NSString *test = @"4";
// Create the font you wish to use
UIFont *font = [UIFont systemFontOfSize:100];
// Get the path
UIBezierPath *glyphPath = [test bezierPathWithFont:font];

然后您可以根据需要将路径用于任何绘图代码

[[UIColor whiteColor] set];
[glyphPath fill];