Chrome 中的“等宽”是什么?

147*_*7pm 6 ubuntu fonts google-chrome monospace

我在 Ubuntu 15.10 上使用 Chrome (47.0.2526.106)。据我所知,“等宽”只是使用“系统”等宽字体的指令(因为不是特定字体)。在 Chrome 设置中,“固定宽度字体”设置为“等宽字体”。然后在我的 Tweek Tool Fonts Monospace 中,我设置了 Courier——但是当一个页面(例如一个简单的错误页面)出现时,我看到的不是 Courier,而是类似于 Ubuntu Mono 的东西,但不完全是这样。Chrome 使用什么字体?它是发送字体,还是在我的系统上使用其他字体?

小智 9

在您的浏览器中输入此 url (chrome://settings/fonts),然后查看为“固定宽度”设置的字体。


小智 0

var font = 'monospace';
if(navigator.userAgent.match(/Chrome/gi) || navigator.userAgent.match(/Opera/gi)){
    font = 'Courier';
};

pre_element.style.fontFamily = font;
textarea_element.style.fontFamily = font;
Run Code Online (Sandbox Code Playgroud)