2

我想用UIBezierPath. 我在这里找到了一个教程。但是,它给了我一个代表字母轮廓的封闭路径,如下所示。我想要一个代表信件正文的路径。

这怎么能做成代表身体的单线呢?

特点

4

2 回答 2

1

In general, glyphs in modern typefaces are not "lines" in the sense you're talking about. They're outlines. To see why, think about any serif face, like Times. How would the serifs be expressed as a single line?

That said, there is a special class of type faces, colloquially referred to as "stick fonts" that are based on lines, and are often used for CNC engraving. Here is a resource: CamBam Stick Fonts Perhaps that will be helpful to you.

于 2013-08-01T11:55:00.830 回答
0

如您所见,Core Text 只能提供字形轮廓。为字形要求“单行”有点模棱两可。考虑这封信i——哪一行代表它?此外,单行不能对字形内的可变宽度信息进行编码。

有一些封闭贝塞尔路径的方法,您可以通过这些方法计算代表“中心”的某些概念的路径。我无法从脑海中回忆起它们。然而,如果你想画字形,你可以只用轮廓来完成;用于CGContextFillPath绘制填充字形(假设您的上下文具有设置的填充颜色)。

于 2013-08-01T10:26:33.807 回答