Centralize macOS font authority - #3389
Merged
Merged
Conversation
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.
TL;DR
The macOS frontend now resolves and updates its primary font through one
FontManager. The editor view and renderer read the same font metrics and resources across startup, font changes, and backing-scale changes.Closes #3306
Context
The macOS startup and transition paths previously constructed a primary
FontFaceinAppDelegateand a second one inFontManager. This required procedural synchronization between application, view, and renderer state. This change makesFontManagerthe sole mutable authority while leaving GPU resource ownership and the existing frontend row-fit contract intact.Changes
FontManager.AppDelegate.fontFace, duplicate startup construction, andEditorNSViewprimary-font state.Verification
xcodebuild test -project macos/Minga.xcodeproj -scheme Minga -configuration Debug -destination 'platform=macOS' -only-testing:MingaTests/FontManagerTests -only-testing:MingaTests/EditorNSViewResizeTests -only-testing:MingaTests/NativeRenderResourcesTests -only-testing:MingaTests/KeyboardInputTests -only-testing:MingaTests/MouseInputTests -only-testing:MingaTests/ContentViewTests -only-testing:MingaTests/LiveResizeWiringTests: 132 tests in 7 suites passed on final commit983571190.make lint: passed, including compile, strict Credo, Dialyzer, duplication, and architecture checks.mix protocol.gen --check: passed on the final commit.MINGA_NATIVE_RENDER_SWIFT_CONDITIONS='MINGA_SNAPSHOT_RENDERER MINGA_TRANSCRIPT_ACCOUNTING' scripts/check_native_render_performance: passed all unchanged thresholds with 240 of 240 frames presented, 0 failed or discarded frames, 0 warm allocation count, and 1 maximum in-flight generation. Draw CPU was p50 0.172292 ms, p95 0.25525 ms, and p99 0.32925 ms. GPU was p50 0.290041673 ms and p95 2.863874892 ms.swiftc -Ocomparison: candidate startup resolved one primary instead of two. Font and scale changes each added exactly one candidate construction. In both primary-only and fallback/secondary fixtures, 10,000 unchanged updates retained a construction count of one. Single-run timing samples were retained as diagnostic evidence, not as a new performance baseline.Acceptance Criteria Addressed