Skip to content

Update Font modifiers#943

Merged
Kyle-Ye merged 4 commits into
mainfrom
feature/font_modifier
Jul 19, 2026
Merged

Update Font modifiers#943
Kyle-Ye merged 4 commits into
mainfrom
feature/font_modifier

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Jul 19, 2026

Copy link
Copy Markdown
Member

Summary

  • implement font descriptor and resolved-trait handling across the remaining Font modifiers
  • add non-CoreText descriptor shims and platform-unavailable fallback warnings
  • use semantic CoreText trait and variation-axis representations for leading, weight, width, and variable-font settings

Impact

This completes the modifier paths used to derive CoreText font descriptors while keeping unsupported platforms on an explicit, non-crashing fallback path.

Validation

  • parsed the updated Swift sources with the package availability macros
  • ran git diff --check

@github-actions github-actions Bot added area: text Text, labels, line style, and text rendering APIs. type: feature New API, behavior, platform support, or user-facing capability. labels Jul 19, 2026
@Kyle-Ye
Kyle-Ye marked this pull request as ready for review July 19, 2026 10:56
@augmentcode

augmentcode Bot commented Jul 19, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR completes the remaining Font modifier implementations needed to derive CoreText font descriptors, while providing explicit fallback behavior on platforms without CoreText.

Changes:

  • Implements descriptor and resolved-trait handling for many Font modifiers (italic/bold/leading/weight/width/grade/variation/features).
  • Adds additional private CoreText hooks and constants used for trait extraction and UI font descriptor creation.
  • Introduces non-Darwin shims for CTFont/CTFontDescriptor and moves placeholder types out of the CoreText-specific file.
  • Uses CoreText trait and variation-axis representations for leading/weight/width and variable-font settings.
  • Adds explicit platform-unavailable fallback warnings instead of crashing on unsupported platforms.

Technical Notes: The CoreText path now builds descriptors via symbolic traits, feature/variation attributes, and UI-type descriptor creation; non-CoreText builds retain API surface via minimal placeholder types and warnings.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread Sources/OpenSwiftUICore/View/Text/Font/ModifiedFont.swift
Comment thread Sources/OpenSwiftUICore/View/Text/Font/ModifiedFont.swift
Comment thread Sources/OpenSwiftUICore/View/Text/Font/ModifiedFont.swift
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.54639% with 191 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.29%. Comparing base (deaf7fa) to head (b6c78b6).

Files with missing lines Patch % Lines
.../OpenSwiftUICore/View/Text/Font/ModifiedFont.swift 1.57% 187 Missing ⚠️
...wiftUICore/Shim/CoreFoundationNonDarwinShims.swift 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #943      +/-   ##
==========================================
- Coverage   26.35%   26.29%   -0.07%     
==========================================
  Files         723      724       +1     
  Lines       51232    51368     +136     
==========================================
+ Hits        13504    13505       +1     
- Misses      37728    37863     +135     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the area: compatibility Compatibility, availability, legacy support, and cross-version behavior. label Jul 19, 2026
@Kyle-Ye
Kyle-Ye force-pushed the feature/font_modifier branch from a6da354 to b6c78b6 Compare July 19, 2026 12:40
@Kyle-Ye
Kyle-Ye merged commit 5551939 into main Jul 19, 2026
9 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/font_modifier branch July 19, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compatibility Compatibility, availability, legacy support, and cross-version behavior. area: text Text, labels, line style, and text rendering APIs. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant