From 0bbfd5a2e25e2a843fcee757469193533da98948 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 18 Aug 2020 11:23:54 +0300 Subject: Added a larger content-friendly UI font Mostly for sidebar contents. --- src/ui/sidebarwidget.c | 6 +++--- src/ui/text.c | 6 +++--- src/ui/text.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index de576f72..3fbcccd3 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -167,7 +167,7 @@ void setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) { setFlags_Widget(as_Widget(d->modeButtons[i]), selected_WidgetFlag, i == d->mode); } const float heights[max_SidebarMode] = { 1.5f, 3, 3, 1.2f }; - d->itemHeight = heights[mode] * lineHeight_Text(default_FontId); + d->itemHeight = heights[mode] * lineHeight_Text(uiContent_FontId); } enum iSidebarMode mode_SidebarWidget(const iSidebarWidget *d) { @@ -217,7 +217,7 @@ void init_SidebarWidget(iSidebarWidget *d) { frameless_WidgetFlag | expand_WidgetFlag); d->maxButtonLabelWidth = iMaxi(d->maxButtonLabelWidth, - 3 * gap_UI + measure_Text(default_FontId, normalModeLabels_[i]).x); + 3 * gap_UI + measure_Text(uiLabel_FontId, normalModeLabels_[i]).x); } addChild_Widget(w, iClob(d->scroll = new_ScrollWidget())); setThumb_ScrollWidget(d->scroll, 0, 0); @@ -501,7 +501,7 @@ static void draw_SidebarWidget_(const iSidebarWidget *d) { d->mode == documentOutline_SidebarMode ? tmBackground_ColorId : uiBackground_ColorId); /* Draw the items. */ { - const int font = default_FontId; + const int font = uiContent_FontId; const iRanges visRange = visRange_SidebarWidget_(d); iInt2 pos = addY_I2(topLeft_Rect(bounds), -(d->scrollY % d->itemHeight)); for (size_t i = visRange.start; i < visRange.end; i++) { diff --git a/src/ui/text.c b/src/ui/text.c index 52af34bb..1e702eee 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -120,7 +120,7 @@ static void initFonts_Text_(iText *d) { int symbolsFont; } fontData[max_FontId] = { { &fontSourceSansProRegular_Embedded, fontSize_UI, defaultSymbols_FontId }, - { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.666f, defaultLargeSymbols_FontId }, + { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.150f, defaultMediumSymbols_FontId }, { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.866f, defaultSymbols_FontId }, { &fontFiraSansRegular_Embedded, textSize, symbols_FontId }, { &fontFiraMonoRegular_Embedded, textSize * 0.866f, smallSymbols_FontId }, @@ -133,14 +133,14 @@ static void initFonts_Text_(iText *d) { { &fontFiraSansBold_Embedded, textSize * 2.000f, hugeSymbols_FontId }, { &fontFiraSansLight_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontSymbola_Embedded, fontSize_UI, defaultSymbols_FontId }, - { &fontSymbola_Embedded, fontSize_UI * 1.666f, defaultLargeSymbols_FontId }, + { &fontSymbola_Embedded, fontSize_UI * 1.150f, defaultMediumSymbols_FontId }, { &fontSymbola_Embedded, textSize, symbols_FontId }, { &fontSymbola_Embedded, textSize * 1.333f, mediumSymbols_FontId }, { &fontSymbola_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontSymbola_Embedded, textSize * 2.000f, hugeSymbols_FontId }, { &fontSymbola_Embedded, textSize * 0.866f, smallSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, fontSize_UI, defaultSymbols_FontId }, - { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.666f, defaultLargeSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.150f, defaultMediumSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize, symbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, mediumSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 1.666f, largeSymbols_FontId }, diff --git a/src/ui/text.h b/src/ui/text.h index 85ab44e2..2d49a1a6 100644 --- a/src/ui/text.h +++ b/src/ui/text.h @@ -7,7 +7,7 @@ enum iFontId { default_FontId, - defaultLarge_FontId, + defaultMedium_FontId, defaultMonospace_FontId, regular_FontId, monospace_FontId, @@ -21,7 +21,7 @@ enum iFontId { largeLight_FontId, /* symbol fonts */ defaultSymbols_FontId, - defaultLargeSymbols_FontId, + defaultMediumSymbols_FontId, symbols_FontId, mediumSymbols_FontId, largeSymbols_FontId, @@ -29,7 +29,7 @@ enum iFontId { smallSymbols_FontId, /* emoji fonts */ defaultEmoji_FontId, - defaultLargeEmoji_FontId, + defaultMediumEmoji_FontId, emoji_FontId, mediumEmoji_FontId, largeEmoji_FontId, @@ -42,7 +42,7 @@ enum iFontId { uiLabel_FontId = default_FontId, uiShortcuts_FontId = default_FontId, uiInput_FontId = defaultMonospace_FontId, - uiBookmarkIcon_FontId = defaultLarge_FontId, + uiContent_FontId = defaultMedium_FontId, /* Document fonts: */ paragraph_FontId = regular_FontId, firstParagraph_FontId = medium_FontId, -- cgit v1.2.3