Smaller fonts
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, {}},
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
|
||||
21
src/main.cpp
21
src/main.cpp
@@ -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(¬osans_10_regular);
|
||||
EpdFont notosans10BoldFont(¬osans_10_bold);
|
||||
EpdFont notosans10ItalicFont(¬osans_10_italic);
|
||||
EpdFont notosans10BoldItalicFont(¬osans_10_bolditalic);
|
||||
EpdFontFamily notosans10FontFamily(¬osans10RegularFont, ¬osans10BoldFont, ¬osans10ItalicFont,
|
||||
¬osans10BoldItalicFont);
|
||||
EpdFont notosans12RegularFont(¬osans_12_regular);
|
||||
EpdFont notosans12BoldFont(¬osans_12_bold);
|
||||
EpdFont notosans12ItalicFont(¬osans_12_italic);
|
||||
@@ -90,6 +102,12 @@ EpdFont notosans18BoldItalicFont(¬osans_18_bolditalic);
|
||||
EpdFontFamily notosans18FontFamily(¬osans18RegularFont, ¬osans18BoldFont, ¬osans18ItalicFont,
|
||||
¬osans18BoldItalicFont);
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user