embed symbol font in printed css
This commit is contained in:
Родитель
67419a383e
Коммит
2146e27b65
|
@ -2350,12 +2350,13 @@ module TDev {
|
|||
{
|
||||
try {
|
||||
var w = window.open("about:blank", "tdTopic" + Util.guidGen());
|
||||
w.document.write("<!DOCTYPE html><html><head>" + CopyRenderer.css
|
||||
var html = "<!DOCTYPE html><html><head>" + CopyRenderer.css
|
||||
+ "<title>" + Util.htmlEscape(title) + "</title>"
|
||||
+ "<meta name='microsoft' content='notranslateclasses stmt keyword'/>"
|
||||
+ "</head><body onload='try { window.print(); } catch(ex) {}'>"
|
||||
+ text
|
||||
+ "</body></html>");
|
||||
+ "</body></html>";
|
||||
w.document.write(html);
|
||||
w.document.close();
|
||||
} catch(e) {
|
||||
ModalDialog.info(":( can't print from here", "Your browser might have blocked the print page or try to print from another device...");
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,5 +1,8 @@
|
|||
var fs = require("fs");
|
||||
var font = fs.readFileSync("TDSymbols.woff").toString("base64");
|
||||
var s = fs.readFileSync("../www/default.css", "utf8").replace(/(@font-face\s*\{[^{}]+TD Symbols[^{}]+src:).*/,
|
||||
function(w,p) { return p + "url(data:application/x-font-woff;base64,"
|
||||
+ fs.readFileSync("TDSymbols.woff").toString("base64") + ");" })
|
||||
function(w,p) { return p + "url(data:application/x-font-woff;base64," + font + ");" })
|
||||
fs.writeFileSync("../www/default.css", s);
|
||||
var s = fs.readFileSync("../ast/render.ts", "utf8").replace(/(@font-face\s*\{[^{}]+TD Symbols[^{}]+src:).*/,
|
||||
function(w,p) { return p + "url(data:application/x-font-woff;base64," + font + ');}\\n"+' })
|
||||
fs.writeFileSync("../ast/render.ts", s);
|
||||
|
|
Загрузка…
Ссылка в новой задаче