diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-19 13:15:08 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-19 13:15:08 +0200 |
commit | 7a0980fd58308f7333254a1276e6dd5072326d98 (patch) | |
tree | 8431dfd498762a90944bb5e595f61ea2af914a81 /src/ui/text.c | |
parent | 63dc07ddbecfdf0be7c0bd98c53e492628dda98b (diff) |
iOS: Adjusting the UI for a tablet screen
Diffstat (limited to 'src/ui/text.c')
-rw-r--r-- | src/ui/text.c | 33 |
1 files changed, 19 insertions, 14 deletions
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) { | |||
246 | h12Font = &fontLiterataBoldopsz36_Embedded; | 246 | h12Font = &fontLiterataBoldopsz36_Embedded; |
247 | h3Font = &fontLiterataRegularopsz14_Embedded; | 247 | h3Font = &fontLiterataRegularopsz14_Embedded; |
248 | } | 248 | } |
249 | #if defined (iPlatformAppleMobile) | ||
250 | const float uiSize = fontSize_UI * 1.1f; | ||
251 | #else | ||
252 | const float uiSize = fontSize_UI; | ||
253 | #endif | ||
249 | const struct { | 254 | const struct { |
250 | const iBlock *ttf; | 255 | const iBlock *ttf; |
251 | int size; | 256 | int size; |
252 | float scaling; | 257 | float scaling; |
253 | int symbolsFont; | 258 | int symbolsFont; |
254 | } fontData[max_FontId] = { | 259 | } fontData[max_FontId] = { |
255 | { &fontSourceSansProRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 260 | { &fontSourceSansProRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
256 | { &fontSourceSansProBold_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 261 | { &fontSourceSansProBold_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
257 | { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, | 262 | { &fontSourceSansProRegular_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, |
258 | { &fontSourceSansProBold_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, | 263 | { &fontSourceSansProBold_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, |
259 | { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, | 264 | { &fontSourceSansProRegular_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, |
260 | { &fontIosevkaTermExtended_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId }, | 265 | { &fontIosevkaTermExtended_Embedded, uiSize * 0.866f, 1.0f, defaultSymbols_FontId }, |
261 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, | 266 | { &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId }, |
262 | /* content fonts */ | 267 | /* content fonts */ |
263 | { regularFont, textSize, scaling, symbols_FontId }, | 268 | { regularFont, textSize, scaling, symbols_FontId }, |
@@ -272,9 +277,9 @@ static void initFonts_Text_(iText *d) { | |||
272 | /* monospace content fonts */ | 277 | /* monospace content fonts */ |
273 | { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, symbols_FontId }, | 278 | { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, symbols_FontId }, |
274 | /* symbol fonts */ | 279 | /* symbol fonts */ |
275 | { &fontSymbola_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 280 | { &fontSymbola_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
276 | { &fontSymbola_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, | 281 | { &fontSymbola_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, |
277 | { &fontSymbola_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, | 282 | { &fontSymbola_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, |
278 | { &fontSymbola_Embedded, textSize, 1.0f, symbols_FontId }, | 283 | { &fontSymbola_Embedded, textSize, 1.0f, symbols_FontId }, |
279 | { &fontSymbola_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, | 284 | { &fontSymbola_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, |
280 | { &fontSymbola_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, | 285 | { &fontSymbola_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, |
@@ -283,9 +288,9 @@ static void initFonts_Text_(iText *d) { | |||
283 | { &fontSymbola_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 288 | { &fontSymbola_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
284 | { &fontSymbola_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, | 289 | { &fontSymbola_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, |
285 | /* emoji fonts */ | 290 | /* emoji fonts */ |
286 | { &fontNotoEmojiRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 291 | { &fontNotoEmojiRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
287 | { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId }, | 292 | { &fontNotoEmojiRegular_Embedded, uiSize * 1.125f, 1.0f, defaultMediumSymbols_FontId }, |
288 | { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId }, | 293 | { &fontNotoEmojiRegular_Embedded, uiSize * 1.666f, 1.0f, defaultLargeSymbols_FontId }, |
289 | { &fontNotoEmojiRegular_Embedded, textSize, 1.0f, symbols_FontId }, | 294 | { &fontNotoEmojiRegular_Embedded, textSize, 1.0f, symbols_FontId }, |
290 | { &fontNotoEmojiRegular_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, | 295 | { &fontNotoEmojiRegular_Embedded, textSize * 1.200f, 1.0f, mediumSymbols_FontId }, |
291 | { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, | 296 | { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, 1.0f, bigSymbols_FontId }, |
@@ -294,7 +299,7 @@ static void initFonts_Text_(iText *d) { | |||
294 | { &fontNotoEmojiRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 299 | { &fontNotoEmojiRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
295 | { &fontNotoEmojiRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, | 300 | { &fontNotoEmojiRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, |
296 | /* japanese fonts */ | 301 | /* japanese fonts */ |
297 | { &fontNotoSansJPRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 302 | { &fontNotoSansJPRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
298 | { &fontNotoSansJPRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, | 303 | { &fontNotoSansJPRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, |
299 | { &fontNotoSansJPRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 304 | { &fontNotoSansJPRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
300 | { &fontNotoSansJPRegular_Embedded, textSize, 1.0f, symbols_FontId }, | 305 | { &fontNotoSansJPRegular_Embedded, textSize, 1.0f, symbols_FontId }, |
@@ -303,7 +308,7 @@ static void initFonts_Text_(iText *d) { | |||
303 | { &fontNotoSansJPRegular_Embedded, textSize * 1.666f, 1.0f, largeSymbols_FontId }, | 308 | { &fontNotoSansJPRegular_Embedded, textSize * 1.666f, 1.0f, largeSymbols_FontId }, |
304 | { &fontNotoSansJPRegular_Embedded, textSize * 2.000f, 1.0f, hugeSymbols_FontId }, | 309 | { &fontNotoSansJPRegular_Embedded, textSize * 2.000f, 1.0f, hugeSymbols_FontId }, |
305 | /* korean fonts */ | 310 | /* korean fonts */ |
306 | { &fontNanumGothicRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId }, | 311 | { &fontNanumGothicRegular_Embedded, uiSize, 1.0f, defaultSymbols_FontId }, |
307 | { &fontNanumGothicRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, | 312 | { &fontNanumGothicRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId }, |
308 | { &fontNanumGothicRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, | 313 | { &fontNanumGothicRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId }, |
309 | { &fontNanumGothicRegular_Embedded, textSize, 1.0f, symbols_FontId }, | 314 | { &fontNanumGothicRegular_Embedded, textSize, 1.0f, symbols_FontId }, |