事实证明,这是完全可能的,只需要花一些时间深入挖掘。正如在MDN中提到的,您可以关闭常见的连字。
font-feature-settings: "liga" 0;
不过,这可以通过使用一个不常用的 CSS 属性来完成。相反,您应该像这样使用font-variant-ligatures
:
font-variant-ligatures: none;
这两个属性的作用完全相同,但后者是推荐使用的。
MDN:
注意:只要可能,Web作者应该使用字体变体的缩写属性或相关的长手写属性,如font-variant-ligatures、font-variant-caps、font-variant-east-asian、font-variant-alternates、font-variant-numeric或font-variant-position。
这个属性是一个低级特性,设计用来处理没有其他方式启用或访问OpenType字体特征的特殊情况。
特别地,此CSS属性不应用于启用小型大写字母。
body {
font-variant-ligatures: none;
font-feature-settings: "liga" 0;
}
点击“启用全局样式表”即可。咦,Chrome再也不会渲染连字体(它会将字符分开显示)。 另外,当我要求Chrome将网页打印成PDF时,字符也会被分开显示。
将此添加为书签,打印时仅需单击一次。
javascript: void(function () {
var css = `
* {
font-variant-ligatures: none!important;
font-feature-settings: "liga" 0!important;
}
`;
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
/*This is required for IE8 and below.*/
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
/*It is not necessary to set a delay.*/
setTimeout(function () {
window.print();
}, 2000);
})()
将JavaScript小应用程序添加到Chrome的书签
https://clicknathan.com/2010/07/12/how-to-add-javascript-applets-to-as-google-chrome-bookmarks/
Open a New Tab in Chrome. Command+T on a Mac, Ctrl+T on a Windows.
Google Toolbar as seen in Chrome's New TabRight click on the Bookmarks Toolbar. It’s a gray colored box like the one pictured here.
Select “Add Page” from the contextual menu that appears.
Give the Bookmark a name. You could Google “Baby Names” if you can’t come up with one. I like Shepherd or Samson or even Samsonite if you have aspirations of a career in luggage design, sales or airport security.
Paste the Javascript applet into the URL field.
Save that son of a gun and you’re on your way to finishing this tutorial!
letter-spacing
)即可。https://jsfiddle.net/MrLister/8h55dzc5/ - Mr Lister