diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-05 08:10:41 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-05 08:10:41 +0200 |
commit | 6b4d15c83232d3af564157afdc32dfb5573c2aef (patch) | |
tree | a8310f9085335e8cc087f795c35e0097545ae25b /src | |
parent | b8656d5a2e0f540d47d2dc5ccc269f709dd0b923 (diff) |
iOS: Monospace text view font
Diffstat (limited to 'src')
-rw-r--r-- | src/ios.m | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -768,8 +768,14 @@ int preferredHeight_SystemTextInput(const iSystemTextInput *d) { | |||
768 | } | 768 | } |
769 | 769 | ||
770 | void setFont_SystemTextInput(iSystemTextInput *d, int fontId) { | 770 | void 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 | } |