You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use a font name with an underscore on Android in the appearance parameter for PaymentSheet, an error is incorrectly resolved:
Encountered an error when setting a custom font: appearance.font.family should only contain lowercase alphanumeric characters on Android, but received 'crimsonpro_bold'. This value must match the filename in android/app/src/main/res/font.
This is not accurate as Android font names may have underscores in them as well, in addition to lowercase alphanumeric characters.
To Reproduce
Steps to reproduce the behavior:
Put an underscore in the name of any custom font in android/app/src/main/res/font (ex. crimsonpro_regular.ttf)
Specify the font name with underscore when initializing PaymentSheet
Expected behavior
Font names with underscores should be accepted as well on Android, in addition to lowercase alphanumeric characters.
Smartphone (please complete the following information):
Device: Android Emulator (API 34)
OS: Android 14
Browser: Stock browser
Additional context
I've already tested simply bypassing the if statement that checks for this and the font displays on the PaymentSheet correctly.
The fix will simply involve changing the regex expression in android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt to allow for underscores. I will create a PR soon
The text was updated successfully, but these errors were encountered:
Encountered an error when setting a custom font: appearance.font.family should only contain lowercase alphanumeric characters on Android, but received 'Figtree'. This value must match the filename in android/app/src/main/res/font
Experiencing the same issue here for a font named asap_regular.ttf as of @stripe/stripe-react-native version 0.38.4. Implementing the change made in #1637 as a manual patch with pnpm patch @stripe/stripe-react-native is working so far. Would be nice to see this one merged.
Describe the bug
When trying to use a font name with an underscore on Android in the appearance parameter for PaymentSheet, an error is incorrectly resolved:
Encountered an error when setting a custom font: appearance.font.family should only contain lowercase alphanumeric characters on Android, but received 'crimsonpro_bold'. This value must match the filename in android/app/src/main/res/font.
This is not accurate as Android font names may have underscores in them as well, in addition to lowercase alphanumeric characters.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Font names with underscores should be accepted as well on Android, in addition to lowercase alphanumeric characters.
Smartphone (please complete the following information):
Additional context
I've already tested simply bypassing the if statement that checks for this and the font displays on the PaymentSheet correctly.
The fix will simply involve changing the regex expression in android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt to allow for underscores. I will create a PR soon
The text was updated successfully, but these errors were encountered: