Hello. I’m making webview-based game and I can’t include custom fonts on my page by some reason. I have a bundle (generated with Parcel bundler) which I show in my webview and where all of my files are.
I have tried all the font formats, which normally should work fine in Chrome (which is my default Android browser): ttf, woff, woff2, svg. And it works fine on my desktop and in Corona Simulator. But not on the real device and I can’t understand why.
I’m including the fonts as usual in web, with @font-face and all files are placed in the same bundle folder in the end. Could you please tell me what can I do wrong? Is there some specific things that I probably don’t know about fonts in webviews in Corona?
P.S. It also works fine when I’m including fonts directly from Google Fonts by adding <link> tag in my html file.
Can you provide more information? Are you including these font files in your app (in the folder with your main.lua?) Are you using local .html files or are you downloading them from your server??
Have you used “adb logcat” to look for errors from your device’s console.log?
I am using local html file which includes one css file (in the same folder) which includes @font-face directive. And this directive points to font files in the same dir. I have this structure:
How are you trying to reference the font file? Perhaps share your HTML code. Please use the code formatting option (the blue <> in the row with Bold, Italic etc) and paste your HTML in there.
That code does not appear to be for Corona. To be most helpful to our developers, posting code that will work in Lua using Corona API’s is your best bet.
Can you provide more information? Are you including these font files in your app (in the folder with your main.lua?) Are you using local .html files or are you downloading them from your server??
Have you used “adb logcat” to look for errors from your device’s console.log?
I am using local html file which includes one css file (in the same folder) which includes @font-face directive. And this directive points to font files in the same dir. I have this structure:
How are you trying to reference the font file? Perhaps share your HTML code. Please use the code formatting option (the blue <> in the row with Bold, Italic etc) and paste your HTML in there.
That code does not appear to be for Corona. To be most helpful to our developers, posting code that will work in Lua using Corona API’s is your best bet.