diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd8ece62..cbb0b78b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -423,6 +423,7 @@ list(APPEND SOURCE_FILES displayapp/screens/WatchFaceAnalog.cpp displayapp/screens/WatchFaceDigital.cpp displayapp/screens/WatchFaceInfineat.cpp + displayapp/screens/WatchFaceLCARS.cpp displayapp/screens/WatchFaceTerminal.cpp displayapp/screens/WatchFacePineTimeStyle.cpp displayapp/screens/WatchFaceCasioStyleG7710.cpp diff --git a/src/displayapp/UserApps.h b/src/displayapp/UserApps.h index 67bbfa7d..006cbdcb 100644 --- a/src/displayapp/UserApps.h +++ b/src/displayapp/UserApps.h @@ -12,6 +12,7 @@ #include "displayapp/screens/WatchFaceAnalog.h" #include "displayapp/screens/WatchFaceCasioStyleG7710.h" #include "displayapp/screens/WatchFaceInfineat.h" +#include "displayapp/screens/WatchFaceLCARS.h" #include "displayapp/screens/WatchFacePineTimeStyle.h" #include "displayapp/screens/WatchFaceTerminal.h" diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in index 2104a267..03685c5f 100644 --- a/src/displayapp/apps/Apps.h.in +++ b/src/displayapp/apps/Apps.h.in @@ -51,6 +51,7 @@ namespace Pinetime { PineTimeStyle, Terminal, Infineat, + LCARS, CasioStyleG7710, }; diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index d7858760..e5a803e4 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -26,6 +26,7 @@ else() set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PineTimeStyle") set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal") set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::LCARS") set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710") set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware") endif() diff --git a/src/displayapp/screens/WatchFaceLCARS.cpp b/src/displayapp/screens/WatchFaceLCARS.cpp new file mode 100644 index 00000000..f5857fbb --- /dev/null +++ b/src/displayapp/screens/WatchFaceLCARS.cpp @@ -0,0 +1,345 @@ +#include "displayapp/screens/WatchFaceLCARS.h" + +#include +#include +#include "displayapp/screens/Symbols.h" +#include "displayapp/screens/BleIcon.h" +#include "components/settings/Settings.h" +#include "components/battery/BatteryController.h" +#include "components/heartrate/HeartRateController.h" +#include "components/ble/BleController.h" +#include "components/ble/NotificationManager.h" +#include "components/motion/MotionController.h" + +using namespace Pinetime::Applications::Screens; + +namespace { + void set_label_text_from_uint(lv_obj_t* label, uint8_t number) { + std::string number_as_string = std::to_string(number); + char* number_as_char = new char[number_as_string.length() +1]; + std::strcpy(number_as_char, number_as_string.c_str()); + lv_label_set_text_static(label, number_as_char); + } + void set_label_color(lv_obj_t* label, lv_color_t color) { + lv_obj_set_style_local_text_color(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color); + } + lv_obj_t* label_make(lv_obj_t* container, uint8_t position_x, uint8_t position_y, lv_color_t color, uint8_t align, const char* text) { + lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_text_color(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color); + lv_label_set_text_static(label, text); + lv_obj_align(label, container, align, position_x, position_y); + return label; + } + lv_obj_t* label_make_with_font(lv_obj_t* container, uint8_t position_x, uint8_t position_y, lv_color_t color, lv_font_t* font, uint8_t align, const char* text) { + lv_obj_t* label = label_make(container, position_x, position_y, color, align, text); + lv_obj_set_style_local_text_font(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font); + lv_obj_realign(label); + return label; + } + lv_obj_t* label_container_make(lv_obj_t* parent, uint8_t position_x, uint8_t position_y, uint8_t size_x, uint8_t size_y, uint8_t align) { + lv_obj_t* container = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_bg_opa(container, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); + lv_obj_set_size(container, size_x, size_y); + lv_obj_align(container, parent, align, position_x, position_y); + return container; + } +} + +WatchFaceLCARS::WatchFaceLCARS(Controllers::DateTime& dateTimeController, + const Controllers::Battery& batteryController, + const Controllers::Ble& bleController, + Controllers::NotificationManager& notificationManager, + Controllers::Settings& settingsController, + Controllers::MotionController& motionController, + Controllers::HeartRateController& heartRateController, + Controllers::FS& filesystem) + : currentDateTime {{}}, + currentNanoSeconds {{}}, + dateTimeController {dateTimeController}, + batteryController {batteryController}, + bleController {bleController}, + notificationManager {notificationManager}, + settingsController {settingsController}, + motionController {motionController}, + heartRateController {heartRateController} { + + // Fonts + lfs_file f = {}; + + if (filesystem.FileOpen(&f, "/fonts/antonio_78.bin", LFS_O_RDONLY) >= 0) { + filesystem.FileClose(&f); + font_antonio_78 = lv_font_load("F:/fonts/antonio_78.bin"); + } + if (filesystem.FileOpen(&f, "/fonts/antonio_33.bin", LFS_O_RDONLY) >= 0) { + filesystem.FileClose(&f); + font_antonio_33 = lv_font_load("F:/fonts/antonio_33.bin"); + } + if (filesystem.FileOpen(&f, "/fonts/antonio_21.bin", LFS_O_RDONLY) >= 0) { + filesystem.FileClose(&f); + font_antonio_21 = lv_font_load("F:/fonts/antonio_21.bin"); + } + if (filesystem.FileOpen(&f, "/fonts/antonio_13.bin", LFS_O_RDONLY) >= 0) { + filesystem.FileClose(&f); + font_antonio_13 = lv_font_load("F:/fonts/antonio_13.bin"); + } + + // Background + background = lv_img_create(lv_scr_act(), nullptr); + lv_img_set_src(background, "F:/images/LCARS.bin"); + lv_obj_set_pos(background, 0, 0); + + // System + system_container = label_container_make(lv_scr_act(), 0, 5, 170, 20, LV_ALIGN_IN_TOP_RIGHT); + lv_obj_align(system_container, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 5); // TODO: Find out why this align is necessary + labelBattery = label_make_with_font(system_container, 0, 0, grayColor, font_antonio_21, LV_ALIGN_IN_TOP_RIGHT, "0 %"); + bleIcon = label_make(labelBattery, -5, 0, orangeColor, LV_ALIGN_OUT_LEFT_MID, Symbols::bluetooth); + lv_obj_align(bleIcon, labelBattery, LV_ALIGN_OUT_LEFT_MID, -5, 0); // TODO: Find out why this align is necessary + + // Date + dateContainer = label_container_make(lv_scr_act(), 65, 50, 175, 20, LV_ALIGN_IN_TOP_LEFT); + labelDate = label_make_with_font(dateContainer, 0, 0, orangeColor, font_antonio_21, LV_ALIGN_IN_LEFT_MID, "12024 MON 01 MAR"); + labelTimeAmPm = label_make_with_font(dateContainer, 0, 0, orangeColor, font_antonio_21, LV_ALIGN_IN_RIGHT_MID, ""); + + // Seconds Labels + label_seconds_container = label_container_make(lv_scr_act(), 65, 150, 90, 15, LV_ALIGN_IN_TOP_LEFT); + label_tens_container = label_container_make(label_seconds_container, 0, 0, 90, 15, LV_ALIGN_IN_TOP_LEFT); + for (int i = 0; i < 6; ++i) { + label_tens[i] = label_make_with_font(label_tens_container, 10 * i, 0, grayColor, font_antonio_13, LV_ALIGN_IN_LEFT_MID, ""); + set_label_text_from_uint(label_tens[i], i); + } + label_ones_container = label_container_make(label_seconds_container, 0, 15, 90, 15, LV_ALIGN_IN_TOP_LEFT); + for (int i = 0; i < 10; ++i) { + label_ones[i] = label_make_with_font(label_ones_container, 10 * i, 0, grayColor, font_antonio_13, LV_ALIGN_IN_LEFT_MID, ""); + set_label_text_from_uint(label_ones[i], i); + } + + // Time + timeContainer = label_container_make(lv_scr_act(), 65, 76, 170, 60, LV_ALIGN_IN_TOP_LEFT); + labelTime = label_make_with_font(timeContainer, 0, 0, orangeColor, font_antonio_78, LV_ALIGN_IN_TOP_LEFT, "00:00"); + + // WK + label_week = label_make_with_font(lv_scr_act(), -5, 150, orangeColor, font_antonio_33, LV_ALIGN_IN_TOP_RIGHT, "WK00"); + lv_obj_align(label_week, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -5, 150); // TODO: Find out why this align is necessary + + // Sensors + sensors_container = label_container_make(lv_scr_act(), 0, 0, 130, 50, LV_ALIGN_IN_BOTTOM_RIGHT); + lv_obj_align(sensors_container, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); // TODO: Find out why this align is necessary + stepValue = label_make_with_font(sensors_container, -5, 0, orangeColor, font_antonio_21, LV_ALIGN_IN_BOTTOM_RIGHT, "0"); + lv_obj_align(stepValue, sensors_container, LV_ALIGN_IN_BOTTOM_RIGHT, -5, 0); // TODO: Find out why this align is necessary + stepIcon = label_make(stepValue, -5, 0, orangeColor, LV_ALIGN_OUT_LEFT_MID, Symbols::shoe); + lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0); // TODO: Find out why this align is necessary + heartbeatValue = label_make_with_font(sensors_container, -5, -25, orangeColor, font_antonio_21, LV_ALIGN_IN_BOTTOM_RIGHT, "0"); + lv_obj_align(heartbeatValue, sensors_container, LV_ALIGN_IN_BOTTOM_RIGHT, -5, -25); // TODO: Find out why this align is necessary + heartbeatIcon = label_make(stepValue, -25, 0, orangeColor, LV_ALIGN_OUT_LEFT_MID, ""); + lv_obj_align(heartbeatIcon, heartbeatValue, LV_ALIGN_IN_BOTTOM_LEFT, -25, 0); // TODO: Find out why this align is necessary + + // Tasks + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); + Refresh(); +} + +WatchFaceLCARS::~WatchFaceLCARS() { + // Tasks + lv_task_del(taskRefresh); + + // Fonts + if (font_antonio_78 != nullptr) { + lv_font_free(font_antonio_78); + } + if (font_antonio_33 != nullptr) { + lv_font_free(font_antonio_33); + } + if (font_antonio_21 != nullptr) { + lv_font_free(font_antonio_21); + } + if (font_antonio_13 != nullptr) { + lv_font_free(font_antonio_13); + } + + // Objects + lv_obj_clean(lv_scr_act()); +} + +void WatchFaceLCARS::Refresh() { + currentNanoSeconds = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); + if (currentNanoSeconds.IsUpdated()) { + UpdateSeconds(); + UpdateStepCount(); + UpdateBatteryPercent(); + UpdateBLE(); + UpdateHeartRate(); + currentDateTime = std::chrono::time_point_cast(currentNanoSeconds.Get()); + if (currentDateTime.IsUpdated()) { + UpdateTime(); + currentDate = std::chrono::time_point_cast(currentDateTime.Get()); + if (currentDate.IsUpdated()) { + UpdateStardate(); + UpdateWK(); + } + } + } +} + +void WatchFaceLCARS::UpdateHeartRate() { + heartbeat = heartRateController.HeartRate(); + heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped; + if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) { + if (heartbeat.Get() > 120) { + set_label_color(heartbeatValue, redColor); + set_label_color(heartbeatIcon, redColor); + } else { + set_label_color(heartbeatValue, orangeColor); + set_label_color(heartbeatIcon, orangeColor); + } + if (heartbeatRunning.Get()) { + lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get()); + lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat); + } else { + lv_label_set_text_static(heartbeatValue, ""); + lv_label_set_text_static(heartbeatIcon, ""); + } + lv_obj_realign(heartbeatValue); + lv_obj_realign(heartbeatIcon); + } +} + +void WatchFaceLCARS::UpdateTime() { + uint8_t hour = dateTimeController.Hours(); + uint8_t minute = dateTimeController.Minutes(); + + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + char ampmChar[3] = "AM"; + if (hour == 0) { + hour = 12; + } else if (hour == 12) { + ampmChar[0] = 'P'; + } else if (hour > 12) { + hour = hour - 12; + ampmChar[0] = 'P'; + } + lv_label_set_text(labelTimeAmPm, ampmChar); + weekNumberFormat = "%V"; + } else { + weekNumberFormat = "%U"; + } + lv_label_set_text_fmt(labelTime, "%2d:%02d", hour, minute); + + if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { + lv_obj_realign(labelTimeAmPm); + lv_obj_realign(labelTime); + } +} + +void WatchFaceLCARS::UpdateSeconds() { + uint8_t second = dateTimeController.Seconds(); + if (last_second != second) { + last_second = second; + ResetSecondsDigits(); + set_label_color(label_tens[second / 10], orangeColor); + set_label_color(label_ones[second % 10], orangeColor); + } +} + +void WatchFaceLCARS::UpdateWK() { + time_t ttTime = std::chrono::system_clock::to_time_t(std::chrono::time_point_cast(currentDate.Get())); + tm* tmTime = std::localtime(&ttTime); + char buffer[8]; + strftime(buffer, 8, weekNumberFormat, tmTime); + uint8_t weekNumber = atoi(buffer); + lv_label_set_text_fmt(label_week, "WK%02d", weekNumber); + lv_obj_realign(label_week); +} + +void WatchFaceLCARS::UpdateStardate() { + lv_label_set_text_fmt( + labelDate, + "1%d %s %d %s", + dateTimeController.Year(), + dateTimeController.DayOfWeekShortToString(), + dateTimeController.Day(), + dateTimeController.MonthShortToString() + ); + lv_obj_realign(labelDate); +} + +void WatchFaceLCARS::UpdateBatteryPercent() { + batteryPercentRemaining = batteryController.PercentRemaining(); + isCharging = batteryController.IsCharging(); + if (batteryController.IsCharging() ) { // Charging battery animation + chargingBatteryPercent += 1; + if (chargingBatteryPercent > 100) { + chargingBatteryPercent = batteryPercentRemaining.Get(); + } + if (chargingBatteryPercent <= 100 && ((chargingBatteryPercent % 47) == 0)) { + SetBatteryLevel(batteryPercentRemaining.Get(), orangeColor); + } + if ((chargingBatteryPercent % 97) == 0) { + SetBatteryLevel(batteryPercentRemaining.Get(), grayColor); + } + } else if (isCharging.IsUpdated() || batteryPercentRemaining.IsUpdated()) { + chargingBatteryPercent = batteryPercentRemaining.Get(); + if (chargingBatteryPercent <= 20) { + SetBatteryLevel(chargingBatteryPercent, redColor); + } else if (chargingBatteryPercent > 99) { + SetBatteryLevel(chargingBatteryPercent, orangeColor); + } else { + SetBatteryLevel(chargingBatteryPercent, grayColor); + } + } +} + +void WatchFaceLCARS::UpdateBLE() { + bleState = bleController.IsConnected(); + bleRadioEnabled = bleController.IsRadioEnabled(); + if (bleState.IsUpdated()) { + lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get())); + lv_obj_realign(bleIcon); + } +} + +void WatchFaceLCARS::UpdateStepCount() { + stepCount = motionController.NbSteps(); + if (stepCount.IsUpdated()) { + lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get()); + lv_obj_realign(stepValue); + lv_obj_realign(stepIcon); + } +} + +void WatchFaceLCARS::ResetSecondsDigits() { + for (int i = 0; i < 6; ++i) { + set_label_color(label_tens[i], grayColor); + } + for (int i = 0; i < 10; ++i) { + set_label_color(label_ones[i], grayColor); + } +} + +void WatchFaceLCARS::SetBatteryLevel(uint8_t batteryPercent, const lv_color_t& color) { + lv_label_set_text_fmt(labelBattery, "%lu%%", batteryPercent); + set_label_color(labelBattery, color); + lv_obj_realign(labelBattery); + lv_obj_realign(bleIcon); +} + +bool WatchFaceLCARS::IsAvailable(Pinetime::Controllers::FS& filesystem) { + lfs_file file = {}; + + if (filesystem.FileOpen(&file, "/fonts/antonio_78.bin", LFS_O_RDONLY) < 0) { + return false; + } + filesystem.FileClose(&file); + if (filesystem.FileOpen(&file, "/fonts/antonio_33.bin", LFS_O_RDONLY) < 0) { + return false; + } + filesystem.FileClose(&file); + if (filesystem.FileOpen(&file, "/fonts/antonio_21.bin", LFS_O_RDONLY) < 0) { + return false; + } + filesystem.FileClose(&file); + if (filesystem.FileOpen(&file, "/fonts/antonio_13.bin", LFS_O_RDONLY) < 0) { + return false; + } + filesystem.FileClose(&file); + return true; +} diff --git a/src/displayapp/screens/WatchFaceLCARS.h b/src/displayapp/screens/WatchFaceLCARS.h new file mode 100644 index 00000000..d28a391c --- /dev/null +++ b/src/displayapp/screens/WatchFaceLCARS.h @@ -0,0 +1,138 @@ +#pragma once + +#include +#include +#include +#include +#include +#include "displayapp/screens/Screen.h" +#include "components/datetime/DateTimeController.h" +#include "utility/DirtyValue.h" +#include "displayapp/apps/Apps.h" + +namespace Pinetime { + namespace Controllers { + class Settings; + class Battery; + class Ble; + class NotificationManager; + class MotionController; + } + + namespace Applications { + namespace Screens { + + class WatchFaceLCARS : public Screen { + public: + WatchFaceLCARS(Controllers::DateTime& dateTimeController, + const Controllers::Battery& batteryController, + const Controllers::Ble& bleController, + Controllers::NotificationManager& notificationManager, + Controllers::Settings& settingsController, + Controllers::MotionController& motionController, + Controllers::HeartRateController& heartRateController, + Controllers::FS& fs); + + ~WatchFaceLCARS() override; + + void Refresh() override; + + static bool IsAvailable(Pinetime::Controllers::FS& filesystem); + + private: + uint32_t savedTick = 0; + uint8_t chargingBatteryPercent = 101; // not a mistake ;) + + uint8_t last_second = 60; + + const char* weekNumberFormat = "%V"; + + static constexpr lv_color_t grayColor = LV_COLOR_MAKE(0x99, 0x99, 0x99); + static constexpr lv_color_t orangeColor = LV_COLOR_MAKE(0xFF, 0x99, 0x33); + static constexpr lv_color_t redColor = LV_COLOR_MAKE(0xDD, 0x44, 0x44); + + Utility::DirtyValue batteryPercentRemaining {}; + Utility::DirtyValue isCharging {}; + Utility::DirtyValue bleState {}; + Utility::DirtyValue bleRadioEnabled {}; + Utility::DirtyValue> currentDateTime {}; + Utility::DirtyValue> currentNanoSeconds {}; + Utility::DirtyValue stepCount {}; + Utility::DirtyValue heartbeat {}; + Utility::DirtyValue heartbeatRunning {}; + Utility::DirtyValue notificationState {}; + using days = std::chrono::duration>; // TODO: days is standard in c++20 + Utility::DirtyValue> currentDate; + + lv_obj_t* background; + + lv_obj_t* timeContainer; + lv_obj_t* labelTime; + lv_obj_t* labelTimeAmPm; + lv_obj_t* label_week; + lv_obj_t* label_seconds_container; + lv_obj_t* label_tens_container; + lv_obj_t* label_ones_container; + lv_obj_t* label_tens[6]; + lv_obj_t* label_ones[10]; + lv_obj_t* dateContainer; + lv_obj_t* labelDate; + lv_obj_t* labelBattery; + lv_obj_t* system_container; + lv_obj_t* sensors_container; + lv_obj_t* bleIcon; + lv_obj_t* stepIcon; + lv_obj_t* stepValue; + lv_obj_t* heartbeatValue; + lv_obj_t* heartbeatIcon; + lv_obj_t* notificationIcon; + + Controllers::DateTime& dateTimeController; + const Controllers::Battery& batteryController; + const Controllers::Ble& bleController; + Controllers::NotificationManager& notificationManager; + Controllers::Settings& settingsController; + Controllers::MotionController& motionController; + Controllers::HeartRateController& heartRateController; + + void SetBatteryLevel(uint8_t batteryPercent, const lv_color_t& color); + void ResetSecondsDigits(); + void UpdateStepCount(); + void UpdateBLE(); + void UpdateBatteryPercent(); + void UpdateStardate(); + void UpdateWK(); + void UpdateSeconds(); + void UpdateTime(); + void UpdateHeartRate(); + + lv_task_t* taskRefresh; + lv_font_t* font_antonio_78 = nullptr; + lv_font_t* font_antonio_33 = nullptr; + lv_font_t* font_antonio_21 = nullptr; + lv_font_t* font_antonio_13 = nullptr; + }; + } + + template <> + struct WatchFaceTraits { + static constexpr WatchFace watchFace = WatchFace::LCARS; + static constexpr const char* name = "LCARS face"; + + static Screens::Screen* Create(AppControllers& controllers) { + return new Screens::WatchFaceLCARS(controllers.dateTimeController, + controllers.batteryController, + controllers.bleController, + controllers.notificationManager, + controllers.settingsController, + controllers.motionController, + controllers.heartRateController, + controllers.filesystem); + }; + + static bool IsAvailable(Pinetime::Controllers::FS& filesystem) { + return Screens::WatchFaceLCARS::IsAvailable(filesystem); + } + }; + } +} diff --git a/src/displayapp/screens/settings/SettingWatchFace.h b/src/displayapp/screens/settings/SettingWatchFace.h index 4c75b0ab..7cda41b1 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.h +++ b/src/displayapp/screens/settings/SettingWatchFace.h @@ -10,6 +10,7 @@ #include "displayapp/screens/Symbols.h" #include "displayapp/screens/CheckboxList.h" #include "displayapp/screens/WatchFaceInfineat.h" +#include "displayapp/screens/WatchFaceLCARS.h" #include "displayapp/screens/WatchFaceCasioStyleG7710.h" namespace Pinetime { diff --git a/src/resources/fonts.json b/src/resources/fonts.json index c4a63349..1d4e1ffe 100644 --- a/src/resources/fonts.json +++ b/src/resources/fonts.json @@ -58,5 +58,53 @@ "size": 115, "format": "bin", "target_path": "/fonts/" + }, + "antonio_78" : { + "sources": [ + { + "file": "fonts/antonio.ttf", + "symbols": "0123456789:" + } + ], + "bpp": 1, + "size": 78, + "format": "bin", + "target_path": "/fonts/" + }, + "antonio_33" : { + "sources": [ + { + "file": "fonts/antonio.ttf", + "symbols": "0123456789WK" + } + ], + "bpp": 1, + "size": 33, + "format": "bin", + "target_path": "/fonts/" + }, + "antonio_21" : { + "sources": [ + { + "file": "fonts/antonio.ttf", + "symbols": "0123456789:APMONTUEWDHFRISATJBYLGKVZ% " + } + ], + "bpp": 1, + "size": 21, + "format": "bin", + "target_path": "/fonts/" + }, + "antonio_13" : { + "sources": [ + { + "file": "fonts/antonio.ttf", + "symbols": "0123456789 " + } + ], + "bpp": 1, + "size": 13, + "format": "bin", + "target_path": "/fonts/" } } diff --git a/src/resources/fonts/antonio.license b/src/resources/fonts/antonio.license new file mode 100644 index 00000000..a4b39779 --- /dev/null +++ b/src/resources/fonts/antonio.license @@ -0,0 +1,48 @@ + +SIL Open Font License v1.10 + +This license can also be found at this permalink: https://www.fontsquirrel.com/license/antonio + +Copyright (c) 2011-12, vernon adams (vern@newtypography.co.uk), with Reserved Font Names ‘Antonio’ + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + +—————————————————————————————- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +—————————————————————————————- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. + +DEFINITIONS +“Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. + +“Reserved Font Name” refers to any names specified as such after the copyright statement(s). + +“Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s). + +“Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. + +“Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. + +5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/resources/fonts/antonio.ttf b/src/resources/fonts/antonio.ttf new file mode 100644 index 00000000..27615c33 Binary files /dev/null and b/src/resources/fonts/antonio.ttf differ diff --git a/src/resources/images.json b/src/resources/images.json index e4247188..0dde48a5 100644 --- a/src/resources/images.json +++ b/src/resources/images.json @@ -19,5 +19,12 @@ "output_format": "bin", "binary_format": "ARGB8565_RBSWAP", "target_path": "/images/" + }, + "LCARS" : { + "sources": "images/LCARS.png", + "color_format": "CF_TRUE_COLOR_ALPHA", + "output_format": "bin", + "binary_format": "ARGB8565_RBSWAP", + "target_path": "/images/" } } diff --git a/src/resources/images/LCARS.png b/src/resources/images/LCARS.png new file mode 100644 index 00000000..154ec2a1 Binary files /dev/null and b/src/resources/images/LCARS.png differ diff --git a/src/resources/images/LCARS.svg b/src/resources/images/LCARS.svg new file mode 100644 index 00000000..dff22dcd --- /dev/null +++ b/src/resources/images/LCARS.svg @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Stardate + Time + Sensors + Vitals + Movement + System + + +