<!--
{
  "availability" : [
    "iOS: 2.0.0 - 7.0.0",
    "iPadOS: 2.0.0 - 7.0.0",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/showTextAtPoint(x:y:string:length:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextShowTextAtPoint"
  },
  "title" : "showTextAtPoint(x:y:string:length:)"
}
-->

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

Displays a character string at a position you specify.

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

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:)`](/documentation/CoreGraphics/CGContext/selectFont(name:size:textEncoding:)). Don’t use `CGContextShowTextAtPoint` in conjunction with [`setFont(_:)`](/documentation/CoreGraphics/CGContext/setFont(_:)).

## See Also

[`showGlyphsAtPoint(x:y:glyphs:count:)`](/documentation/CoreGraphics/CGContext/showGlyphsAtPoint(x:y:glyphs:count:))

Displays an array of glyphs at a position you specify.

[`showGlyphs(g:count:)`](/documentation/CoreGraphics/CGContext/showGlyphs(g:count:))

Displays an array of glyphs at the current text position.

[`showGlyphsWithAdvances(glyphs:advances:count:)`](/documentation/CoreGraphics/CGContext/showGlyphsWithAdvances(glyphs:advances:count:))

Draws an array of glyphs with varying offsets.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)