summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-05 08:10:41 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-05 08:10:41 +0200
commit6b4d15c83232d3af564157afdc32dfb5573c2aef (patch)
treea8310f9085335e8cc087f795c35e0097545ae25b /src
parentb8656d5a2e0f540d47d2dc5ccc269f709dd0b923 (diff)
iOS: Monospace text view font
Diffstat (limited to 'src')
-rw-r--r--src/ios.m10
1 files changed, 8 insertions, 2 deletions
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) {
768} 768}
769 769
770void setFont_SystemTextInput(iSystemTextInput *d, int fontId) { 770void setFont_SystemTextInput(iSystemTextInput *d, int fontId) {
771 int height = lineHeight_Text(fontId); 771 float height = lineHeight_Text(fontId) / get_Window()->pixelRatio;
772 UIFont *font = [UIFont systemFontOfSize:0.65f * height / get_Window()->pixelRatio]; 772 UIFont *font;
773 if (fontId / maxVariants_Fonts * maxVariants_Fonts == monospace_FontId) {
774 font = [UIFont monospacedSystemFontOfSize:0.8f * height weight:UIFontWeightRegular];
775 }
776 else {
777 font = [UIFont systemFontOfSize:0.65f * height];
778 }
773 if (d->field) { 779 if (d->field) {
774 [REF_d_field setFont:font]; 780 [REF_d_field setFont:font];
775 } 781 }