| name | pgts-apple |
| description | Apply Pretty Good Type Scale (PGTS) in iOS, iPadOS, and macOS Swift or SwiftUI projects using the generated PGTS.swift export. Use when a coding agent needs to map PGTS roles to Apple text styles, Dynamic Type, custom fonts, or native app typography. |
PGTS Apple
Use this skill when the target is an Apple platform project. Use platforms/apple/PGTS.swift as the generated starter export and tokens/pgts.tokens.json as the canonical source.
Canonical roles: editorial-mega-display, display-large, display, headline-large, headline, title-large, title, body, footnote, caption, legal.
Lean roles for product UI: display, headline-large, title-large, title, body, footnote.
Integration
Copy or import the generated Swift file into the host app module. Add a package or module declaration only if the host project requires it.
Use PGTSRole for semantic identity, PGTSContext for mobile, desktop, or print contexts, and PGTS.style(_:) for the numeric values:
let style = PGTS.style(.display)
let font = style.font(for: .mobile, design: .serif)
Dynamic Type
Use role.dynamicTypeTextStyle as the semantic scaling hint. The generated file provides point-size anchors, but the host app should decide how custom fonts scale with Dynamic Type.
For SwiftUI, pair the generated point size with the app's preferred font and text scaling policy. For UIKit/AppKit, bridge the role to the host typography utilities rather than hard-coding every screen manually.
Font Ownership
PGTS does not bundle fonts. Apply the host app's custom font separately and test the selected typeface for x-height, ascenders, descenders, optical size, and line-height behavior.
Verification
- Confirm all lean roles exist in the host typography layer.
- Check Dynamic Type or text-size accessibility settings.
- Verify display roles do not clip on compact widths.
- Verify
footnote, caption, and legal remain readable.
- Run
npm run build after token changes and npm run validate before returning work.