简体   繁体   中英

How to get UIBezierpath using Glyph in iOS SDK

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..

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM