The font is functioning properly in digital screen formats, however, it is not displaying correctly in

I have encountered an issue where the code below works on screen media but not in print media:

<style type="text/css">

@font-face {
    font-family: dinregular;
    src: url('/images/templateImages/template9/din-regular-italic.ttf')
}
</style>

What could be causing my font face to not work when I download my template as a PDF? It seems to be working fine when viewing the template in a browser.

Any help would be greatly appreciated. Thank you!

Answer №1

After conducting tests in both Firefox and Chrome, it has been discovered that the font-face feature does not function properly within the @media print query. The browsers simply ignore it.

Answer №2

Using just the .ttf format for fonts may not be fully compatible with all platforms. To ensure your font displays correctly everywhere, it's recommended to include the font in multiple formats. Font Squirrel offers a convenient tool where you can upload a font file, convert it to various formats, and receive the necessary CSS code.

This approach will help make sure your font appears consistently across different browsers and even in PDF files. If issues still persist, consider embedding the font by encoding it into base64 format.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display a remote page on hover using Javascript, CSS, and HTML without providing any clickable link

How can I display a preview of another page within a div container without actually making the text clickable? I want the preview to show when the mouse hovers over specific text, but I need the original text to stay on the main page. I've experiment ...

Why is the header image not appearing on mobile devices on the website?

I recently finished creating my own website with a header image that successfully expands to the width of the screen during testing on Google Chrome for mobile responsiveness. However, upon deploying and viewing the site on actual mobile devices, the heade ...

What are the steps to make a counter-clockwise dial with jQuery Knob?

Is there a way to use multiple instances of jQuery.countdown? Can I create countdown circles using jQuery Knob? Find examples here and here. Using Multiple instances of jQuery.countdown <div data-countdown="2016/01/01"></div> <div data-co ...

Why is margin-top behaving unexpectedly?

Greetings! I have a website created using css, html, and php. Take a moment to review this code: <?php session_start(); include_once "mysql_connect.php"; $log = null; if(isset($_SESSION["ID"])){ $log = $_SESSION["ID"]; }e ...

Issue with iOS iframe scrolling - unable to scroll as expected

On iOS devices like the iPad and iPhone 6, scrolling doesn't seem to work as intended. Instead of the iframe scrolling, it's the 'body' that is moving. Javascript $(document).on(clickHandler, '#content a', function(){ href ...

Direction flex property

Could someone please clarify the significance of maintaining flex direction as column in this scenario? Changing it to row or row reverse causes some parts of the image to shrink in width. Check out the JS Fiddle example: https://jsfiddle.net/fbshqg0c/7/ ...

What is the reason behind Bootstrap 5 inserting a line break following a span element?

Other questions similar to this one have been raised, but they do not cover a straightforward example of the problem. When looking at the code snippet below, you will notice that a line break is inserted after the closing span tag if Bootstrap 5 is utilize ...

How can I implement a hover effect without triggering a click event?

My structure is pretty basic, here it is: .container { height: 100vh; width: 100%; pointer-events: none; } .click-layer { background-color: #ccc; position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: auto; } .box { ...

Font Awesome icons are preventing the navigation bar from collapsing

Just getting started with Bootstrap and facing an issue. I want to include a collapsed user icon that expands when clicked. However, when I add the navbar-toggle class, the icon disappears completely. Without it, the icon appears but doesn't collapse ...

A guide on how to split the Bootstrap 4 card-body class into distinct columns

I currently have a bootstrap 4 card layout that looks like this: <div class="card-body"> <img src="{{asset('images/yimage.jpg')}}" alt="..." class="rounded-circle"> <p>This is ...

Step-by-step guide on how to superimpose a Glyphicon on

I'm struggling to figure out how to overlay a Glyphicon (.glyphicon-zoom-in) on top of a Bootstrap .img-thumbnail. The specific CSS rule I've been using is content:"\e015"; ...

What steps can I take to stop text from disappearing when the screen size decreases and the span is used?

I'm currently using Bootstrap 5 to create a form. On a computer screen, my file input element looks like this: https://i.sstatic.net/fX6Kx.png However, on mobile devices, it appears like this: https://i.sstatic.net/ilUZ9.png Below is the code sni ...

When a td element is clicked, the Textbox will also be clicked

Similar Question: Dealing with jQuery on() when clicking a div but not its child $(oTrPlanning).prev().children('td').each(function () { this.onclick = setCountClick; }); When a TD element is clicked, the function setCountClick() i ...

Utilizing bootstrap tools and experiencing a deficiency in organization

Looking to utilize utility classes, I am currently importing the latest version of Bootstrap (v4.0.0-alpha.6). However, upon searching through the node_modules files, I am unable to locate any "order-" utility rules. Has this feature been removed? The doc ...

Transforming an image into a geometric shape using html and css - step by step guide

Hey fellow stackoverflow users! I've created a geometric figure using multiple divs for an unconventional website design. However, I'm struggling to adapt images within these divs because the original width is not being maintained. When you view ...

Prevent the border from shrinking upon being clicked

I'm currently working on customizing an accordion using jQuery for the animation effects. However, I am facing an issue where clicking on the accordion header causes the border around the plus sign to shrink in size as well. My goal is to only have th ...

Animating CSS when closing a modal box

I followed the instructions from a tutorial on W3Schools here to create this code. The "open model" button triggers the modal to open with a smooth CSS animation, which looks great. However, when I click the close button, the modal abruptly closes without ...

Clicking on a select box causes the scrollbar area to vanish, shifting all the page content to the right

I have successfully implemented overflow-y: scroll; to keep the scrollbar space always reserved and prevent content from shifting when the scrollbar appears. However, I noticed that when I click on a select element, this scrollbar space is lost. How can I ...

css the vertical column is unable to reach 100% vertical

Check out my website at I need help getting the black column with my thumbnails to extend all the way down on the site. Here is the CSS code for the thumbnails: #thumbnails { position:absolute; top: 110px; width: 190px; height: 100%; ...

What is the best way to design a consistent navbar that can be used across multiple HTML pages using Bootstrap 5?

Preferably, I would like to achieve this using only JavaScript without the need for a JavaScript framework in my project. Layout: ./index.html ./about.html ./crew.html ./flights.html ./events.html I am looking to create a consistent navbar across all ...