Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Conversation

@dvdchr
Copy link
Contributor

@dvdchr dvdchr commented Jan 12, 2023

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, WPFontManager loads the bundle was loaded through this method:

NSBundle *bundle = [NSBundle wordPressSharedBundle];

However, the method has since been moved to the Swift part in WordPressShared, and is inaccessible from WPFontManager because the font manager is inside WordPressSharedObjC which is depended upon by WordPressShared, but not the other way around. CMIIW.

When debugging the app, the fonts are located in WordPress.app/WordPressShared.bundle since the WordPressShared is still included through CocoaPods. Following the solution from NSBundle+WordPressShared.swift, this attempts to add the WordPressShared.bundle to the bundle path when loading the font.

To Test

Refer to wordpress-mobile/WordPress-iOS#19898.


  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

@crazytonyli
Copy link
Contributor

Ops, my bad, not sure why I replaced the original wordPressSharedBundle call with bundleForClass:... Thanks for the fix!

@dvdchr dvdchr requested a review from crazytonyli January 13, 2023 06:40
@dvdchr dvdchr merged commit f151a1f into trunk Jan 16, 2023
@dvdchr dvdchr deleted the fix/font-resource-bundle-not-found branch January 16, 2023 06:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants