【发布时间】:2016-07-07 23:41:20
【问题描述】:
在 iOS 中,我使用 UIWebView 加载这个短文本文件
然后在 UIWebView 中显示它。 (loadHTMLString)
<html><head><style type='text/css'>
body
{
font-family:'Source Sans Pro';
font-size:12pt;
}
html { -webkit-text-size-adjust:none; }
</style></head>
<body leftmargin=0 topmargin=0>
example text...
</body></html>
这里是安装的 12 个“实际”字体名称 (print(UIFont.fontNamesForFamilyName("Source Sans Pro")))
[“SourceSansPro-BoldIt”、“SourceSansPro-SemiboldIt”、“SourceSansPro-ExtraLight”、“SourceSansPro-Semibold”、“SourceSansPro-Bold”、“SourceSansPro-Black”、“SourceSansPro-Regular”、“SourceSansPro-Light ", "SourceSansPro-BlackIt", "SourceSansPro-It", "SourceSansPro-ExtraLightIt", "SourceSansPro-LightIt"]
现在在 UIWebView 中
body
{
font-family:'Source Sans Pro';
font-size:12pt;
}
效果很好;出现常规的Source Sans Pro 字体。
但是。很简单,我到底怎么告诉 css 使用“ExtraLight”、“BlackIt”等等?
如何在 12 种字体中选择特定的一种???
救命!
【问题讨论】: