How to get UIBezierpath using Glyph in iOS SDK
Asked Answered
F

1

9

How can we get UIBezierPath from a character using Glyph in iOS SDK.

I had gone through this, but It is showing double line and I want only single line..

As I am new in this research..Please help me to solve this problem.. I do not want any code but want to get reference from you..

Actually I want to get UIBezierPath describing the shape of each letter of alphabets..

Thanks in advance..

Flip answered 29/5, 2012 at 6:52 Comment(0)
S
4

I happen to have had to do this for a project I am working on, I found this reference very helpful: Low-level text rendering.

The core code that I used to create a path from a glyph (adjusted for your case):

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);
Spooner answered 3/8, 2012 at 10:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.