Ensure divs used to make fonts load are not visible
This commit is contained in:
parent
c35e1e7552
commit
171ab51c56
6
fonts.js
6
fonts.js
@ -786,9 +786,9 @@ var Font = (function () {
|
|||||||
styleSheet.insertRule(rule, styleSheet.length);
|
styleSheet.insertRule(rule, styleSheet.length);
|
||||||
|
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
div.innerHTML += "<div style='font-family:" +
|
var style = 'font-family:"' + fontName +
|
||||||
fontName +
|
'";position: absolute;top:-99999;left:-99999;z-index:-99999';
|
||||||
";'>j</div>";
|
div.setAttribute("style", style);
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
|
|
||||||
Fonts[fontName].loading = true;
|
Fonts[fontName].loading = true;
|
||||||
|
@ -10,7 +10,7 @@ function load(userInput) {
|
|||||||
pageNum = parseInt(queryParams().page) || 1;
|
pageNum = parseInt(queryParams().page) || 1;
|
||||||
var fileName = userInput;
|
var fileName = userInput;
|
||||||
if (!userInput) {
|
if (!userInput) {
|
||||||
fileName = "canvas.pdf";
|
fileName = queryParams().file || "compressed.tracemonkey-pldi-09.pdf";
|
||||||
}
|
}
|
||||||
open(fileName);
|
open(fileName);
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,7 @@ window.onload = function() {
|
|||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="viewer.css"></link>
|
<link rel="stylesheet" href="viewer.css"></link>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="fonts" style="position: absolute;display:block;z-index:-1;"></div>
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<input type="file" style="float: right; margin: auto 32px;" onChange="load(this.value.toString());"></input>
|
<input type="file" style="float: right; margin: auto 32px;" onChange="load(this.value.toString());"></input>
|
||||||
<!-- This only opens supported PDFs from the source path...
|
<!-- This only opens supported PDFs from the source path...
|
||||||
|
@ -174,7 +174,10 @@ function WorkerPDFDoc(canvas) {
|
|||||||
// seems it's loaded once Gecko notices it's used. Therefore,
|
// seems it's loaded once Gecko notices it's used. Therefore,
|
||||||
// add a div on the page using the loaded font.
|
// add a div on the page using the loaded font.
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
document.getElementById("fonts").innerHTML += "<div style='font-family:" + data.fontName + "'>j</div>";
|
var style = 'font-family:"' + data.fontName +
|
||||||
|
'";position: absolute;top:-99999;left:-99999;z-index:-99999';
|
||||||
|
div.setAttribute("style", style);
|
||||||
|
document.body.appendChild(div);
|
||||||
},
|
},
|
||||||
|
|
||||||
"jpeg_stream": function(data) {
|
"jpeg_stream": function(data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user