Currently I’m creating a mobile app with Meteor but I can’t seem to use custom google fonts with it.
I’ve tried using @import statements and <head>
statements, as well as white-listing google websites with Cordova:
App.accessRule('https://*.googleapis.com/*');
App.accessRule('https://*.google.com/*');
App.accessRule('https://*.gstatic.com/*');
Does anyone know how to add custom fonts to a Meteor Cordova project?
1 Like
Have you tried putting the @import lines into your .css file for your project? I just responded to this post with the same answer.
Yup! Here’s my import code:
/* CSS declarations go here */
@import url(http://fonts.googleapis.com/css?family=Lato:400,300,700);
@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionic-sass/ionic';
@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionicons-sass/ionicons';
I don’t seem to be getting any ‘whitelist rejection’ messages in my XCode logs either
Still digging
I thought package based assets are supposed to be loaded via absolute URLs to /packages/
/packages/<package name>/<asset url>
and make sure to replace the : in the package name to _
here is a stack overflow answer
I’ve just tried running my app in the simulator and I also can’t get the custom google fonts working… did you get this fixed/
1 Like
I worked out my issue, I wasn’t whitelisting:
App.accessRule('*://fonts.gstatic.com/*');
4 Likes