<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContext/setAllowsFontSubpixelPositioning(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextSetAllowsFontSubpixelPositioning"
  },
  "title" : "setAllowsFontSubpixelPositioning(_:)"
}
-->

# setAllowsFontSubpixelPositioning(_:)

Sets whether or not to allow subpixel positioning for a graphics context.

```
func setAllowsFontSubpixelPositioning(_ allowsFontSubpixelPositioning: Bool)
```

## Parameters

`allowsFontSubpixelPositioning`

A Boolean value that specifies whether subpixel positioning of glyphs is allowed in the specified context.

## Discussion

Sub-pixel positioning is used by the graphics context if it is allowed, enabled, and if the font itself is antialiased when drawn. For information on how to enable subpixel positioning, see the [`setShouldSubpixelPositionFonts(_:)`](/documentation/CoreGraphics/CGContext/setShouldSubpixelPositionFonts(_:)) function.

This parameter is not part of the graphics state.

---

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)