我必须在 window.open() 的新窗口中更改字体,因为我想在收据打印机中打印。我已经更改了 True Type Font Subtitution 但它不起作用。那么如何为新打开的窗口添加 css 呢?这是我的代码:
<img src="barcode.png" id="barcode">
<script type="text/javascript">
function printImg() {
ImageLink=document.getElementById("barcode").src;
pwin=window.open('','','width=0,height=0');
pwin.document.write("<center><h>My Store<h><br>Ekiosk</center><br>Date : <?php echo date('Y/m/d'); ?><br>Time : <?php echo date('H:i:s'); ?><br>Customer Name: <?php echo $cust['firstname']; ?> <?php echo $cust['lastname']; ?> <br>Total : <?php echo $cust['total']; ?><br><center><img src='" + ImageLink + "'/><br>Thanks For Shopping !</center>");
pwin.print();
pwin.close();
}
</script>
谁能帮我把字体改成字体收据?