showTextAtPoint(x:y:string:length:)
Displays a character string at a position you specify.
Declaration
func showTextAtPoint(x: CGFloat, y: CGFloat, string: UnsafePointer<CChar>, length: Int)Parameters
- x:
A value for the x-coordinate (in user space) at which to display the text.
- y:
A value for the y-coordinate (in user space) at which to display the text.
- string:
An array of characters to draw.
- length:
The length of the array specified in the
stringparameter.
Discussion
Core Graphics uses font data provided by the system to map each byte of the array through the encoding vector of the current font to obtain the glyph to display. Note that the font must have been set using selectFont(name:size:textEncoding:). Don’t use CGContextShowTextAtPoint in conjunction with setFont(_:).
See Also
Related Documentation
showGlyphsAtPoint(x:y:glyphs:count:)showGlyphs(g:count:)showGlyphsWithAdvances(glyphs:advances:count:)
Drawing Text
textMatrixtextPositionselectFont(name:size:textEncoding:)setCharacterSpacing(_:)setFont(_:)setFontSize(_:)setTextDrawingMode(_:)setAllowsFontSmoothing(_:)setAllowsFontSubpixelPositioning(_:)setAllowsFontSubpixelQuantization(_:)setShouldSmoothFonts(_:)setShouldSubpixelPositionFonts(_:)setShouldSubpixelQuantizeFonts(_:)showGlyphs(g:count:)showGlyphs(_:at:)