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:
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.
Refs https://github.com/wordpress-mobile/WordPress-iOS/issues/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:https://github.com/wordpress-mobile/WordPress-iOS-Shared/blob/3ed6530c1cb7a56c632afad808b279074692d0a3/WordPressShared/Core/Utility/WPFontManager.m#L113
However, the method has since been moved to the Swift part in
WordPressShared
, and is inaccessible fromWPFontManager
because the font manager is insideWordPressSharedObjC
which is depended upon byWordPressShared
, but not the other way around. CMIIW.When debugging the app, the fonts are located in
WordPress.app/WordPressShared.bundle
since theWordPressShared
is still included through CocoaPods. Following the solution fromNSBundle+WordPressShared.swift
, this attempts to add theWordPressShared.bundle
to the bundle path when loading the font.To Test
Refer to https://github.com/wordpress-mobile/WordPress-iOS/pull/19898.
CHANGELOG.md
if necessary.