I build an app last year that uses webviews to display html strings I recieve from a webservice.
Those html strings need to be displayed in a custom font.
I use CSS in the webview to define the custom fonts like this:
This used to work perfectly. But now I'm making a new version of the app and I notice that suddenly the custom fonts are no longer working in the webviews! I'm using the exact same code as last year, without a single change.
Did something change in the way the webview works? Does the fact that I recently upgraded to b4a 3.8 have anything to do with it?
I've tried everything but I can't get it to work! Please help me out because the customer is waiting on me
Here is a testproject that demonstrates what I'm doing.
Pretty straight forward, but on my Nexus 5 with android 4.4.4 it doesn't show the custom fonts in the webview.
Can someone give this project a try on their device?
It turns out that the filename of the font files is all lower case, while the files view in b4a shows the filenames to contain caps.
Apperantly the webview demands the filename in the CSS to be the exact same case as the filename of the font. I think this is new, as I didn't have this problem before...
It turns out that the filename of the font files is all lower case, while the files view in b4a shows the filenames to contain caps.
Apperantly the webview demands the filename in the CSS to be the exact same case as the filename of the font. I think this is new, as I didn't have this problem before...
You are right. The Case of the filenames in Assets must fit the definition in CSS; that´s the CORRECT behaviour btw.
I cannot say if this has changed in v3.8 or not; i must believe you ;-)
I´ve checked your projekt and the first i was trying was to rename the filenames in css to the correct case cause i know this creates issues on linux-systems (android is based on linux). So i suppose; if it worked in the past it worked due to an bug.