mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge branch 'refs/heads/check-stylesheet' into continuation-check
This commit is contained in:
commit
151694cce1
1 changed files with 4 additions and 0 deletions
4
fonts.js
4
fonts.js
|
@ -1291,6 +1291,10 @@ var Font = (function Font() {
|
|||
window.btoa(data) + ');');
|
||||
var rule = "@font-face { font-family:'" + fontName + "';src:" + url + '}';
|
||||
var styleSheet = document.styleSheets[0];
|
||||
if (!styleSheet) {
|
||||
document.documentElement.firstChild.appendChild( document.createElement('style') );
|
||||
styleSheet = document.styleSheets[0];
|
||||
}
|
||||
styleSheet.insertRule(rule, styleSheet.cssRules.length);
|
||||
|
||||
return rule;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue