2
I’m using this source:
<link href="https://fonts.googleapis.com/css?family=Meie+Script" rel="stylesheet">
font-family: 'Meie Script', cursive;
It works normally on the page.
But when printing the font does not come out in preview or print. I am using the function print()
of javascript.
You can use a google font in printing?
EDIT:
The CSS:
<style>
.nomes {
font-family: 'Rouge Script', cursive !important;
}
</style>
To div:
<div class="row nomes">
<div class="container nome-aluno">
Thiago
</div>
</div>
The print button:
<button class="imprimi-certificado btn bg-green waves-effect">
<i class="material-icons">print</i>
</button>
The function Jquery printing:
$('body').on('click', '.imprimi-certificado', function(){
var printContents = $(".cert").html();
var originalContents = document.body.innerHTML;
var WindowObject = window.open("", "PrintWindow","width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes");
WindowObject.document.writeln("<style>.cert{display:block}.tabela tr td{border-bottom:2px solid #111;}.pagebreak { page-break-before: always; }</style>");
WindowObject.document.writeln(printContents);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
});
I’m not sure if the source will help, but try to use the media="all", ex.: <href="https://fonts.googleapis.com/css?family=Meie+Script" rel="stylesheet" media="all" >
– Henrique Pauli
I have tested and seems to be working perfectly (http://output.jsbin.com/qakudiwibe). Can do a [mcve] demonstrating the problem?
– Woss
@Andersoncarloswoss really works like this, but if I specify that I only want to print a specific diva font does not work on it. Ex: . class{ font-family: 'Meie Script', cursive; }
– Thiago
So that’s why the [mcve]. Do it will be easier to help you.
– Woss
@Andersoncarloswoss edited the question
– Thiago
And there’s the problem: you’re loading the content that will be printed in another window (
window.open
), but in no time did you carry the fountain in it.– Woss
Placing this link <link href="https://fonts.googleapis.com/css?family=Meie+Script" rel="stylesheet"> in the writeln of the function is correct?
– Thiago