iphone - Google 网络字体在 iPhone 5 上加载不一致

标签 iphone ios google-webfonts

在 iPhone5 Safari 上,我发现大多数时候我的页面在加载谷歌网络字体之前使用默认字体呈现,但当谷歌字体完成加载时页面不会重新呈现。我在桌面浏览器或 WindowsPhone 中没有看到这个问题,在这些平台上我没有看到显示字体的任何问题。

我是否需要使用 webfonts API 手动告诉页面以某种方式重绘?这似乎有些矫枉过正,所以也许我遗漏了什么?

我按如下方式加载字体:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>New Web Project</title>
    <link href='http://fonts.googleapis.com/css?family=Dosis:300,400,500' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <script type="text/javascript" src="script.js"></script>
    <link rel="stylesheet" type="text/css" href="css.css" />
</head>

我在单独的 CSS 文件中定义了一些样式,然后在我的页面正文中使用这些样式。

.defaultHeading {
font-family: 'Dosis', sans-serif; 
font-size:36px; 
color:#a02422; 
font-weight:500; 
line-height:36px 
}

最佳答案

好的,我通过在 CSS 中指定以下内容解决了所有问题

@media only screen and (max-device-width: 480px) {      
    #main { -webkit-text-size-adjust:100% }               
}

这会阻止 Safari 在 iPhone 上调整字体大小。

关于iphone - Google 网络字体在 iPhone 5 上加载不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13691627/

相关文章:

iphone - iPhone 上的 JSON POST 请求(使用 HTTPS)

google-chrome - 使用 Google Web Fonts 优先使用 SVG 字体

ios - 在两个图像之间绘制和更新线

ios - Swift 3 - 将 AudioStreamBasicDescription 字段初始化为零

css - 网站上的文字被压扁

ruby-on-rails - 带有谷歌网络字体的pdfkit

iPhone:如何动态设置UIImage的大小、宽度、高度和方向?

ios - 使用ARKIT检测人脸不同部分

iphone - 什么时候使用存档: method of NSManagedObjectContext

ios - 格式指定类型 'int' 但参数的类型为 'UIViewContentMode'