I’m trying to load a remote TTF font with the following statement: cc.loader.load({"http://example.com/font.ttf", "ttf"}), function (err, res) { ... });
but the complete callback function returns a null error and a null resource.
The font is downloaded correctly though. How can I use it from a cocos script?
I’m using Cocos Creator for web, so I can’t use jsb.
What I’m trying to do is load dynamically a remote font with the cc.loader.load API (like i do with some remote textures and audio). Then, assign this font to a Label.
The font is downloaded correctly because I can see it in the Network panel, in Google Chrome developer tools.