假设这是我的网站:
* {
font-family: Papyrus, nothing;
font-size: 30px;
line-height: 100%;
}
Qui legit haec est mirabilis ❤
现在,❤
不是用 Papyrus 写的,因为它不是这种字体的字形。我通常想隐藏字体文件中不存在的所有字形。改用字体文件的 notdef
字形也可以。我想稍后将它用于可编辑的文本区域。所以手动操作对我没有帮助。
这怎么可能?
最佳答案
您可以使用 Adobe Blank作为 font-family
声明中的后备值。这样,任何不在 Papyrus 字体中的字形都不会在页面上呈现。
* {
font-family: Papyrus, "Adobe Blank";
font-size: 30px;
line-height: 100%;
}
<head>
<!-- Include the Adobe Blank Font -->
<link rel="stylesheet" media="screen" href="http://fontlibrary.org/face/adobe-blank" type="text/css"/>
</head>
<p>Qui legit haec est mirabilis ❤</p>
<p>Qui legit haec est mirabilis❤</p>
关于javascript - 是否可以隐藏缺少的字体字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66148411/