The font baseline for Knockout 46 Flyweight in Firefox is positioned at the center of the line-height

It appears that Firefox is interpreting the height of this font as 0 in every instance, causing its baseline to consistently align with the center of the line-height. This issue seems to be specific to this particular font, and rebuilding the WOFF, TTF, and SVG formats from the original OTF source does not resolve it. Can anyone provide insight into a more targeted cause or solution?

LEFT: Mac 10.8.3, Chrome 27.0.1453.110; RIGHT: Mac 10.8.3, Firefox 21.0

CSS

@font-face {
    font-family: 'HTF46';
    src: url(KnockoutHTF46Flyweight.eot),
         url(KnockoutHTF46Flyweight.otf),
         url(KnockoutHTF46Flyweight.woff),
         url(KnockoutHTF46Flyweight.ttf),
         url(KnockoutHTF46Flyweight.svg);
    font-weight: normal;
    font-style: normal;
}
div {
    font-size: 30px;
    height: 24px;
    border: 1px solid #09F;
    outline: 1px dashed #F00;
    line-height: 24px;
    font-family: "HTF46";
    text-transform: uppercase;
}

HTML

The box border appears in blue.
<div>This is some text</div>
The dashed red outline accentuates the font displacement.

I experimented by retaining only one URL in the font-face { src: } declaration for each font format. In my testing, Firefox rendered the OTF, WOFF, TTF, and SVG files identically.

(Please note: The original version of this test included format('truetype') and similar parameters for each font file, but I omitted them due to format('svg') causing issues with font display.)

Answer №1

After experiencing a similar issue, I discovered that my font files were corrupted. To resolve this, I used a webfont generator tool like the one found here: to generate new font files in various formats and replaced the existing ones. This simple solution fixed the problem for me.

You may also find help with a related question here: @font-face problem, Firefox adds padding, Chrome does not

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

What are some ways to implement drop-down functionality using CSS?

I've been working on tweaking the CSS of this website for what feels like an eternity. I just can't seem to figure out how to make the "medical" menu item drop down to display the rest of the hidden menu items. I've managed to unhide and exp ...

Reversing JQuery animations can be achieved by using the `

As someone who is relatively new to JQuery and web development, I find myself in need of assistance. Despite researching for a few days, I have not been able to find a solution that meets my requirements. While browsing through various forums, I noticed th ...

Adjusting the sizes of images with varying aspect ratios to perfectly fit within a div without distorting its shape

I'm currently in the process of developing my portfolio website and I am faced with creating a simplistic image browser feature. My goal is to have a container div that adjusts in size according to the browser window, allowing it to house images of va ...

The pseudo right arrow is failing to display in the vertical center

My pseudo right arrow is not displaying vertically centered within the .nav-link class. Can anyone suggest how I can achieve vertical alignment for my right arrow in an <a> tag? I have already attempted using top:50% but it did not work. Here is th ...

The navigation bar scrolling based on mouse position lacks smoothness and could use some enhancement

I'm currently working on adjusting the navigation bar based on the mouse position. It seems to be functioning, but I'm facing an issue with smoothing out the animation. When I stop moving the mouse to a certain point, there is a delay i ...

Arranging Bootstrap divs for optimal display on mobile devices

Check out my simple jsfiddle demonstration here. I'm looking for a solution where the image appears above the text on smaller window sizes, instead of dropping below due to the HTML order. Currently, I am considering having duplicate images (one abo ...

The inline display property does not function properly with the <li> element

Here is the HTML code snippet I am working with: <div class="nav"> <ul class="nav-dots"> <li class='ni n1'><a href="" class='nia'>dot</a></li> <li class='ni n2'><a href="" clas ...

Conceal the Form Upon Submission

I'm currently working on a project where I want to hide my form after the submit button is pressed using Jquery. Firstly, I have included the Jquery library in my code. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jque ...

When I adjust the height to 100%, Google Maps fails to show up on the screen

When I try to set the height of the gmaps div to 100%, nothing appears on the screen. I am able to set the width to 100%, but for some reason, setting the height to 100% does not work. If I set a specific height like 400px, it works fine. Below is the cod ...

Conceal category details from both users and visitors

Utilizing Astra Theme in combination with Elementor and WooCommerce, I have included the subsequent style directive within the custom CSS area of the Astra theme to conceal the category description within the category archives: .term-description { disp ...

Setting overflow sizes manually for parent containers when child elements are transformed using CSS can be done by following these steps

It has come to my understanding that CSS transforms do not impact the actual size of an element, rather its visual representation. There have been discussions on this topic: CSS Scale transform on child not affecting parent size CSS transform: scale does ...

Arrange divs adjacent to each other without any gaps in between

My HTML code includes elements from Twitter Bootstrap and AngularJS framework. <div class="item item-custom-first"> <select class="form-control" style="display:inline; float:right" ng-model="requestdata.units ...

Attempting to apply border radius to a button, yet encountering difficulties in making it work as intended

Creating HTML Class In the following HTML code, a class is created with an anchor tag inside. Although CSS is applied to create a button, the border-radius property seems to not be functioning as expected. .instagram_button a { font-weight: 500; f ...

Issue with Next.js app styles persisting on pages after page refresh

I am currently working on my first next.js project, transitioning from create-react-app, and I've encountered an unusual issue. When I refresh the home page, the CSS styles persist without any problem. However, if I navigate to a different page like " ...

Tips for positioning text on the left and right sides of a div in HTML styling

I am struggling with positioning two pieces of text within a div. Despite having some styling already in place, the text is currently displaying one after the other on the left-hand side. I want to position one piece of text to the left and another to the ...

Steps for rearranging the order of CSS grid layout

Could you assist me in implementing a grid layout that fulfills these specific criteria? I'm unsure of how to proceed, so any guidance would be greatly appreciated. https://i.sstatic.net/vBtXc.png When there are more than 9 items, the current layout ...

Incorporating a horizontal divider into a row within a table

I have been facing an issue with applying a border-bottom rule to each row in my table. Despite trying different approaches, the rule is not being displayed as expected. After inspecting the code and checking the relevant classes, I am still unable to pin ...

Tips for assigning date ranges to arrays and then conducting comparisons with date input information

I'm developing an application with two date input fields. The current function I have calculates the sum of the digits in each field until it reaches a single digit, and then displays the result along with some text. Now, I need to create another fun ...

Switch up the image every 10 seconds

Looking for assistance with changing images every 10 seconds in JavaScript. Here are the HTML and CSS codes, I just need help adding some JavaScript to make it work: HTML <body onload = "imageChanger()"> <div> <ul> ...

Tips for maintaining a border between divs in a bootstrap layout

I have a box positioned on the left side of the screen and a large div element placed adjacent to it. I am looking to enclose both of these elements within a square-shaped border in a light color. How can I achieve this effect? Additionally, I have include ...