printThis icon indicating copy to clipboard operation
printThis copied to clipboard

Custom TTF fonts not printing

Open galcott opened this issue 3 years ago • 2 comments

I'm using custom TTF fonts on a page that show up correctly on screen but when I use printThis to print the section they are printing as Times Roman. I don't know if this is specifically a printThis issue or some other issue involving printing custom fonts. Is there a way to correct this? The fonts are declared like this.

     @font-face {
       font-family: Clearface;
       src: url('ClearfaceNormal.ttf');
       font-weight: normal;
     }
     @font-face {
       font-family: Clearface;
       src: url('ClearfaceBold.ttf');
       font-weight: bold;
     }

galcott avatar Feb 05 '22 16:02 galcott

printThis works by creating an iframe and copying elements into it. The issue here is that the CSS is referencing a relative path not available in the iframe. printThis requires a full qualified URL for references. In this case, you could use the loadCSS parameter to pull in the necessary font files.

jasonday avatar Sep 03 '22 04:09 jasonday

Well, I have to say that getting a response 7 months after my post is very timely! I actually figured this out a long time ago though I don't remember how.

galcott avatar Sep 03 '22 05:09 galcott