---
title: CGTextDrawingMode
framework: coregraphics
role: symbol
role_heading: Enumeration
path: coregraphics/cgtextdrawingmode
---

# CGTextDrawingMode

Modes for rendering text.

## Declaration

```swift
enum CGTextDrawingMode
```

## Overview

Overview You provide a text drawing mode constant to the function setTextDrawingMode(_:) to set the current text drawing mode for a graphics context. Text drawing modes determine how Core Graphics renders individual glyphs onscreen. For example, you can set a text drawing mode to draw text filled in or outlined (stroked) or both. You can also create special effects with the text clipping drawing modes, such as clipping an image to a glyph shape.

## Topics

### Constants

- [CGTextDrawingMode.fill](coregraphics/cgtextdrawingmode/fill.md)
- [CGTextDrawingMode.stroke](coregraphics/cgtextdrawingmode/stroke.md)
- [CGTextDrawingMode.fillStroke](coregraphics/cgtextdrawingmode/fillstroke.md)
- [CGTextDrawingMode.invisible](coregraphics/cgtextdrawingmode/invisible.md)
- [CGTextDrawingMode.fillClip](coregraphics/cgtextdrawingmode/fillclip.md)
- [CGTextDrawingMode.strokeClip](coregraphics/cgtextdrawingmode/strokeclip.md)
- [CGTextDrawingMode.fillStrokeClip](coregraphics/cgtextdrawingmode/fillstrokeclip.md)
- [CGTextDrawingMode.clip](coregraphics/cgtextdrawingmode/clip.md)

### Initializers

- [init(rawValue:)](coregraphics/cgtextdrawingmode/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### 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)
