From 6b4d15c83232d3af564157afdc32dfb5573c2aef Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 5 Dec 2021 08:10:41 +0200 Subject: iOS: Monospace text view font --- src/ios.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ios.m') diff --git a/src/ios.m b/src/ios.m index 02659c55..290d4804 100644 --- a/src/ios.m +++ b/src/ios.m @@ -768,8 +768,14 @@ int preferredHeight_SystemTextInput(const iSystemTextInput *d) { } void setFont_SystemTextInput(iSystemTextInput *d, int fontId) { - int height = lineHeight_Text(fontId); - UIFont *font = [UIFont systemFontOfSize:0.65f * height / get_Window()->pixelRatio]; + float height = lineHeight_Text(fontId) / get_Window()->pixelRatio; + UIFont *font; + if (fontId / maxVariants_Fonts * maxVariants_Fonts == monospace_FontId) { + font = [UIFont monospacedSystemFontOfSize:0.8f * height weight:UIFontWeightRegular]; + } + else { + font = [UIFont systemFontOfSize:0.65f * height]; + } if (d->field) { [REF_d_field setFont:font]; } -- cgit v1.2.3