This repository was archived by the owner on Jun 4, 2025. It is now read-only.
Fix resource bundle for WordPressShared when installed from CocoaPods #331
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.
Refs wordpress-mobile/WordPress-iOS#19877, p5T066-3ND-p2#comment-14170, p5T066-3ND-p2#comment-14172
This fixes an issue where the WordPressShared no longer loads the Noto font family correctly, resulting in the app content (editor, comment threads) being displayed with the default font from HTML.
In
1.18.0,WPFontManagerloads the bundle was loaded through this method:WordPress-iOS-Shared/WordPressShared/Core/Utility/WPFontManager.m
Line 113 in 3ed6530
However, the method has since been moved to the Swift part in
WordPressShared, and is inaccessible fromWPFontManagerbecause the font manager is insideWordPressSharedObjCwhich is depended upon byWordPressShared, but not the other way around. CMIIW.When debugging the app, the fonts are located in
WordPress.app/WordPressShared.bundlesince theWordPressSharedis still included through CocoaPods. Following the solution fromNSBundle+WordPressShared.swift, this attempts to add theWordPressShared.bundleto the bundle path when loading the font.To Test
Refer to wordpress-mobile/WordPress-iOS#19898.
CHANGELOG.mdif necessary.