Font-face renders properly on most browsers except for Firefox

For a while now, my project has been using font-face without any issues. However, I recently discovered that the font face is not working on Firefox versions 14 and 15, and probably also not on version 12 and above as discussed in this thread: http://css-tricks.com/forums/discussion/17337/font-face-problem-with-firefox-v-12/p1. My problem mirrors what was reported in that thread.

In summary, I am using font-face to load web fonts in the following manner:

@font-face {
    font-family: 'TradeGothicLTStdCnBold';
    src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot');
    src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix') format('embedded-opentype'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff') format('woff'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf') format('truetype'),
         url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold') format('svg');
    font-weight: normal;
    font-style: normal;

and then

#bea .bea {
    font-family: 'TradeGothicLTStdCnBold';
    font-size: 14px;
}

According to Firebug, the fonts are loading correctly. They work fine on Safari, Chrome, IE, and some versions of Firefox. I have tested it on 6 different versions of Firefox (v13-15) and it behaves inconsistently across them. I cannot pinpoint any specific reason for this.

I also checked the firefox configuration value `gfx.font_rendering.cleartype.always_use_for_content`, and noted that it is set to false in all versions of Firefox that I tested, even those where the fonts render correctly.

Live example:

Desired outcome:

To sum up: - The file paths are correct. - No cross-domain issues since all resources are within the same domain. - Inconsistent behavior across different versions of Firefox with no apparent cause. -Previously worked fine on an older version of Firefox, maybe before v12.

Any help would be greatly appreciated as this issue is really frustrating me. Thank you!

Answer №1

I encountered a similar issue with Firefox not displaying font-face correctly. To address this problem, consider the following workaround:

Place the declaration of "eot" fonts at the end of the block, as shown below:

@font-face {
font-family: 'TradeGothicLTStdCnBold';
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff') format('woff'),
     url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf') format('truetype'),
     url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold') format('svg');
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot');
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;

Answer №2

Oops, my mistake. Turns out it was a cross-domain issue causing the problem. The fonts were being fetched from www.domain... even though I accessed them through http://domain.... Redirecting everyone to www.domain should fix the issue and could be a good habit going forward. Alternatively, loading the fonts using relative paths is another potential solution.

Answer №3

The web developer tools JavaScript console (Tools-> Web Developer-> Error Console) is showing various errors:

Date and Time: 13/09/2012 9:41:37
Warning: downloadable font: no supported format found (font-family: "TradeGothicLTStdCnBold" style:normal weight:normal stretch:normal src index:4)
source: (end of source list)
Source File: http://www.comoquierascolacao.com/jovenestalentos//style/style.css?v=1
Line: 0
Source Code:
@font-face {   font-family: "TradeGothicLTStdCnBold";   font-style: normal;   font-weight: normal;   src: url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix") format("embedded-opentype"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff") format("woff"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf") format("truetype"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold") format("svg"); }

Answer №4

After encountering an issue where everything worked fine on the domain with www, but not without it in Firefox, I implemented a solution using redirection in my .httaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

This successfully resolved the problem! Grateful for Hanoc's help.

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

Personalized jQuery mask customization

After experimenting with a masking function that conceals numbers based on a specific pattern, I am now looking to make it more flexible for users. For instance, if a user types 123456789, the field will display as XXX-XX-6789. Currently, the pattern is ...

What is the method for eliminating <ol> elements that have a particular number of <

As a beginner in the world of html and css, I am reaching out for some assistance. My question is regarding how to remove the ol tags that contain 3 li elements without any class or id. Here is an example: <div class="text"> <ol> ...

Switching HTML text by clicking or tapping on it

I'm currently working on a website that will showcase lengthy paragraphs containing complicated internal references to other parts of the text. For instance, an excerpt from the original content may read: "...as discussed in paragraph (a) of section ...

Achieving Centered Columns in Row with Bootstrap 4

Is there a way to increase the spacing between columns in a row in Bootstrap 4? I've tried adjusting it but can't seem to get the columns centered properly. It's ruining the look of my layout. See the image for reference: https://i.sstatic.n ...

Update the class of the panel immediately prior to a click event

Is it possible to change the class before the animation starts or when opening/closing the panel? Currently, the class only changes after the animation has finished and the panel is already open or closed. Here is an example: http://jsfiddle.net/0b9jppve/ ...

"Enhance your webpage with a captivating opaque background image using Bootstrap

I'm new to exploring Bootstrap and I am currently experimenting with options for displaying content with a semi-transparent background image. Currently, I am using a "well" but I am open to other suggestions. I have managed to place the image inside t ...

adding a touch of flair to a form input that doesn't quite meet the

My goal is to have a red background appear when an input is invalid upon form submission. I attempted the following code: input:invalid { background-color:red; } While this solution worked, it caused the red background to show up as soon as the page l ...

Ways to eliminate / refresh locomotive scroll when resizing the window?

I am currently working on a website that is designed with a horizontal layout for desktop screens, but switches to a vertical layout for smaller screens. I have implemented locomotive scroll successfully, but I am facing issues with window resizing. Below ...

Encountering an issue with npm installation following a recent node version upgrade

Having trouble installing Sass on Node version v16.14.0. I keep receiving this error message: https://i.stack.imgur.com/6KNcF.png ...

Performing addition and multiplication operations on separate identifiers with the help of Jquery

Currently, I am working on developing a shopping cart website and I am new to using Jquery. My layout involves the need to increment and decrement values by one when the plus and minus button is pressed. Additionally, the total price value should also be a ...

Maintain the expanded menu even after selecting a sub-item using jQuery

After conducting a thorough search, I was unable to find exactly what I needed. I have successfully implemented cookies on my menu so that when the page is reloaded, it remembers which menus were open. However, I noticed that clicking on a sub-item of Hy ...

You can tab through form input boxes on an Adobe Muse website, but they cannot be clicked

Lately, I created a small website using Adobe Muse and incorporated their form widget. However, I haven't altered any of the default settings and now the input boxes are not clickable. The only way to interact with them is by tabbing through. How can ...

Configuring local fonts in Puppeteer using npm

Looking to incorporate locally loaded fonts when generating a PDF using the Puppeteer node module. I successfully implemented web fonts, but this does not meet the specified requirements. Environment Details: Node: v10.18.1, Puppeteer: "puppeteer": "^2 ...

What is the best way to position text below an image icon in a menu?

I am having trouble creating a menu that has the same style as shown in this image: . Unfortunately, my menu ends up looking like this instead: . Can someone please help me fix this issue? Here is the HTML code I am working with: <header> ...

Creating an active tab using Material UI on a particular route

I've encountered an issue with Material UI tabs and need help figuring out how to resolve it. I have a navbar with three different tabs that link to separate URLs, but two of them are quite similar. Take a look at my code snippet below: <Tabs indic ...

What is the best way to integrate a bootstrap CSS stylesheet into my Express/Node.js project?

Currently, my approach involves using the following code to fetch my html file. app.get("/", function (request, response) { response.sendFile(__dirname + "/public_html/index.html"); }) The html file contains a form with method="post" and a submit button. ...

Tips for incorporating a responsive width feature into the Drawer component in MUI v5

I'm currently working with Material UI v5 and facing a challenge in creating a responsive drawer. I want the drawer to occupy 100% of the screen width on smaller devices, while taking up only 1/3 of the screen width on larger devices. Unfortunately, I ...

The offcanvas menu in the NextJS Tailwind website does not handle hover or tap events properly when outside of the parent dimensions

My header includes an off-canvas menu that slides in from the right side. Everything seems to be working fine, except for one issue: when the menu is open and visible, the mouse and touch events pass through it to the content underneath. Check out the cod ...

Slider in MaterialUI featuring a vibrant spectrum of colors

Currently, I am delving into MaterialUI and my focus is on creating a range slider. I came across this example that I found useful: https://material-ui.com/components/slider/#range-sliders My goal is to assign different colors to the "high," "medium," and ...

What is the best method for adjusting height in MaterialUI components?

Is there a way to remove this white line from the image?view image here When I set the height to 100%, it appears like this:view image here ...