Using -apple-system for monospace and serif

huangapple go评论82阅读模式
英文:

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 Mono
  • ui-serif — New York
  • ui-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 Mono
  • ui-serif — New York
  • ui-sans-serif — San Francisco (same as system-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).

huangapple
  • 本文由 发表于 2020年1月3日 20:06:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578361.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定