Function

CTFontCreatePathForGlyph

Creates a path for the specified glyph.

Declaration

CGPathRef CTFontCreatePathForGlyph(CTFontRef font, CGGlyph glyph, const CGAffineTransform *matrix);

Parameters

font

The font reference.

glyph

The glyph.

transform

An affine transform applied to the path. Can be NULL. If NULL, CGAffineTransformIdentity is used.

Return Value

A CGPath object containing the glyph outlines, NULL on error. Must be released by caller.

Discussion

Creates a path from the outlines of the glyph for the specified font. The path reflects the font point size, matrix, and transform parameter, applied in that order. The transform parameter is most commonly be used to provide a translation to the desired glyph origin.

See Also

Getting Glyph Data

CTFontGetGlyphWithName

Returns the CGGlyph value for the specified glyph name in the given font.

CTFontGetBoundingRectsForGlyphs

Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.

CTFontGetAdvancesForGlyphs

Calculates the advances for an array of glyphs and returns the summed advance.

CTFontGetOpticalBoundsForGlyphs

Calculates the optical bounds for an array of glyphs and returns the overall optical bounds for the run.

CTFontGetVerticalTranslationsForGlyphs

Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.