diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | res/iOSBundleInfo.plist.in | 1 | ||||
-rw-r--r-- | src/ios.m | 12 | ||||
-rw-r--r-- | src/ui/inputwidget.c | 3 |
4 files changed, 15 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d11e43e..71940aa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -105,7 +105,10 @@ set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.lgr) | |||
105 | make_resources (${EMB_BIN} ${RESOURCES}) | 105 | make_resources (${EMB_BIN} ${RESOURCES}) |
106 | set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 106 | set_source_files_properties (${EMB_BIN} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
107 | if (IOS) | 107 | if (IOS) |
108 | set (EMB_FONTS res/fonts/SourceSans3-Regular.ttf) | 108 | set (EMB_FONTS |
109 | res/fonts/SourceSans3-Regular.ttf | ||
110 | res/fonts/IosevkaTerm-Extended.ttf | ||
111 | ) | ||
109 | set_source_files_properties (${EMB_FONTS} | 112 | set_source_files_properties (${EMB_FONTS} |
110 | PROPERTIES MACOSX_PACKAGE_LOCATION Resources | 113 | PROPERTIES MACOSX_PACKAGE_LOCATION Resources |
111 | ) | 114 | ) |
diff --git a/res/iOSBundleInfo.plist.in b/res/iOSBundleInfo.plist.in index 5a02ed68..c0c1a288 100644 --- a/res/iOSBundleInfo.plist.in +++ b/res/iOSBundleInfo.plist.in | |||
@@ -51,6 +51,7 @@ | |||
51 | <string>LaunchScreen</string> | 51 | <string>LaunchScreen</string> |
52 | <key>UIAppFonts</key> | 52 | <key>UIAppFonts</key> |
53 | <array> | 53 | <array> |
54 | <string>IosevkaTerm-Extended.ttf</string> | ||
54 | <string>SourceSans3-Regular.ttf</string> | 55 | <string>SourceSans3-Regular.ttf</string> |
55 | </array> | 56 | </array> |
56 | <key>UIBackgroundModes</key> | 57 | <key>UIBackgroundModes</key> |
@@ -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 | ||