From a0ba9e3321212a5800e6c1076b30d5b85151dd3f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 20 Sep 2020 08:29:20 +0300 Subject: Text: Slightly smaller first paragraph font size Added a new 1.2x font size and use it for first paragraphs. --- src/ui/text.c | 19 ++++++++++++++----- src/ui/text.h | 13 ++++++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/ui/text.c b/src/ui/text.c index a48d0e0e..1e714320 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -167,33 +167,41 @@ static void initFonts_Text_(iText *d) { { &fontSourceSansProRegular_Embedded, fontSize_UI, defaultSymbols_FontId }, { &fontSourceSansProRegular_Embedded, fontSize_UI * 1.125f, defaultMediumSymbols_FontId }, { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.866f, defaultSymbols_FontId }, + /* content fonts */ { &fontNunitoRegular_Embedded, textSize, symbols_FontId }, { &fontFiraMonoRegular_Embedded, monoSize, smallSymbols_FontId }, { &fontFiraMonoRegular_Embedded, monoSize * 0.750f, smallSymbols_FontId }, - { &fontNunitoRegular_Embedded, textSize * 1.333f, mediumSymbols_FontId }, + { &fontNunitoRegular_Embedded, textSize * 1.200f, mediumSymbols_FontId }, + { &fontNunitoRegular_Embedded, textSize * 1.333f, bigSymbols_FontId }, { &fontNunitoLightItalic_Embedded, textSize, symbols_FontId }, { &fontNunitoExtraBold_Embedded, textSize, symbols_FontId }, { &fontNunitoExtraBold_Embedded, textSize * 1.333f, mediumSymbols_FontId }, { &fontNunitoExtraBold_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontNunitoExtraBold_Embedded, textSize * 2.000f, hugeSymbols_FontId }, { &fontNunitoExtraLight_Embedded, textSize * 1.666f, largeSymbols_FontId }, + /* symbol fonts */ { &fontSymbola_Embedded, fontSize_UI, defaultSymbols_FontId }, { &fontSymbola_Embedded, fontSize_UI * 1.125f, defaultMediumSymbols_FontId }, { &fontSymbola_Embedded, textSize, symbols_FontId }, - { &fontSymbola_Embedded, textSize * 1.333f, mediumSymbols_FontId }, + { &fontSymbola_Embedded, textSize * 1.200f, mediumSymbols_FontId }, + { &fontSymbola_Embedded, textSize * 1.333f, bigSymbols_FontId }, { &fontSymbola_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontSymbola_Embedded, textSize * 2.000f, hugeSymbols_FontId }, { &fontSymbola_Embedded, textSize * 0.866f, smallSymbols_FontId }, + /* emoji fonts */ { &fontNotoEmojiRegular_Embedded, fontSize_UI, defaultSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, fontSize_UI * 1.125f, defaultMediumSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize, symbols_FontId }, - { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, mediumSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, textSize * 1.200f, mediumSymbols_FontId }, + { &fontNotoEmojiRegular_Embedded, textSize * 1.333f, bigSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 2.000f, hugeSymbols_FontId }, { &fontNotoEmojiRegular_Embedded, textSize * 0.866f, smallSymbols_FontId }, + /* japanese fonts */ { &fontKosugiMaruRegular_Embedded, textSize * 0.666f, smallSymbols_FontId }, { &fontKosugiMaruRegular_Embedded, textSize, symbols_FontId }, - { &fontKosugiMaruRegular_Embedded, textSize * 1.333f, mediumSymbols_FontId }, + { &fontKosugiMaruRegular_Embedded, textSize * 1.200f, mediumSymbols_FontId }, + { &fontKosugiMaruRegular_Embedded, textSize * 1.333f, bigSymbols_FontId }, { &fontKosugiMaruRegular_Embedded, textSize * 1.666f, largeSymbols_FontId }, { &fontKosugiMaruRegular_Embedded, textSize * 2.000f, hugeSymbols_FontId }, }; @@ -214,7 +222,8 @@ static void initFonts_Text_(iText *d) { font_Text_(monospace_FontId)->japaneseFont = smallJapanese_FontId; font_Text_(monospaceSmall_FontId)->japaneseFont = smallJapanese_FontId; font_Text_(medium_FontId)->japaneseFont = mediumJapanese_FontId; - font_Text_(mediumBold_FontId)->japaneseFont = mediumJapanese_FontId; + font_Text_(big_FontId)->japaneseFont = bigJapanese_FontId; + font_Text_(bigBold_FontId)->japaneseFont = bigJapanese_FontId; font_Text_(largeBold_FontId)->japaneseFont = largeJapanese_FontId; font_Text_(largeLight_FontId)->japaneseFont = largeJapanese_FontId; font_Text_(hugeBold_FontId)->japaneseFont = hugeJapanese_FontId; diff --git a/src/ui/text.h b/src/ui/text.h index 9a22620f..116aab2c 100644 --- a/src/ui/text.h +++ b/src/ui/text.h @@ -27,17 +27,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include +/* Size names: regular (1x) -> medium (1.2x) -> big (1.33x) -> large (1.67x) -> huge (2x) */ + enum iFontId { default_FontId, defaultMedium_FontId, defaultMonospace_FontId, + /* content fonts */ regular_FontId, monospace_FontId, monospaceSmall_FontId, medium_FontId, + big_FontId, italic_FontId, bold_FontId, - mediumBold_FontId, + bigBold_FontId, largeBold_FontId, hugeBold_FontId, largeLight_FontId, @@ -46,6 +50,7 @@ enum iFontId { defaultMediumSymbols_FontId, symbols_FontId, mediumSymbols_FontId, + bigSymbols_FontId, largeSymbols_FontId, hugeSymbols_FontId, smallSymbols_FontId, @@ -54,6 +59,7 @@ enum iFontId { defaultMediumEmoji_FontId, emoji_FontId, mediumEmoji_FontId, + bigEmoji_FontId, largeEmoji_FontId, hugeEmoji_FontId, smallEmoji_FontId, @@ -61,12 +67,13 @@ enum iFontId { smallJapanese_FontId, regularJapanese_FontId, mediumJapanese_FontId, + bigJapanese_FontId, largeJapanese_FontId, hugeJapanese_FontId, max_FontId, /* Meta: */ - fromSymbolsToEmojiOffset_FontId = 7, + fromSymbolsToEmojiOffset_FontId = 8, /* UI fonts: */ uiLabel_FontId = default_FontId, @@ -81,7 +88,7 @@ enum iFontId { quote_FontId = italic_FontId, heading1_FontId = hugeBold_FontId, heading2_FontId = largeBold_FontId, - heading3_FontId = medium_FontId, + heading3_FontId = big_FontId, banner_FontId = largeLight_FontId, }; -- cgit v1.2.3