问题
Apple released a new font, New York, with iOS 13. Is it possible to set it in CSS for web content, like using -apple-system for San Francisco?
回答1:
I was able to reference the fonts on my MacBook with these:
.NewYork-Regular
.NewYork-Bold
.NewYork-Medium
.NewYork-RegularItalic
.NewYork-BoldItalic
.NewYork-MediumItalic
Others may exist, but these are the only ones that worked for me. I did install the font from their developer page before testing, but I'm not sure it's needed - it may be included with Catalina. I'm not sure how the names map to the fonts - my system shows NewYorkExtraLarge
, NewYorkLarge
, NewYorkMedium
, and NewYorkSmall
, while the filenames (that I could find) are NewYork.ttf
and NewYorkItalic.ttf
- there may be others, though.
I tried the same thing in the latest iOS simulator, but none of them worked there.
回答2:
Try
font-family: -apple-system-ui-serif, ui-serif;
https://www.w3.org/TR/css-fonts-4/#ui-serif-def
来源:https://stackoverflow.com/questions/58019423/how-can-i-use-the-new-york-font-in-web-content-on-ios-13