Skip to content

feature: font-rounded selects the rounded system font design - #529

Open
SRWieZ wants to merge 1 commit into
NativePHP:mainfrom
SRWieZ:feat/font-rounded
Open

SRWieZ wants to merge 1 commit into
NativePHP:mainfrom
SRWieZ:feat/font-rounded

Conversation

@SRWieZ

@SRWieZ SRWieZ commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

SwiftUI has four system font designs: default, serif, monospaced and rounded (SF Pro Rounded, the face of the Apple Watch and Fitness numbers). NativePHP already maps the first three to Tailwind classes (font-sans, font-serif, font-mono), but there is no way to ask for the rounded one: font-rounded is dropped by the parser without a word.

This PR adds font-rounded next to the other three, sent as fontFamily 3. It is a one-line parser change plus tests; drawing it is the renderer's job, in NativePHP/mobile-ui#121.

Why it helps: rounded numbers are the friendly look apps use for scores, counters, timers and stats, and it is a system font, so there is nothing to bundle and it follows Dynamic Type. Platforms without a rounded system font (Android) keep the default sans, as they already do for any design they can't draw. Nothing changes for apps that don't use the class.

<native:text class="font-rounded font-bold text-5xl">42 · 128</native:text>

Before / after, with the mobile-ui renderer change (iPhone 17 Pro simulator, iOS 26.5): on main, font-rounded renders like font-sans; after, it is SF Pro Rounded:

font-rounded

font-sans, font-serif and font-mono already map to SwiftUI's font
designs; font-rounded adds the fourth, .rounded (SF Pro Rounded), as
fontFamily 3. Renderers without a rounded system face keep the default
sans, as they do for the other designs they cannot draw.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants