fix(input): heading base-font bold + list-item spacing guard - #3
Closed
wildseansy wants to merge 1 commit into
Closed
fix(input): heading base-font bold + list-item spacing guard#3wildseansy wants to merge 1 commit into
wildseansy wants to merge 1 commit into
Conversation
A heading with a bold fontWeight (the shared default) built its font with UIFont systemFontOfSize:weight:, discarding the editor's base font family — custom-font editors got system-font headings. Android already folds heading weight into the current typeface (InputHeadingSpan), so iOS now derives the bold face from the base font via a font-descriptor trait, falling back to the system font only when the family has no bold face. Non-bold explicit weights keep the previous system-font behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follow-up fixes to #2 (the first landed on the branch just after that merge).
Changes
fontWeight(the shared default fromheadingDefaults) built its font withUIFont systemFontOfSize:weight:, discarding the editor's base font family, so custom-font editors got system-font headings. Android already folds heading weight into the current typeface (InputHeadingSpan); iOS now derives the bold face from the base font via a font-descriptor trait, falling back to the system font only when the family has no bold face. Non-bold explicit weights keep the previous system-font behavior. (Also submitted upstream as fix(input): derive heading bold from the base font on iOS software-mansion/react-native-enriched-markdown#586.)StaticLayouttreats aLineHeightSpanas paragraph-scoped:chooseHeightruns for every wrapped line of the item regardless of the span's character range, and theFontMetricsIntis reused across those calls, so the unguarded relative ascent adjustment compounded line after line — wrapped list items rendered with progressively growing gaps between visual lines. The adjustment is now guarded to the single line containing the span start, so only the item's first visual line is spaced, exactly once.Testing
clang-formatclean on touched iOS files.🤖 Generated with Claude Code