How can I use the New York font in web content on iOS 13?

青春壹個敷衍的年華 提交于 2020-01-24 09:27:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!