gpt4 book ai didi

css - Firefox 字体垂直错位?

转载 作者:行者123 更新时间:2023-11-28 10:36:42 24 4
gpt4 key购买 nike

所以我在我的设计中使用了这个名为 Gagalin(常规)的网络字体,它在 Chrome 和 Edge 中运行良好。然而,当我在 FireFox 中查看它时,我发现了一个非常奇怪的垂直错位(下图)。此外,我使用的 @font-face 规则之前一直有效(也在 FireFox 中),只是不适用于此字体,因为我使用的其他 webfont 已正确对齐。关于如何解决这个问题的任何想法?我假设它与字体有关?

编辑也许这不是最好的询问地点,但我真的不知道还能去哪里

代码

我设置了 magin、padding 和 line-height 重置 + 我将 normalize.min.css 包含在 h1 margin 中,我将其明确重置为 0 覆盖规范化 margin 。标题 h1 的行高也再次设置为 1。

Dropbox link to the font files

@font-face {
font-family:'Gagalin';
src:url(../fonts/gagalin/Gagalin-Regular.eot);
src:url(../fonts/gagalin/Gagalin-Regular.eot?#iefix) format('embedded-opentype'),
url(../fonts/gagalin/Gagalin-Regular.svg#Gagalin-Regular) format('svg'),
url(../fonts/gagalin/Gagalin-Regular.woff2) format('woff2'),
url(../fonts/gagalin/Gagalin-Regular.woff) format('woff'),
url(../fonts/gagalin/Gagalin-Regular.otf) format('opentype');
font-weight:400;
font-style:normal
}

* {
display: block;
margin: 0;
padding: 0;
border: 0;

font-weight: normal;
font-size: 3vm;
font-size: 3vmin;
line-height: 1.5;
}

h1 {
font-family: 'Gagalin';
margin: 0;
}

header h1 {
line-height: 1;
}

更新尝试删除所有字体,但 woff 字体和问题仍然相同

@font-face {
font-family:'Gagalin';
src:url(../fonts/gagalin/Gagalin-Regular.woff2) format('woff2'),
url(../fonts/gagalin/Gagalin-Regular.woff) format('woff');
font-weight:400;
font-style:normal
}

图像

Screenshot

Edge

最佳答案

适合那些想知道我能够通过在 Birdfont 中打开字体、导出并重新转换来解决此问题的人。我真的不知道为什么 Firefox 把它搞砸了,而其他浏览器对它没有怨恨,但它现在正在工作。

感谢您的时间和答复

关于css - Firefox 字体垂直错位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37108726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com