英文:
Using -apple-system for monospace and serif
问题
-apple-system
在 macOS 和 iOS 上默认使用 San Francisco 字体,但是 SF Mono 和 New York(Apple 产品的默认衬线字体)是什么默认字体?
英文:
I know that -apple-system
defaults to San Francisco on macOS and iOS, but what defaults to SF Mono and New York (the default serif font for Apple products)?
答案1
得分: 23
自Safari 13.1开始,他们为系统字体添加了字体系列名称:
ui-monospace
— SF Monoui-serif
— New Yorkui-sans-serif
— San Francisco(与system-ui
和-apple-system
相同)
请查看博客文章。
我用于在大多数平台上获取系统等宽字体的CSS如下所示:
code {
font-family: 'SF Mono', SFMono-Regular, ui-monospace,
'DejaVu Sans Mono', Menlo, Consolas, monospace;
}
前三个是SF Mono,然后是Linux上的Bitstream Vera派生字体(DejaVu)和Mac上的字体(Menlo),最后是在Windows上适用的字体(Consolas)。
英文:
Starting from Safari 13.1, they added font family names for system fonts:
ui-monospace
— SF Monoui-serif
— New Yorkui-sans-serif
— San Francisco (same assystem-ui
and-apple-system
)
See the blog post.
The CSS I use to get the system monospace on most platforms is as follows:
code {
font-family: 'SF Mono', SFMono-Regular, ui-monospace,
'DejaVu Sans Mono', Menlo, Consolas, monospace;
}
The first three are SF Mono, then the Bitstream Vera-derived fonts on Linux (DejaVu) and Mac (Menlo), closing with whatever works on Windows (Consolas).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论