【问题标题】:Is there a way I can use the Apple San Francisco in a WebView?有没有办法可以在 WebView 中使用 Apple San Francisco?
【发布时间】:2018-04-08 15:50:51
【问题描述】:

我的 CSS 样式表似乎工作正常,但我无法将字体更改为与 iOS 11 中使用的系统字体非常匹配的字体。这是我尝试过的:

body, html {
    color: red;
    font-family: 'San Francisco';
};

字符颜色为红色,但字体不变。

如何在我的 Xamarin.Forms iOS 中指定与 Apple 系统字体非常相似的字体?

【问题讨论】:

标签: xamarin xamarin.ios xamarin.forms ios11


【解决方案1】:

可以通过以下方式检索系统字体系列名称:

UIFont.PreferredBody.FamilyName

在 iOS 11 上是:

.SF UI Text

老派:

<font face='.SF UI Text'>This is the iOS System Font: San Francisco</font>

HTML/CSS:

<!DOCTYPE html>
<html>
    <head>
            <style type='text/css'>
                body { 
                    font-family: '.SF UI Text';
                    font-size: 60pt;
                }
            </style>
     </head>
<body>
This is the iOS System Font: San Francisco
</body>
</html>

【讨论】:

  • 绝妙的答案!!
  • @Woodstock 很高兴它有帮助 ?
  • 安卓怎么样?
  • @ShiFalei ?它是 Apple 受版权保护的字体...fft 和经常与 Apple 的 San Frans “接近”,只需 google 即可。
猜你喜欢
  • 2021-02-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-30
  • 2023-04-09
  • 2019-09-18
  • 1970-01-01
  • 2022-07-15
相关资源
最近更新 更多