-
Notifications
You must be signed in to change notification settings - Fork 335
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
base: main
Are you sure you want to change the base?
Conversation
@@ -261,25 +259,58 @@ struct TextComponentStyle { | |||
|
|||
} | |||
|
|||
enum GenericFont: String { | |||
|
|||
case serif, monospace, sansSerif = "sans-serif" |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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
.
There was a problem hiding this 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.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.") |
Motivation
Support generic fonts for serif and monospace
Description
TextComponentStyle
still mapserif
,sansserif
, andmonospace
to generic system fonts