enricosapicco Posted November 26, 2018 Share Posted November 26, 2018 (edited) I use a variation of Open Sans in the game. It works perfectly OK on Firefox and Chrome but Safari uses some default font instead of the font I use. Does anyone have any idea or had similar experience? Edited November 26, 2018 by enricosapicco Tags Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 26, 2018 Share Posted November 26, 2018 We had that problem. Which version of pixi do you use? Quote Link to comment Share on other sites More sharing options...
enricosapicco Posted November 27, 2018 Author Share Posted November 27, 2018 4.8.2 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 27, 2018 Share Posted November 27, 2018 Then I have no ideas. Please make a fiddle and we'll find someone who has Mac, i'm Windows fan Quote Link to comment Share on other sites More sharing options...
quiphop Posted November 27, 2018 Share Posted November 27, 2018 18 hours ago, enricosapicco said: I use a variation of Open Sans in the game. It works perfectly OK on Firefox and Chrome but Safari uses some default font instead of the font I use. Does anyone have any idea or had similar experience? Did you checked the network ? Maybe font just doesn't downloading properly for some reason Quote Link to comment Share on other sites More sharing options...
jonforum Posted November 27, 2018 Share Posted November 27, 2018 how did you load your fonts ? are you able to share your code ? load_fonts(){ const fonts = [ {name:"ArchitectsDaughter", url:"fonts/ArchitectsDaughter.ttf"}, {name:"zBirdyGame", url:"fonts/zBirdyGame.ttf"}, ]; fonts.forEach(font => { const style = document.createElement('style'); style.appendChild(document.createTextNode(` @font-face { font-family: '${font.name}'; font-style: normal; font-weight: 700; src: url("${font.url}"); } `)); document.getElementsByTagName('head').item(0).appendChild(style); const div = document.createElement('div'); div.style.fontFamily = font.name; document.body.appendChild(div);/* Initiates download in Firefox, IE 9+ */ div.innerHTML = 'Content.';/* Initiates download in WebKit/Blink */ }); let checkFonts = setInterval(()=>{ if( fonts.every(e => document.fonts.check(`12px ${e.name}`) )){ this.fonts = fonts; clearInterval(checkFonts); this.load(); } },60); }; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.