Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paywalls V2] Support generic fonts #4766

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joshdholtz
Copy link
Member

Motivation

Support generic fonts for serif and monospace

Description

TextComponentStyle still map serif, sansserif, and monospace to generic system fonts

@joshdholtz joshdholtz requested review from a team February 5, 2025 20:49
@joshdholtz joshdholtz marked this pull request as ready for review February 5, 2025 20:50
@@ -261,25 +259,58 @@ struct TextComponentStyle {

}

enum GenericFont: String {

case serif, monospace, sansSerif = "sans-serif"
Copy link
Member Author

Choose a reason for hiding this comment

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

@JayShortway @tonidero Does this casing for sans-serif match what Android has? I couldn't tell 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! This seems correct. FWIW, in Android, I believe we're using the font family name, which matches to serif, monospace and sans-serif.

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

LGTM!

uiConfigProvider: UIConfigProvider
) -> Font? {
guard let familyName = uiConfigProvider.getFontFamily(for: name) else {
Logger.warning("Maping for '\(name)' could not be found. Falling back to system font.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Logger.warning("Maping for '\(name)' could not be found. Falling back to system font.")
Logger.warning("Mapping for '\(name)' could not be found. Falling back to system font.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants