From 77fd3020cc0ed52123c0ed66cfc909a910cc1021 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 12 Mar 2020 19:01:10 -0500 Subject: [PATCH] Correct font used to specify font size. Issue #1878 --- Shared/Article Rendering/ArticleRenderer.swift | 3 ++- iOS/Resources/styleSheet.css | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Shared/Article Rendering/ArticleRenderer.swift b/Shared/Article Rendering/ArticleRenderer.swift index 5b0192afe..a66568560 100644 --- a/Shared/Article Rendering/ArticleRenderer.swift +++ b/Shared/Article Rendering/ArticleRenderer.swift @@ -248,7 +248,8 @@ private extension ArticleRenderer { #if os(iOS) func styleSubstitutions() -> [String: String] { var d = [String: String]() - d["font-size"] = String(describing: UIFontMetrics.default.scaledValue(for: UIFont.systemFontSize)) + let bodyFont = UIFont.preferredFont(forTextStyle: .body) + d["font-size"] = String(describing: bodyFont.pointSize) return d } #endif diff --git a/iOS/Resources/styleSheet.css b/iOS/Resources/styleSheet.css index 30f87eede..b5bd49dee 100644 --- a/iOS/Resources/styleSheet.css +++ b/iOS/Resources/styleSheet.css @@ -1,6 +1,6 @@ :root { font: -apple-system-body; - font-size: [[font-size]]pt; + font-size: [[font-size]]px; } body { @@ -77,7 +77,7 @@ body .headerTable { } body .header { font: -apple-system-body; - font-size: [[font-size]]pt; + font-size: [[font-size]]px; color: var(--header-color); } body .header a:link, body .header a:visited {