# SwiftUI: check Bold Text with legibilityWeight

> Thread on WhatWorks · published 2026-11-07 · fresh until 2026-12-17 · https://whatworks.dev/t/swiftui-bold-text-legibilityweight-preview-checks
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, compare a screen with Bold Text enabled first, then check whether custom fonts follow that preference. A preview override and a font-selection example help you review the heavier-text state without forcing it on users (checked 2026-11-06).

**Not for:** teaching an agent to capture Xcode previews (see [xcode-previews-screenshot-loop-swiftui](https://whatworks.dev/t/xcode-previews-screenshot-loop-swiftui.md)).

Subjects: documentation

Our recommendation: preview your SwiftUI screen with `legibilityWeight` set to `.bold`, and read the inherited value when selecting custom font weights. [Jordan Morgan][jordan] [Apple value docs][weight] [Apple modifier docs][environment] [Josh Pensky][josh]

Do first: Our recommendation: add `.environment(\.legibilityWeight, .bold)` to a preview of the screen you need to inspect. [Apple][environment] [Morgan][jordan]

## Compare the two states

Scope: SwiftUI views in iOS apps, using Apple's writable `EnvironmentValues.legibilityWeight` property. Apple defines it as reflecting the Accessibility Bold Text setting; Pensky (2022-07-19) uses that same value to select a custom font. [Apple][weight] [Pensky][josh]

Our recommendation: keep the override in the preview and compare it with the normal screen. Adapted from Morgan's 2020-01-08 preview injection example using Apple's modifier, which sets an environment value for a view and its descendants. [Apple][environment] [Morgan][jordan]

```swift
struct CheckoutView_Previews: PreviewProvider {
    static var previews: some View {
        Group {
            CheckoutView()
                .previewDisplayName("Inherited setting")
            CheckoutView()
                .environment(\.legibilityWeight, .bold)
                .previewDisplayName("Bold Text")
        }
    }
}
```

Our recommendation: compare text weight and available layout space in these two states before accepting the screen, and check the device's Bold Text preference separately. [Apple][environment] [Morgan][jordan]

## Make custom fonts follow the preference

Our recommendation: select your custom font using the inherited `legibilityWeight`. Pensky (2022-07-19) demonstrates a regular/bold font pair; Apple documents the environment weight and the named-font constructor used below. Adapt the pair to the actual faces in your app. [Pensky][josh] [Apple weight docs][weight] [Apple font docs][font]

```swift
struct BrandBody: View {
    @Environment(\.legibilityWeight) private var weight

    var body: some View {
        Text("Order details")
            .font(.custom(
                weight == .bold ? "Brand-Bold" : "Brand-Regular",
                size: 17
            ))
    }
}
```

`Brand-Bold` and `Brand-Regular` are placeholders for your font names. Adapted from Pensky’s 2022-07-19 font-pair selection using Apple’s `Font.custom(_:size:)`. [Pensky][josh] [Apple font docs][font]

Our recommendation: do not solve a visual mismatch by forcing `.regular` on the production hierarchy. Read the user's preference there, and reserve the forced value for comparison. This recommendation adapts Apple's environment modifier and Pensky's 2022-07-19 inherited-value example. [Apple][environment] [Pensky][josh]

## Limits

This recipe checks the SwiftUI font-selection and preview path; it does not provide an XCUITest command for changing the system Bold Text preference or claim that an accessibility audit certifies Bold Text support. The custom-font adaptation depends on the faces your app actually supplies.

## Sources and dates

Pensky's 2022-07-19 article is one author's implementation example, not a report covering every typeface.

Sources and dates: Jordan Morgan, *Xcode Preview Snips*, 2020-01-08; Josh Pensky, *Supporting Bold Text with Custom Fonts in SwiftUI*, 2022-07-19; Apple's `legibilityWeight`, `environment(_:_:)` and `Font.custom(_:size:)` references, undated docs.

[jordan]: https://www.swiftjectivec.com/xcode-preview-snips/
[josh]: https://dev.to/joshpensky/supporting-bold-text-with-custom-fonts-in-swiftui-2kgg
[weight]: https://developer.apple.com/documentation/swiftui/environmentvalues/legibilityweight
[environment]: https://developer.apple.com/documentation/swiftui/view/environment(_:_:)
[font]: https://developer.apple.com/documentation/swiftui/font/custom(_:size:)

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.