Typography

From rshankras/claude-code-apple-skills · View interactive version

Typography is an AI agent skill from the GitHub repository rshankras/claude-code-apple-skills. UI typography on Apple platforms — text styles and Dynamic Type, the San Francisco family (Pro/Rounded/Compact/Mono/New York + width axis), optical sizes, tracking vs kerning, leading adjustments, and custom-font scaling. Use when choosing fonts, building type hierarchy, fixing truncation/legibility

How to use this skill

Skill file

Typography

Type is most of your UI. The system does the hard parts — optical sizes, tracking tables,

Dynamic Type — if you use its APIs. This skill covers when to trust the system, how to build

hierarchy deliberately, and what custom fonts owe you back.

When This Skill Activates

Rule 1: text styles first

Predefined styles (Large Title → Caption 2) are weight + size + leading combos with Dynamic

Type support built in — and different styles scale differently (body grows more than

footnote), which manual font sizes can't replicate.

varies per style: some go medium→semibold, others bold→heavy) before reaching for new fonts.

scaling assumptions.

Rule 2: let optical sizes and tracking work

letterforms, looser tracking for legibility; above: tighter, more refined). System font APIs do

this automatically — hardcoded single-cut fonts don't.

disable clashing features (ligatures). Override system tracking only in exceptional cases.

manually squeezing — and prefer wrapping to truncating (line limit 0 on labels that matter).

system adds leading automatically for tall scripts (Arabic, Devanagari).

The Dynamic Type ladder (WWDC24 10074)

12 sizes: 7 default + 5 accessibility (AX1–AX5). .body runs 17pt at default up to 53pt

at AX5 — roughly 3× taller, and layouts must expect that. Escalate in order:

  1. Text styles — .font(.title) / preferredFont(forTextStyle:) +

adjusts-for-content-size, line count 0 so text wraps instead of truncating.

  1. @ScaledMetric for the non-text riding alongside (icon frames, spacing); SF

Symbols scale via UIImage.SymbolConfiguration(textStyle:). Prioritize scaling

essential content over decoration.

  1. Switch layout axis at accessibility sizes — branch on

dynamicTypeSize.isAccessibilitySize with AnyLayout(HStackLayout()) /

AnyLayout(VStackLayout()) (UIKit: flip the stack axis on

preferredContentSizeCategory.isAccessibilityCategory); give text the full line

width and relax lineLimit.

  1. Large Content Viewer — only for bars that legitimately can't grow: a tab bar takes

under 10% of screen height, and scaled to accessibility sizes it would eat almost a

quarter (WWDC24 10074). Scaling is always preferred; the viewer is the fallback, not

the fix.

Test at all 12 sizes (Xcode Previews → Variants → Dynamic Type Variants), not just the

biggest — mid-range accessibility sizes catch different wrap points.

The San Francisco family — pick by job

| Face | Job |

|---|---|

| SF Pro | The default; UI text everywhere |

| SF Pro Rounded | Friendlier numerals/labels — widgets, health/fitness data |

| SF Compact | watchOS (space-efficient counterpart) |

| SF Mono | Code, tabular alignment |

| New York | Serif — reading experiences, editorial contrast |

| SF Arabic / SF Arabic Rounded | Arabic script with its own optical sizes |

The width axis (Condensed / Regular / Compressed / Expanded):

vertical proportions, so mixing them never misaligns baselines. 2–3 styles are enough —

pair one width with contrasting weights, one weight with contrasting widths, or oppose both

for maximum display contrast.

Custom fonts: what you owe back

System fonts get Dynamic Type free; a brand font makes you the type engine:

SwiftUI Font.custom(_:size:relativeTo:); scale layout constants with @ScaledMetric.

font doesn't cover (the system stacks: system-ui, ui-rounded, ui-serif, ui-monospace

on the web).

does that a licensed font usually doesn't.

❌ Anti-patterns: hardcoded point sizes on user-facing text · kerning APIs for tracking jobs ·

custom font without relativeTo: (frozen size) · Compressed body text · truncation where

wrapping was possible.

Output Format

Type review: Element | Current (font/size/style) | Issue (hierarchy/scaling/legibility) | Fix

— check Dynamic Type at XXL + AX sizes before signing off; pairs with the contrast rules in

generators/accessibility-generator.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.