-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
It seems that I cannot load custom fonts in IE11 or pre-Chromium Edge.
My Project selects a font file and then converts it into a Base64 string
I have no problems running this into Chrome or FireFox.
But when it came to IE11 or old Edge, I get that PubSub error with an invalid calling object details.
I tried to debug and and ended up here
atob was returning an invalid calling object error (does not happen in Chrome or Firefox)
A workaround I did was instead of fetching the font into a Blob and using a FileReader to get the Base64 string of the font. I used arrayBuffer and just use this:
let fontData = new Uint8Array(content).reduce((data,byte)=>(data.push(String.fromCharCode(byte)),data),[]).join('');
It worked, and then I remembered I also had a lot of images in Base64 string that resulted in Corrupted PNG.