使用krutidev字体在HTML中打印CSS [英] using krutidev font to print css in html

查看:79
本文介绍了使用krutidev字体在HTML中打印CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的CSS

@font-face {  
  font-family: kruti dev ;  
  src: url( '../../fonts/k010.ttf' ) format("truetype");  
}  

.hinditext {
    font-family: kruti dev;  
    font-size:18px;
}

这是我的html

<h3 class="hinditext">lkoZtfud izU;kl efUnj Jh egkdkys'oj </h3>

当我在浏览器中显示页面时,它在北印度语中显示的内容如下

when i display page in browser, then it show content in Hindi as below

但是当我给出打印建议时,即打印内容

but when i give print commend ie print content in english like lkoZtfud izU;kl efUnj Jh egkdkys'oj.

请有人能告诉我我如何解决此问题并在印地文中打印内容。

Please can anyone tell me how i solve this issue and print content in hindi.

推荐答案

对于用于网页和打印的印地语字体,请使用以下CSS:

For Hindi font for web page and print, use this CSS:

@font-face {
font-family: 'Kruti Dev';
src: url('../../Content/CustomCSS/Kruti Dev 010.ttf') format('truetype')}

.KrutiDev_hindi_text {
font-family: Kruti Dev !important;
font-size: 18px !important;}

添加 KrutiDev_hindi_text 类别,要将div应用于印地语字体,并在打印功能中添加对此CSS的引用,即您想要的 strid = div id

Add KrutiDev_hindi_text class to the div you want to apply Hindi fonts to and add reference to this CSS in print function, i.e. strid=div id that you want to print.

打印功能:

function CallPrint(strid) {

    var panel = document.getElementById(strid);
    var printWindow = window.open('', '', 'letf=100,top=100,width=600,height=600');

    printWindow.document.write('<html><head><meta charset="utf-8" /><title> </title>');

    printWindow.document.write('</head><body >');
    printWindow.document.write('<div class="container-fluid">');
    printWindow.document.write(panel.innerHTML);
    printWindow.document.write('<\/div>');
    //printWindow.document.write('<link href="/Content/bootstrap.css" rel="stylesheet" />');
    printWindow.document.write('<script src="/Scripts/jquery-1.9.1.min.js"><\/script>');
    //printWindow.document.write('<script src="/Scripts/bootstrap.min.js"><\/script>');
    printWindow.document.write('<link href="/Content/BhardwajCustom.css" rel="stylesheet" />');
    printWindow.document.write('<style><\/style>');
    printWindow.document.write('</body>');
    printWindow.document.write('</html>');
    printWindow.document.close();

    //printWindow.print();
    setTimeout(function () {
        printWindow.print();
    }, 100);
    return false;
}

这篇关于使用krutidev字体在HTML中打印CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆