Smaller fonts

This commit is contained in:
Irene Ying
2025-12-31 20:49:20 -08:00
parent 04ad4e5aa4
commit ae5c96dbbb
22 changed files with 33088 additions and 10 deletions

View File

@@ -131,6 +131,8 @@ int CrossPointSettings::getReaderFontId() const {
case BOOKERLY:
default:
switch (fontSize) {
case EXTRA_SMALL:
return BOOKERLY_10_FONT_ID;
case SMALL:
return BOOKERLY_12_FONT_ID;
case MEDIUM:
@@ -143,6 +145,8 @@ int CrossPointSettings::getReaderFontId() const {
}
case NOTOSANS:
switch (fontSize) {
case EXTRA_SMALL:
return NOTOSANS_10_FONT_ID;
case SMALL:
return NOTOSANS_12_FONT_ID;
case MEDIUM:
@@ -155,6 +159,8 @@ int CrossPointSettings::getReaderFontId() const {
}
case OPENDYSLEXIC:
switch (fontSize) {
case EXTRA_SMALL:
return OPENDYSLEXIC_7_FONT_ID;
case SMALL:
return OPENDYSLEXIC_8_FONT_ID;
case MEDIUM:

View File

@@ -41,7 +41,7 @@ class CrossPointSettings {
// Font family options
enum FONT_FAMILY { BOOKERLY = 0, NOTOSANS = 1, OPENDYSLEXIC = 2 };
// Font size options
enum FONT_SIZE { SMALL = 0, MEDIUM = 1, LARGE = 2, EXTRA_LARGE = 3 };
enum FONT_SIZE { SMALL = 0, MEDIUM = 1, LARGE = 2, EXTRA_LARGE = 3, EXTRA_SMALL = 4 };
enum LINE_COMPRESSION { TIGHT = 0, NORMAL = 1, WIDE = 2 };
// Sleep screen settings

View File

@@ -32,7 +32,7 @@ const SettingInfo settingsList[settingsCount] = {
SettingType::ENUM,
&CrossPointSettings::fontFamily,
{"Bookerly", "Noto Sans", "Open Dyslexic"}},
{"Reader Font Size", SettingType::ENUM, &CrossPointSettings::fontSize, {"Small", "Medium", "Large", "X Large"}},
{"Reader Font Size", SettingType::ENUM, &CrossPointSettings::fontSize, {"Small", "Medium", "Large", "X Large", "X Small"}},
{"Reader Line Spacing", SettingType::ENUM, &CrossPointSettings::lineSpacing, {"Tight", "Normal", "Wide"}},
{"Check for updates", SettingType::ACTION, nullptr, {}},
};

View File

@@ -1,14 +1,17 @@
// The contents of this file are generated by ./lib/EpdFont/scripts/build-font-ids.sh
#pragma once
#define BOOKERLY_10_FONT_ID (1682775559)
#define BOOKERLY_12_FONT_ID (-142329172)
#define BOOKERLY_14_FONT_ID (104246423)
#define BOOKERLY_16_FONT_ID (1909382491)
#define BOOKERLY_18_FONT_ID (2056549737)
#define NOTOSANS_10_FONT_ID (191539796)
#define NOTOSANS_12_FONT_ID (-1646794343)
#define NOTOSANS_14_FONT_ID (-890242897)
#define NOTOSANS_16_FONT_ID (241925189)
#define NOTOSANS_18_FONT_ID (1503221336)
#define OPENDYSLEXIC_7_FONT_ID (-196215919)
#define OPENDYSLEXIC_8_FONT_ID (875216341)
#define OPENDYSLEXIC_10_FONT_ID (-1234231183)
#define OPENDYSLEXIC_12_FONT_ID (1682200414)

View File

@@ -40,6 +40,12 @@ GfxRenderer renderer(einkDisplay);
Activity* currentActivity;
// Fonts
EpdFont bookerly10RegularFont(&bookerly_10_regular);
EpdFont bookerly10BoldFont(&bookerly_10_bold);
EpdFont bookerly10ItalicFont(&bookerly_10_italic);
EpdFont bookerly10BoldItalicFont(&bookerly_10_bolditalic);
EpdFontFamily bookerly10FontFamily(&bookerly10RegularFont, &bookerly10BoldFont, &bookerly10ItalicFont,
&bookerly10BoldItalicFont);
EpdFont bookerly12RegularFont(&bookerly_12_regular);
EpdFont bookerly12BoldFont(&bookerly_12_bold);
EpdFont bookerly12ItalicFont(&bookerly_12_italic);
@@ -65,6 +71,12 @@ EpdFont bookerly18BoldItalicFont(&bookerly_18_bolditalic);
EpdFontFamily bookerly18FontFamily(&bookerly18RegularFont, &bookerly18BoldFont, &bookerly18ItalicFont,
&bookerly18BoldItalicFont);
EpdFont notosans10RegularFont(&notosans_10_regular);
EpdFont notosans10BoldFont(&notosans_10_bold);
EpdFont notosans10ItalicFont(&notosans_10_italic);
EpdFont notosans10BoldItalicFont(&notosans_10_bolditalic);
EpdFontFamily notosans10FontFamily(&notosans10RegularFont, &notosans10BoldFont, &notosans10ItalicFont,
&notosans10BoldItalicFont);
EpdFont notosans12RegularFont(&notosans_12_regular);
EpdFont notosans12BoldFont(&notosans_12_bold);
EpdFont notosans12ItalicFont(&notosans_12_italic);
@@ -90,6 +102,12 @@ EpdFont notosans18BoldItalicFont(&notosans_18_bolditalic);
EpdFontFamily notosans18FontFamily(&notosans18RegularFont, &notosans18BoldFont, &notosans18ItalicFont,
&notosans18BoldItalicFont);
EpdFont opendyslexic7RegularFont(&opendyslexic_7_regular);
EpdFont opendyslexic7BoldFont(&opendyslexic_7_bold);
EpdFont opendyslexic7ItalicFont(&opendyslexic_7_italic);
EpdFont opendyslexic7BoldItalicFont(&opendyslexic_7_bolditalic);
EpdFontFamily opendyslexic7FontFamily(&opendyslexic7RegularFont, &opendyslexic7BoldFont, &opendyslexic7ItalicFont,
&opendyslexic7BoldItalicFont);
EpdFont opendyslexic8RegularFont(&opendyslexic_8_regular);
EpdFont opendyslexic8BoldFont(&opendyslexic_8_bold);
EpdFont opendyslexic8ItalicFont(&opendyslexic_8_italic);
@@ -231,14 +249,17 @@ void onGoHome() {
void setupDisplayAndFonts() {
einkDisplay.begin();
Serial.printf("[%lu] [ ] Display initialized\n", millis());
renderer.insertFont(BOOKERLY_10_FONT_ID, bookerly10FontFamily);
renderer.insertFont(BOOKERLY_12_FONT_ID, bookerly12FontFamily);
renderer.insertFont(BOOKERLY_14_FONT_ID, bookerly14FontFamily);
renderer.insertFont(BOOKERLY_16_FONT_ID, bookerly16FontFamily);
renderer.insertFont(BOOKERLY_18_FONT_ID, bookerly18FontFamily);
renderer.insertFont(NOTOSANS_10_FONT_ID, notosans10FontFamily);
renderer.insertFont(NOTOSANS_12_FONT_ID, notosans12FontFamily);
renderer.insertFont(NOTOSANS_14_FONT_ID, notosans14FontFamily);
renderer.insertFont(NOTOSANS_16_FONT_ID, notosans16FontFamily);
renderer.insertFont(NOTOSANS_18_FONT_ID, notosans18FontFamily);
renderer.insertFont(OPENDYSLEXIC_7_FONT_ID, opendyslexic7FontFamily);
renderer.insertFont(OPENDYSLEXIC_8_FONT_ID, opendyslexic8FontFamily);
renderer.insertFont(OPENDYSLEXIC_10_FONT_ID, opendyslexic10FontFamily);
renderer.insertFont(OPENDYSLEXIC_12_FONT_ID, opendyslexic12FontFamily);