Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions docs/sd-card-fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,35 @@ To convert your own TrueType/OpenType fonts:

| Preset | Coverage |
|--------|----------|
| `ascii` | U+0020-U+007E (Basic Latin) |
| `latin-ext` | European languages (Latin + Extended-A/B) |
| `ascii` | U+0020–U+007E (Basic Latin) |
| `latin1` | U+0080–U+00FF (Latin-1 Supplement) |
| `latin-ext` | European languages (Latin + Extended-A/B + punctuation + ligatures) |
| `greek` | Greek + Extended Greek |
| `cyrillic` | Cyrillic + Supplement |
| `georgian` | Georgian + Georgian Supplement |
| `armenian` | Armenian |
| `ethiopic` | Ethiopic + Extended |
| `vietnamese` | Vietnamese subset (ơ/ư and combining marks) |
| `punctuation` | General punctuation (U+2000–U+206F) |
| `cjk` | CJK Unified Ideographs + Hiragana + Katakana + Fullwidth |
| `hangul` | Korean Hangul syllables |
| `hangul` | Korean Hangul syllables + Jamo + Compatibility Jamo |
| `cherokee` | Cherokee (historic + supplement block) |
| `tifinagh` | Tifinagh |
| `symbols` | Math, currency, arrows, box-drawing, misc symbols, dingbats |
| `reading` | Literary fiction coverage: Latin, Greek, Cyrillic, math/symbol blocks, supplemental punctuation, and CJK quote marks |
| `builtin` | Matches built-in Bookerly coverage exactly |

Combine presets with commas: `--intervals latin-ext,greek,cyrillic`

You can also specify arbitrary Unicode ranges directly:
`--intervals latin-ext,(0x2100-0x214F)`

To list all presets with codepoint counts:

python3 lib/EpdFont/scripts/fontconvert_sdcard.py --list-presets

### Additional options

`--force-autohint` — force FreeType's auto-hinter instead of the font's native hinting (useful when a font's built-in hints produce poor results at small sizes).

Install custom fonts by copying them to the SD card as described above.
16 changes: 16 additions & 0 deletions lib/I18n/translations/swedish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ STR_CAT_DISPLAY: "Skärm"
STR_CAT_READER: "Läsare"
STR_CAT_CONTROLS: "Kontroller"
STR_SLEEP_SCREEN: "Viloskärm"
STR_SEAMLESS_SLEEP: "Sida som viloskärm"
STR_SLEEP_COVER_MODE: "Viloskärmens omslagsläge"
STR_HIDE_BATTERY: "Dölj batteriprocent"
STR_EXTRA_SPACING: "Extra paragrafmellanrum"
Expand Down Expand Up @@ -174,6 +175,21 @@ STR_BATTERY: "Batteri"
STR_XTC_STATUS_BAR: "XTC-statusfält"
STR_BOTTOM: "Botten"
STR_TOP: "Överst"
STR_CLOCK: "Klocka"
STR_CLOCK_UTC_OFFSET: "Klocka UTC-skillnad"
STR_CLOCK_FORMAT: "Klockformat"
STR_CLOCK_FORMAT_24H: "24-timmars"
STR_CLOCK_FORMAT_12H: "12-timmars"
STR_CURRENT_TIME: "Aktuell tid:"
STR_NEXT_FIELD: "Nästa"
STR_CLOCK_SYNC: "Synkronisera klocka"
STR_CLOCK_SYNC_NOW: "Synkronisera klockan nu"
STR_CLOCK_SYNCING: "Synkroniserar från NTP..."
STR_CLOCK_SYNC_OK: "Klockan synkroniserad"
STR_CLOCK_SYNC_FAIL: "Synkronisering misslyckades"
STR_CLOCK_SYNC_NO_WIFI: "WiFi inte ansluten"
STR_CLOCK_SYNC_NO_WIFI_HINT: "Anslut till WiFi först, försök sedan igen."
STR_CLOCK_SYNCED: "Klocka synkroniserad"
STR_UI_THEME: "Användargränssnittstema"
STR_THEME_CLASSIC: "Klassisk"
STR_THEME_LYRA_EXTENDED: "Lyra utökad"
Expand Down
8 changes: 4 additions & 4 deletions lib/Serialization/Serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

namespace serialization {
template <typename T>
static void writePod(std::ostream& os, const T& value) {
void writePod(std::ostream& os, const T& value) {
os.write(reinterpret_cast<const char*>(&value), sizeof(T));
}

template <typename T>
static void writePod(HalFile& file, const T& value) {
void writePod(HalFile& file, const T& value) {
file.write(reinterpret_cast<const uint8_t*>(&value), sizeof(T));
}

template <typename T>
static void readPod(std::istream& is, T& value) {
void readPod(std::istream& is, T& value) {
is.read(reinterpret_cast<char*>(&value), sizeof(T));
}

template <typename T>
static void readPod(HalFile& file, T& value) {
void readPod(HalFile& file, T& value) {
file.read(reinterpret_cast<uint8_t*>(&value), sizeof(T));
}

Expand Down
1 change: 0 additions & 1 deletion lib/hal/HalStorage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define HAL_STORAGE_IMPL
#include "HalStorage.h"

#include <Logging.h>
Expand Down
3 changes: 2 additions & 1 deletion src/CrossPointSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ uint32_t CrossPointSettings::getSleepTimeoutMs() const {
case SLEEP_5_MIN:
return 5UL * 60 * 1000;
case SLEEP_10_MIN:
default:
return 10UL * 60 * 1000;
case SLEEP_15_MIN:
return 15UL * 60 * 1000;
case SLEEP_30_MIN:
return 30UL * 60 * 1000;
default:
return 10UL * 60 * 1000;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/CrossPointSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ class CrossPointSettings {
// Auto-sleep timeout options (in minutes)
enum SLEEP_TIMEOUT {
SLEEP_1_MIN = 0,
SLEEP_5_MIN = 1,
SLEEP_10_MIN = 2,
SLEEP_15_MIN = 3,
SLEEP_30_MIN = 4,
SLEEP_3_MIN = 5,
SLEEP_3_MIN = 1,
SLEEP_5_MIN = 2,
SLEEP_10_MIN = 3,
SLEEP_15_MIN = 4,
SLEEP_30_MIN = 5,
SLEEP_TIMEOUT_COUNT
};

Expand Down
2 changes: 1 addition & 1 deletion src/activities/settings/StatusBarSettingsActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void StatusBarSettingsActivity::render(RenderLock&&) {
title = tr(STR_EXAMPLE_CHAPTER);
}

GUI.drawStatusBar(renderer, 75, 8, 32, title, verticalPreviewPadding);
GUI.drawStatusBar(renderer, 75, 8, 32, title, verticalPreviewPadding, 0, false);

renderer.drawText(UI_10_FONT_ID, metrics.contentSidePadding,
renderer.getScreenHeight() - UITheme::getInstance().getStatusBarHeight() - verticalPreviewPadding -
Expand Down
13 changes: 8 additions & 5 deletions src/components/themes/BaseTheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ void BaseTheme::fillPopupProgress(const GfxRenderer& renderer, const Rect& layou
}

void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, const int currentPage,
const int pageCount, std::string title, const int paddingBottom,
const int textYOffset) const {
const int pageCount, std::string title, const int paddingBottom, const int textYOffset,
const bool fillMargin) const {
auto metrics = UITheme::getInstance().getMetrics();
int orientedMarginTop, orientedMarginRight, orientedMarginBottom, orientedMarginLeft;
renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom,
Expand Down Expand Up @@ -754,7 +754,9 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c

// Draw Progress Bar
if (SETTINGS.statusBarProgressBar != CrossPointSettings::STATUS_BAR_PROGRESS_BAR::HIDE_PROGRESS) {
const int progressBarMaxWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
const int barMarginLeft = fillMargin ? 0 : orientedMarginLeft;
const int barMarginRight = fillMargin ? 0 : orientedMarginRight;
const int progressBarMaxWidth = renderer.getScreenWidth() - barMarginLeft - barMarginRight;
const int progressBarY = renderer.getScreenHeight() - orientedMarginBottom -
((SETTINGS.statusBarProgressBarThickness + 1) * 2) - paddingBottom;
size_t progress;
Expand All @@ -765,8 +767,9 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c
progress = (pageCount > 0) ? (static_cast<float>(currentPage) / pageCount) * 100 : 0;
}
const int barWidth = progressBarMaxWidth * progress / 100;
renderer.fillRect(orientedMarginLeft, progressBarY, barWidth, ((SETTINGS.statusBarProgressBarThickness + 1) * 2),
true);
const int barHeight =
((SETTINGS.statusBarProgressBarThickness + 1) * 2) + (fillMargin ? orientedMarginBottom - 1 : 0);
renderer.fillRect(barMarginLeft, progressBarY, barWidth, barHeight, true);
}

// Draw Battery
Expand Down
3 changes: 2 additions & 1 deletion src/components/themes/BaseTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ class BaseTheme {
virtual Rect drawPopup(const GfxRenderer& renderer, const char* message) const;
virtual void fillPopupProgress(const GfxRenderer& renderer, const Rect& layout, const int progress) const;
void drawStatusBar(GfxRenderer& renderer, const float bookProgress, const int currentPage, const int pageCount,
std::string title, const int paddingBottom = 0, const int textYOffset = 0) const;
std::string title, const int paddingBottom = 0, const int textYOffset = 0,
const bool fillMargin = true) const;
void drawHelpText(const GfxRenderer& renderer, Rect rect, const char* label) const;
virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth, bool cursorMode = false,
int contentStartX = 0, int contentWidth = 0) const;
Expand Down
Loading