From 7a0980fd58308f7333254a1276e6dd5072326d98 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 19 Feb 2021 13:15:08 +0200 Subject: iOS: Adjusting the UI for a tablet screen --- src/ui/text.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/ui/text.c') diff --git a/src/ui/text.c b/src/ui/text.c index 7bb65bdc..e300e7c4 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -246,18 +246,23 @@ static void initFonts_Text_(iText *d) { h12Font = &fontLiterataBoldopsz36_Embedded; h3Font = &fontLiterataRegularopsz14_Embedded; } +#if defined (iPlatformAppleMobile) + const float uiSize = fontSize_UI * 1.1f; +#else + const float uiSize = fontSize_UI; +#endif const struct { const iBlock *ttf; int size; float scaling; int symbolsFont; } fontData[max_FontId] = { - { &fontSourceSansProRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, - { &fontSourceSansProBold_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, - { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, - { &fontSourceSansProBold_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, - { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, - { &fontIosevkaTermExtended_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId }, + { &fontSourceSansProRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, + { &fontSourceSansProBold_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, + { &fontSourceSansProRegular_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, + { &fontSourceSansProBold_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, + { &fontSourceSansProRegular_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, + { &fontIosevkaTermExtended_Embedded, uiSize * 0.866f, 1.0f, defaultSymbols_FontId }, { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, /* content fonts */ { regularFont, textSize, scaling, symbols_FontId }, @@ -272,9 +277,9 @@ static void initFonts_Text_(iText *d) { /* monospace content fonts */ { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, symbols_FontId }, /* symbol fonts */ - { &fontSymbola_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, - { &fontSymbola_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, - { &fontSymbola_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, + { &fontSymbola_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, + { &fontSymbola_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, + { &fontSymbola_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, { &fontSymbola_Embedded, textSize, 1.0f, symbols_FontId }, { &fontSymbola_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, { &fontSymbola_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, @@ -283,9 +288,9 @@ static void initFonts_Text_(iText *d) { { &fontSymbola_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, { &fontSymbola_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, /* emoji fonts */ - { &fontNotoEmojiRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, - { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, - { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize, 1.0f, symbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, @@ -294,7 +299,7 @@ static void initFonts_Text_(iText *d) { { &fontNotoEmojiRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, /* japanese fonts */ - { &fontNotoSansJPRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, + { &fontNotoSansJPRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, { &fontNotoSansJPRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, { &fontNotoSansJPRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, { &fontNotoSansJPRegular_Embedded, textSize, 1.0f, symbols_FontId }, @@ -303,7 +308,7 @@ static void initFonts_Text_(iText *d) { { &fontNotoSansJPRegular_Embedded, textSize * 1.666f, 1.0f, largeSymbols_FontId }, { &fontNotoSansJPRegular_Embedded, textSize * 2.000f, 1.0f, hugeSymbols_FontId }, /* korean fonts */ - { &fontNanumGothicRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, + { &fontNanumGothicRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, { &fontNanumGothicRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, { &fontNanumGothicRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, { &fontNanumGothicRegular_Embedded, textSize, 1.0f, symbols_FontId }, -- cgit v1.2.3