---
title: "showTextAtPoint(x:y:string:length:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/showtextatpoint(x:y:string:length:)"
---

# showTextAtPoint(x:y:string:length:)

Displays a character string at a position you specify.

## Declaration

```swift
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 string parameter.

## Discussion

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:)](coregraphics/cgcontext/showglyphsatpoint(x:y:glyphs:count:).md)
- [showGlyphs(g:count:)](coregraphics/cgcontext/showglyphs(g:count:).md)
- [showGlyphsWithAdvances(glyphs:advances:count:)](coregraphics/cgcontext/showglyphswithadvances(glyphs:advances:count:).md)

### Drawing Text

- [textMatrix](coregraphics/cgcontext/textmatrix.md)
- [textPosition](coregraphics/cgcontext/textposition.md)
- [selectFont(name:size:textEncoding:)](coregraphics/cgcontext/selectfont(name:size:textencoding:).md)
- [setCharacterSpacing(_:)](coregraphics/cgcontext/setcharacterspacing(_:).md)
- [setFont(_:)](coregraphics/cgcontext/setfont(_:).md)
- [setFontSize(_:)](coregraphics/cgcontext/setfontsize(_:).md)
- [setTextDrawingMode(_:)](coregraphics/cgcontext/settextdrawingmode(_:).md)
- [setAllowsFontSmoothing(_:)](coregraphics/cgcontext/setallowsfontsmoothing(_:).md)
- [setAllowsFontSubpixelPositioning(_:)](coregraphics/cgcontext/setallowsfontsubpixelpositioning(_:).md)
- [setAllowsFontSubpixelQuantization(_:)](coregraphics/cgcontext/setallowsfontsubpixelquantization(_:).md)
- [setShouldSmoothFonts(_:)](coregraphics/cgcontext/setshouldsmoothfonts(_:).md)
- [setShouldSubpixelPositionFonts(_:)](coregraphics/cgcontext/setshouldsubpixelpositionfonts(_:).md)
- [setShouldSubpixelQuantizeFonts(_:)](coregraphics/cgcontext/setshouldsubpixelquantizefonts(_:).md)
- [showGlyphs(g:count:)](coregraphics/cgcontext/showglyphs(g:count:).md)
- [showGlyphs(_:at:)](coregraphics/cgcontext/showglyphs(_:at:).md)
