css - 为什么@font-face 的字母间距不起作用?

标签 css fonts font-face multilingual

我在一个多语言网站上工作,并使用@font-face 来显示缅甸字体。除了字母间距外,一切看起来都不错。因此我试图在@font-face 中插入字母间距。但它没有效果。在 body 或 html 或容器内使用字母间距也会插入其他字体的字母间距,这不是我想要的。我只想增加 Zawgyi-One 字体的字母间距,如下所示。

@font-face {
    font-family: 'Zawgyi-One';
    src: url('/fonts/Zawgyi-One.eot');
    src: url('/fonts/Zawgyi-One.eot?iefixa') format('eot'),
         url('/fonts/Zawgyi-One.woff') format('woff'),
         url('/fonts/Zawgyi-One.ttf') format('truetype'),
         url('/fonts/Zawgyi-One.svg#svgFontName') format('svg');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+00-FF, U+980-9FF;
    letter-spacing: 0.30em!important;
}

最佳答案

看起来来自 Mozilla docs letter-spacing 不支持作为字体定义的一部分。

也就是说,我会定义字体,然后定义一个类以应用于具有该字体系列声明的对象。

例如,

.zawgi-one {
  font-family: 'Zawgi-One';
  letter-spacing: 0.30em !important;
}

关于css - 为什么@font-face 的字母间距不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25012405/

相关文章:

javascript - 少编译和保存 Bootstrap

c++ - 为什么 MS 在其 win32api 中没有返回字体文件名的函数,给定字体句柄?

javascript - 如何在 Cl-Editor 中添加更多字体?

html - 如何在 CSS 中使用 Segoe Print 字体?

css - @font-face vs 谷歌字体 vs Cufon

javascript - 试图居中和滚动文本

css - Liferay 中的主题开发

javascript - 如何提高 html、css、javascript 的知识

javascript - discord.js 中的字体生成器

css - @font-face 在其他计算机上不工作 - 具有正确的文件链接