Repository navigation
Let apps set fonts, weights, letter spacing and line height - #20
Merged
Merged
Conversation
TranscriptStyle could set only the body size and spacing. The text always used system fonts, headings used fixed multiples of the body size, and the text did not follow Dynamic Type, so an app with its own type scale could not make the text match the rest of its UI. TranscriptFont describes one kind of text: a font name or the system font, a size, a weight, a monospaced option, letter spacing and a line height. TranscriptStyle has bodyFont, headingFonts (one per level) and codeFont, which inline code also uses. Nil or empty keeps the fonts that were used before. A line height replaces lineSpacing for that kind of text, centres the text in the line, and is never less than the font needs. scaled(for:) scales every text size and line height for a content size category, as UIFontMetrics scales body text. TranscriptText applies it from the environment when scalesWithDynamicType is on. Closes #2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TranscriptStylecould set only the body size and spacing: system fonts, headings at fixed multiples, and no Dynamic Type.TranscriptFont: a font name or the system font, a size, a weight, a monospaced option, letter spacing and a line height.TranscriptStyle.bodyFont,headingFonts(one per level; later levels use the last) andcodeFont(also the design of inline code, at 0.9 times the text around it). Nil or empty keeps the fonts that were used before.lineSpacingfor that kind of text, centres the text in the line, and is never less than the font needs.TranscriptStyle.scaled(for:)scales every text size and line height asUIFontMetricsscales body text.TranscriptTextapplies it from the environment whenscalesWithDynamicTypeis on.Closes #2.
Stack
This PR is part of a stack. It is based on #19 (
feature/style-colors), so its diff shows only this change. Merge the stack in order, starting with #17.Tests
swift test: 131 tests pass.NSFontpath. The iOS path was checked on an iPhone 12 mini, iOS 27.0:scalesWithDynamicType, the same text is 22 pt tall at.largeand 48 pt at.accessibility3.🤖 Generated with Claude Code