2012-05-29 9 views
9

¿Cómo podemos obtener UIBezierPath de un personaje usando Glyph en iOS SDK?Cómo obtener UIBezierpath usando Glyph en iOS SDK

me había pasado por this, pero es mostrando la línea doble y quiero solamente sola línea ..

Como soy nuevo en este research..Please ayudarme a solucionar este problema .. No quiero cualquier código, pero quiere conseguir referencia de usted ..

en realidad quiero conseguir UIBezierPath que describe la forma de cada letra del alfabeto ..

Gracias de antemano ..

Respuesta

4

Sucede que han tenido para hacer esto para un proyecto en el que estoy trabajando, encontré esta referencia muy útil: Low-level text rendering.

El código del núcleo que utiliza para crear una ruta desde un glifo (ajustado para su caso):

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