-
Is there a "happy path" method of getting a custom font to apply for the Android app? It's working fine on the Swift side, and at this point I've tried many methods of trying to get it to apply for Android as well, all of which either result in errors or the font simply not being applied. So I figured I'd reach out here to see if there might be any best practices or examples. I did figure out the naming thing - Android needs font names to be lowercase and underscores, so I do have another copy of the font files in The next challenge seems to be just referencing the fonts. String names, e.g. // SKIP REPLACE:
// internal var body = Font.custom(R.font.gerbera_medium)
static var body = Font.custom("Gerbera-Medium", relativeTo: .body) causes the build error: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
TBH, we haven't yet worked out how we are going to be interacting with the In the meantime, I think you should be able to reference the resource class using the converted class name of your main app package. So if your top-level Swift module name is Please give this a try and let us know is this works or not. |
Beta Was this translation helpful? Give feedback.
-
I've implemented custom Font support in SkipUI 0.5.18. Run Xcode's Please let us know if you have any issues we'll help work through them. You may also want to take a look at the Showcase app's project and |
Beta Was this translation helpful? Give feedback.
I've implemented custom Font support in SkipUI 0.5.18. Run Xcode's
File
/Packages
/Update to Latest Package Versions
to get it, and see the instructions for the project setup at https://skip.tools/docs/modules/skip-ui/#custom-fonts. Adding the embedded fonts to the project requires a few steps for both the iOS and Android side, but it sounds like you already have the iOS side working, so you should be able to just copy the font to theAndroid/app/src/main/res/font/
folder of your project (creating the directory first if needed) and it might work out of the box.Please let us know if you have any issues we'll help work through them. You may also want to take a look at the Showcase app's proj…