-
Notifications
You must be signed in to change notification settings - Fork 734
Add dynamic fonts loading (and downloading) #2736
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
Conversation
@Inbal-Tish I've added the |
@Inbal-Tish |
I did - twice. And pod-install |
Maybe it's a cache issue? Did you clean it? |
Works for me :/ |
@@ -0,0 +1,9 @@ | |||
export default class PermissionsAcquirer { | |||
public async checkPermissions() { |
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.
Who's calling this method?
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.
It is used in the same file.
If you asking about the fact it is public
, then I thought it can be useful but I did not use it yet.
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.
What same file? On Android you're calling it from getPermissions but here it is not called at all...
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.
Oh, I think I wanted similar API, not sure why... I'll remove it
return new Promise((resolve, reject) => { | ||
DynamicFont.loadFontFromFile({ | ||
name: fontName, | ||
filePath |
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.
on iOS this param is called 'path', not 'filePath'...
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.
I'll comment it out
lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java
Show resolved
Hide resolved
RCT_EXPORT_METHOD( | ||
loadFontFromFile:(NSDictionary *)options callback:(RCTResponseSenderBlock)callback) | ||
{ | ||
NSString *path = [options valueForKey:@"path"]; |
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.
Here - the parm name you extract is "path" (not "pathFile")
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.
I'll comment it out
@M-i-k-e-l Looks really great. I left you a few small comments and I'll keep trying to run it or see why it keeps asking me for the fs dependency... |
Rephrase Co-authored-by: Inbal Tish <[email protected]>
Description
Add dynamic fonts loading (and downloading)
Please note that Android emulator sometimes has issues with connectivity and it needs to be restarted (mainly after the computer "goes to sleep")
Changelog
DynamicFonts - download and load to memory fonts - this is experimental for now! (also requires using
react-native-fs
)Additional info
WOAUILIB-3752