mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 23:27:38 +03:00
Polishing merge commit for custom fonts
This commit is contained in:
parent
602ed7daaf
commit
3a7db1ac00
@ -110,7 +110,7 @@ void MyLibraryActivity::loadFiles() {
|
|||||||
char name[500];
|
char name[500];
|
||||||
for (auto file = root.openNextFile(); file; file = root.openNextFile()) {
|
for (auto file = root.openNextFile(); file; file = root.openNextFile()) {
|
||||||
file.getName(name, sizeof(name));
|
file.getName(name, sizeof(name));
|
||||||
if (name[0] == '.' || strcmp(name, "System Volume Information") == 0) {
|
if (name[0] == '.' || strcmp(name, "System Volume Information") == 0 || strcmp(name, "fonts")) {
|
||||||
file.close();
|
file.close();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#include "KOReaderSettingsActivity.h"
|
#include "KOReaderSettingsActivity.h"
|
||||||
#include "MappedInputManager.h"
|
#include "MappedInputManager.h"
|
||||||
#include "OtaUpdateActivity.h"
|
#include "OtaUpdateActivity.h"
|
||||||
|
#include "FontSelectionActivity.h"
|
||||||
#include "fontIds.h"
|
#include "fontIds.h"
|
||||||
|
|
||||||
void CategorySettingsActivity::taskTrampoline(void* param) {
|
void CategorySettingsActivity::taskTrampoline(void* param) {
|
||||||
@ -127,6 +128,14 @@ void CategorySettingsActivity::toggleCurrentSetting() {
|
|||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
}));
|
}));
|
||||||
xSemaphoreGive(renderingMutex);
|
xSemaphoreGive(renderingMutex);
|
||||||
|
} else if (strcmp(setting.name, "Set Custom Font Family") == 0) {
|
||||||
|
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||||
|
exitActivity();
|
||||||
|
enterNewActivity(new FontSelectionActivity(renderer, mappedInput, [this] {
|
||||||
|
exitActivity();
|
||||||
|
updateRequired = true;
|
||||||
|
}));
|
||||||
|
xSemaphoreGive(renderingMutex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
@ -176,6 +185,11 @@ void CategorySettingsActivity::render() const {
|
|||||||
valueText = settingsList[i].enumValues[value];
|
valueText = settingsList[i].enumValues[value];
|
||||||
} else if (settingsList[i].type == SettingType::VALUE && settingsList[i].valuePtr != nullptr) {
|
} else if (settingsList[i].type == SettingType::VALUE && settingsList[i].valuePtr != nullptr) {
|
||||||
valueText = std::to_string(SETTINGS.*(settingsList[i].valuePtr));
|
valueText = std::to_string(SETTINGS.*(settingsList[i].valuePtr));
|
||||||
|
} else if (settingsList[i].type == SettingType::ACTION &&
|
||||||
|
strcmp(settingsList[i].name, "Set Custom Font Family") == 0) {
|
||||||
|
if (SETTINGS.fontFamily == CrossPointSettings::FONT_CUSTOM) {
|
||||||
|
valueText = SETTINGS.customFontFamily;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!valueText.empty()) {
|
if (!valueText.empty()) {
|
||||||
const auto width = renderer.getTextWidth(UI_10_FONT_ID, valueText.c_str());
|
const auto width = renderer.getTextWidth(UI_10_FONT_ID, valueText.c_str());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user