diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ios.m | 12 | ||||
-rw-r--r-- | src/ui/inputwidget.c | 3 |
2 files changed, 10 insertions, 5 deletions
@@ -811,14 +811,18 @@ int preferredHeight_SystemTextInput(const iSystemTextInput *d) { | |||
811 | void setFont_SystemTextInput(iSystemTextInput *d, int fontId) { | 811 | void setFont_SystemTextInput(iSystemTextInput *d, int fontId) { |
812 | float height = lineHeight_Text(fontId) / get_Window()->pixelRatio; | 812 | float height = lineHeight_Text(fontId) / get_Window()->pixelRatio; |
813 | UIFont *font; | 813 | UIFont *font; |
814 | // for (NSString *name in [UIFont familyNames]) { | ||
815 | // printf("family: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); | ||
816 | // } | ||
814 | if (fontId / maxVariants_Fonts * maxVariants_Fonts == monospace_FontId) { | 817 | if (fontId / maxVariants_Fonts * maxVariants_Fonts == monospace_FontId) { |
815 | font = [UIFont monospacedSystemFontOfSize:0.8f * height weight:UIFontWeightRegular]; | 818 | // font = [UIFont monospacedSystemFontOfSize:0.8f * height weight:UIFontWeightRegular]; |
819 | // for (NSString *name in [UIFont fontNamesForFamilyName:@"Iosevka Term"]) { | ||
820 | // printf("fontname: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); | ||
821 | // } | ||
822 | font = [UIFont fontWithName:@"Iosevka-Term-Extended" size:height * 0.8f]; | ||
816 | } | 823 | } |
817 | else { | 824 | else { |
818 | // font = [UIFont systemFontOfSize:0.65f * height]; | 825 | // font = [UIFont systemFontOfSize:0.65f * height]; |
819 | // for (NSString *name in [UIFont fontNamesForFamilyName:@"Source Sans 3"]) { | ||
820 | // printf("fontname: %s\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); | ||
821 | // } | ||
822 | font = [UIFont fontWithName:@"SourceSans3-Regular" size:height * 0.7f]; | 826 | font = [UIFont fontWithName:@"SourceSans3-Regular" size:height * 0.7f]; |
823 | } | 827 | } |
824 | if (d->field) { | 828 | if (d->field) { |
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 3572d043..d62bc77e 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -711,10 +711,11 @@ static void startOrStopCursorTimer_InputWidget_(iInputWidget *d, iBool doStart) | |||
711 | static void updateAllLinesAndResizeHeight_InputWidget_(iInputWidget *d) { | 711 | static void updateAllLinesAndResizeHeight_InputWidget_(iInputWidget *d) { |
712 | /* Rewrap the buffered text and resize accordingly. */ | 712 | /* Rewrap the buffered text and resize accordingly. */ |
713 | iWrapText wt = wrap_InputWidget_(d, 0); | 713 | iWrapText wt = wrap_InputWidget_(d, 0); |
714 | /* TODO: Set max lines limit for WrapText. */ | ||
714 | const int height = measure_WrapText(&wt, d->font).bounds.size.y; | 715 | const int height = measure_WrapText(&wt, d->font).bounds.size.y; |
715 | /* We use this to store the number wrapped lines for determining widget height. */ | 716 | /* We use this to store the number wrapped lines for determining widget height. */ |
716 | d->visWrapLines.start = 0; | 717 | d->visWrapLines.start = 0; |
717 | d->visWrapLines.end = height / lineHeight_Text(d->font); | 718 | d->visWrapLines.end = iMin(d->maxWrapLines, height / lineHeight_Text(d->font)); |
718 | updateMetrics_InputWidget_(d); | 719 | updateMetrics_InputWidget_(d); |
719 | } | 720 | } |
720 | 721 | ||