回答
對於Quartz2D中的圖形,我使用名爲PaintCode的OSX應用程序(http://www.paintcodeapp.com/)。它基本上是一個矢量繪圖應用程序,它可以生成繪圖的石英代碼。其實真的很棒。有一個類似的應用程序稱爲不透明度,但我還沒有嘗試過。
使用這樣的應用程序,您可以在背景上使用B作爲指南,並在其上繪製BezierPath。完成後,只需複製生成的代碼並將其粘貼到項目中即可。
希望它有幫助。
順便說一句,你可以下載一個演示版本。也許這可以滿足你的問題。 – Marcal
CoreText.framework提供了獲取字的路徑
看到奧萊Begemann創建http://www.codeproject.com/Articles/109729/Low-level-text-rendering
代碼示例。抱歉,我忘記了名爲AnimatedPath的演示的下載網址。
CGMutablePathRef letters = CGPathCreateMutable();
CTFontRef font = CTFontCreateWithName(CFSTR("Helvetica-Bold"), 72.0f, NULL);
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
(id)font, kCTFontAttributeName,
nil];
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"Hello World!"
attributes:attrs];
CTLineRef line = CTLineCreateWithAttributedString((CFAttributedStringRef)attrString);
CFArrayRef runArray = CTLineGetGlyphRuns(line);
// for each RUN
for (CFIndex runIndex = 0; runIndex < CFArrayGetCount(runArray); runIndex++)
{
// Get FONT for this run
CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
CTFontRef runFont = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName);
// for each GLYPH in run
for (CFIndex runGlyphIndex = 0; runGlyphIndex < CTRunGetGlyphCount(run); runGlyphIndex++)
{
// get Glyph & Glyph-data
CFRange thisGlyphRange = CFRangeMake(runGlyphIndex, 1);
CGGlyph glyph;
CGPoint position;
CTRunGetGlyphs(run, thisGlyphRange, &glyph);
CTRunGetPositions(run, thisGlyphRange, &position);
// Get PATH of outline
{
CGPathRef letter = CTFontCreatePathForGlyph(runFont, glyph, NULL);
CGAffineTransform t = CGAffineTransformMakeTranslation(position.x, position.y);
CGPathAddPath(letters, &t, letter);
CGPathRelease(letter);
}
}
}
CFRelease(line);
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointZero];
[path appendPath:[UIBezierPath bezierPathWithCGPath:letters]];
CGPathRelease(letters);
CFRelease(font);
取代的「Hello World!」與 「道你需要」。
請注意,您應該在此處發佈答案的有用觀點,或將您的帖子風險刪除爲[「未答覆」](http://meta.stackexchange.com/q/8259)。如果您願意,您可能仍然包含鏈接,但僅作爲「參考」。答案應該獨立,不需要鏈接。 –
感謝您的提醒 – nova
- 1. 遵循與狀態
- 2. 要遵循的標準字體大小
- 3. ios MapKit,遵循路徑
- 4. UIBezierPath路徑形狀Clickble和Draggable
- 5. 在swift中使用UIBezierPath繪製形狀
- 6. 形狀不規則的UIBezierPath填充
- 7. 字體的幾何形狀
- 8. UIBezierPath - byRoundingCorners - 矩形
- 9. 如何使用UIBezierPath通過動畫繪製扇形形狀?
- 10. 計算多邊形/形狀/ UIBezierPath中的填充百分比
- 11. Flash CS5中的iOS項目的Pixely字體和形狀
- 12. 計算面積UIBezierPath自定義形狀的尺寸
- 13. 不遵循斜槓字符
- 14. OpenGL紋理不遵循幾何圖形
- 15. 錨點不遵循多邊形 - JavaFX
- 16. UIBezierPath和漸變iOS
- 17. 的iOS:逆UIBezierPath(bezierPathWithOvalInRect)
- 18. 如何使用UIBezierPath裁剪圖像與另一個形狀
- 19. iOS形狀動畫
- 20. JavaScript製作實體遵循路徑
- 21. Windows窗體TabIndex不遵循索引
- 22. 物理身體不遵循PathModifier
- 23. 更改形狀內的字體ppt
- 24. 爲什麼它不遵循40號字體if語句
- 25. EKEvent不遵循EKRecurrenceRule
- 26. Hipaa遵循ASP.NET
- 27. action_mailer.delivery_method遵循
- 28. 確定使用UIBezierPath繪製的不同形狀?
- 29. 如何計算或技術UIBezierPath控制點光滑形狀
- 30. TextFrame.Characters.Font.Name不改變excel形狀的中文字體的字體
您是否得到了解決方案? –
嗨..你有什麼解決方案嗎? –