Skip to content

Commit 1c1f0d0

Browse files
committed
change font to Technology-bold-realign
1 parent 178c1fc commit 1c1f0d0

File tree

4 files changed

+77
-59
lines changed

4 files changed

+77
-59
lines changed

src/displayapp/screens/WatchFaceCasioStyleAE21W.cpp

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,19 @@ WatchFaceCasioStyleAE21W::WatchFaceCasioStyleAE21W(Controllers::DateTime& dateTi
379379

380380
lfs_file f = {};
381381

382-
if (filesystem.FileOpen(&f, "/fonts/7segments_20.bin", LFS_O_RDONLY) >= 0) {
382+
if (filesystem.FileOpen(&f, "/fonts/TechnologyBR_20.bin", LFS_O_RDONLY) >= 0) {
383383
filesystem.FileClose(&f);
384-
font_7segments_20 = lv_font_load("F:/fonts/7segments_20.bin");
384+
font_TechnologyBR_20 = lv_font_load("F:/fonts/TechnologyBR_20.bin");
385385
}
386386

387-
if (filesystem.FileOpen(&f, "/fonts/7segments_40.bin", LFS_O_RDONLY) >= 0) {
387+
if (filesystem.FileOpen(&f, "/fonts/TechnologyBR_40.bin", LFS_O_RDONLY) >= 0) {
388388
filesystem.FileClose(&f);
389-
font_7segments_40 = lv_font_load("F:/fonts/7segments_40.bin");
389+
font_TechnologyBR_40 = lv_font_load("F:/fonts/TechnologyBR_40.bin");
390390
}
391391

392-
if (filesystem.FileOpen(&f, "/fonts/7segments_75.bin", LFS_O_RDONLY) >= 0) {
392+
if (filesystem.FileOpen(&f, "/fonts/TechnologyBR_75.bin", LFS_O_RDONLY) >= 0) {
393393
filesystem.FileClose(&f);
394-
font_7segments_75 = lv_font_load("F:/fonts/7segments_75.bin");
394+
font_TechnologyBR_75 = lv_font_load("F:/fonts/TechnologyBR_75.bin");
395395
}
396396

397397
const std::array<lv_color_t, 4>* themeColors = returnThemeColors(static_cast<enum theme>(settingsController.GetCasioStyleAE21WColorIndex()));
@@ -511,31 +511,32 @@ WatchFaceCasioStyleAE21W::WatchFaceCasioStyleAE21W(Controllers::DateTime& dateTi
511511
// Icons and Labels
512512
label_date = lv_label_create(lv_scr_act(), nullptr);
513513
lv_obj_add_style(label_date, LV_OBJ_PART_MAIN, &style_lcd);
514-
lv_obj_set_style_local_text_font(label_date, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_40);
515-
lv_label_set_text_static(label_date, "6-30");
516-
lv_obj_align(label_date, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -30, -78);
514+
lv_obj_set_style_local_text_font(label_date, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_40);
515+
lv_label_set_text_static(label_date, "00-00");
516+
lv_obj_align(label_date, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -9, -78);
517517

518518
label_time_ampm = lv_label_create(lv_scr_act(), nullptr);
519519
lv_obj_add_style(label_time_ampm, LV_OBJ_PART_MAIN, &style_lcd);
520-
lv_obj_set_style_local_text_font(label_time_ampm, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_20);
521-
lv_label_set_text_static(label_time_ampm, "");
520+
lv_label_set_text_static(label_time_ampm, "A");
522521
lv_obj_align(label_time_ampm, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 31, -8);
523522

524523
label_seconds = lv_label_create(lv_scr_act(), nullptr);
525524
lv_obj_add_style(label_seconds, LV_OBJ_PART_MAIN, &style_lcd);
526-
lv_obj_set_style_local_text_font(label_seconds, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_40);
527-
lv_obj_align(label_seconds, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -30, -8);
525+
lv_obj_set_style_local_text_font(label_seconds, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_40);
526+
lv_label_set_text_static(label_seconds, "00");
527+
lv_obj_align(label_seconds, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -9, -8);
528528

529529
label_time = lv_label_create(lv_scr_act(), nullptr);
530530
lv_obj_add_style(label_time, LV_OBJ_PART_MAIN, &style_lcd);
531-
lv_obj_set_style_local_text_font(label_time, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_75);
532-
lv_obj_align(label_time, label_seconds, LV_ALIGN_IN_BOTTOM_RIGHT, -179, 0);
531+
lv_obj_set_style_local_text_font(label_time, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_75);
532+
lv_label_set_text_static(label_time, "00:00");
533+
lv_obj_align(label_time, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -52, -8);
533534

534535
label_day_of_week = lv_label_create(lv_scr_act(), nullptr);
535536
lv_obj_add_style(label_day_of_week, LV_OBJ_PART_MAIN, &style_lcd);
536-
lv_obj_set_style_local_text_font(label_day_of_week, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_20);
537-
lv_label_set_text_static(label_day_of_week, "SUN");
538-
lv_obj_align(label_day_of_week, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -10, -43);
537+
lv_obj_set_style_local_text_font(label_day_of_week, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_20);
538+
lv_label_set_text_static(label_day_of_week, "MON");
539+
lv_obj_align(label_day_of_week, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -10, -46);
539540

540541
label_function = lv_label_create(lv_scr_act(), nullptr);
541542
lv_obj_add_style(label_function, LV_LABEL_PART_MAIN, &style_lcd);
@@ -549,9 +550,9 @@ WatchFaceCasioStyleAE21W::WatchFaceCasioStyleAE21W(Controllers::DateTime& dateTi
549550

550551
stepValue = lv_label_create(lv_scr_act(), nullptr);
551552
lv_obj_add_style(stepValue, LV_OBJ_PART_MAIN, &style_lcd);
552-
lv_obj_set_style_local_text_font(stepValue, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_20);
553-
lv_label_set_text_static(stepValue, "0K");
554-
lv_obj_align(stepValue, nullptr, LV_ALIGN_IN_LEFT_MID, 101, 16);
553+
lv_obj_set_style_local_text_font(stepValue, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_20);
554+
lv_label_set_text_static(stepValue, "00");
555+
lv_obj_align(stepValue, nullptr, LV_ALIGN_IN_LEFT_MID, 98, 16);
555556

556557
heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
557558
lv_obj_add_style(heartbeatIcon, LV_OBJ_PART_MAIN, &style_lcd);
@@ -560,10 +561,10 @@ WatchFaceCasioStyleAE21W::WatchFaceCasioStyleAE21W(Controllers::DateTime& dateTi
560561

561562
heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
562563
lv_obj_add_style(heartbeatValue, LV_OBJ_PART_MAIN, &style_lcd);
563-
lv_obj_set_style_local_text_font(heartbeatValue, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_7segments_20);
564+
lv_obj_set_style_local_text_font(heartbeatValue, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_20);
564565
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
565-
lv_label_set_text_static(heartbeatValue, "");
566-
lv_obj_align(heartbeatValue, nullptr, LV_ALIGN_IN_LEFT_MID, 101, 38);
566+
lv_label_set_text_static(heartbeatValue, "--");
567+
lv_obj_align(heartbeatValue, nullptr, LV_ALIGN_IN_RIGHT_MID, -130, 39);
567568

568569
weatherIcon = lv_label_create(lv_scr_act(), nullptr);
569570
lv_obj_add_style(weatherIcon, LV_LABEL_PART_MAIN, &style_lcd);
@@ -574,9 +575,9 @@ WatchFaceCasioStyleAE21W::WatchFaceCasioStyleAE21W(Controllers::DateTime& dateTi
574575

575576
temperature = lv_label_create(lv_scr_act(), nullptr);
576577
lv_obj_add_style(temperature, LV_LABEL_PART_MAIN, &style_lcd);
577-
lv_obj_set_style_local_text_font(temperature, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_7segments_20);
578-
lv_label_set_text(temperature, "--");
579-
lv_obj_align(temperature, nullptr, LV_ALIGN_IN_RIGHT_MID, -202, 38);
578+
lv_obj_set_style_local_text_font(temperature, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_TechnologyBR_20);
579+
lv_label_set_text(temperature, " 00");
580+
lv_obj_align(temperature, nullptr, LV_ALIGN_IN_RIGHT_MID, -202, 39);
580581

581582
plugIcon = lv_label_create(lv_scr_act(), nullptr);
582583
lv_obj_add_style(plugIcon, LV_OBJ_PART_MAIN, &style_lcd);
@@ -671,17 +672,17 @@ WatchFaceCasioStyleAE21W::~WatchFaceCasioStyleAE21W() {
671672
lv_task_del(taskRefresh);
672673
taskRefresh = nullptr;
673674
}
674-
if (font_7segments_20) {
675-
lv_font_free(font_7segments_20);
676-
font_7segments_20 = nullptr;
675+
if (font_TechnologyBR_20) {
676+
lv_font_free(font_TechnologyBR_20);
677+
font_TechnologyBR_20 = nullptr;
677678
}
678-
if (font_7segments_40) {
679-
lv_font_free(font_7segments_40);
680-
font_7segments_40 = nullptr;
679+
if (font_TechnologyBR_40) {
680+
lv_font_free(font_TechnologyBR_40);
681+
font_TechnologyBR_40 = nullptr;
681682
}
682-
if (font_7segments_75) {
683-
lv_font_free(font_7segments_75);
684-
font_7segments_75 = nullptr;
683+
if (font_TechnologyBR_75) {
684+
lv_font_free(font_TechnologyBR_75);
685+
font_TechnologyBR_75 = nullptr;
685686
}
686687

687688
lv_style_reset(&style_bg);
@@ -761,10 +762,9 @@ void WatchFaceCasioStyleAE21W::Refresh() {
761762
ampmChar[0] = 'P';
762763
}
763764
lv_label_set_text(label_time_ampm, ampmChar);
764-
lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute);
765-
} else {
766-
lv_label_set_text_fmt(label_time, "%02d:%02d", hour, minute);
767765
}
766+
lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute);
767+
768768
// Update G1Clock
769769
auto const angle_min = minute * 6;
770770
minute_point[0] = CoordinateRelocateG1(10, angle_min);
@@ -791,9 +791,11 @@ void WatchFaceCasioStyleAE21W::Refresh() {
791791
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
792792
// 24h mode: ddmmyyyy, first DOW=Monday;
793793
lv_label_set_text_fmt(label_date, "%2d-%2d", day, month);
794+
lv_obj_align(label_date, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -9, -78);
794795
} else {
795796
// 12h mode: mmddyyyy, first DOW=Sunday;
796797
lv_label_set_text_fmt(label_date, "%2d-%2d", month, day);
798+
lv_obj_align(label_date, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -9, -78);
797799
}
798800
lv_label_set_text_fmt(label_day_of_week, "%s", dateTimeController.DayOfWeekShortToString());
799801
}
@@ -803,15 +805,19 @@ void WatchFaceCasioStyleAE21W::Refresh() {
803805
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
804806
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
805807
if (heartbeatRunning.Get()) {
806-
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
808+
if (heartbeat.Get() > 0) {
809+
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
810+
} else {
811+
lv_label_set_text_static(heartbeatValue, "--");
812+
}
807813
} else {
808814
lv_label_set_text_static(heartbeatValue, "OFF");
809815
}
810816
}
811817

812818
stepCount = motionController.NbSteps();
813819
if (stepCount.IsUpdated()) {
814-
lv_label_set_text_fmt(stepValue, "%lu", (stepCount.Get() / 1000));
820+
lv_label_set_text_fmt(stepValue, "%luK", (stepCount.Get() / 1000));
815821
lv_obj_realign(stepValue);
816822
lv_obj_realign(stepIcon);
817823
}
@@ -839,20 +845,21 @@ bool WatchFaceCasioStyleAE21W::IsAvailable(Pinetime::Controllers::FS& filesystem
839845

840846
lfs_file file = {};
841847

842-
if (filesystem.FileOpen(&file, "/fonts/7segments_20.bin", LFS_O_RDONLY) < 0) {
848+
if (filesystem.FileOpen(&file, "/fonts/TechnologyBR_20.bin", LFS_O_RDONLY) < 0) {
843849
return false;
844850
}
845851

846852
filesystem.FileClose(&file);
847-
if (filesystem.FileOpen(&file, "/fonts/7segments_40.bin", LFS_O_RDONLY) < 0) {
853+
if (filesystem.FileOpen(&file, "/fonts/TechnologyBR_40.bin", LFS_O_RDONLY) < 0) {
848854
return false;
849855
}
850856

851857
filesystem.FileClose(&file);
852-
if (filesystem.FileOpen(&file, "/fonts/7segments_75.bin", LFS_O_RDONLY) < 0) {
858+
if (filesystem.FileOpen(&file, "/fonts/TechnologyBR_75.bin", LFS_O_RDONLY) < 0) {
853859
return false;
854860
}
855861

856862
filesystem.FileClose(&file);
863+
857864
return true;
858865
}

src/displayapp/screens/WatchFaceCasioStyleAE21W.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ namespace Pinetime {
138138
void SetBatteryIcon();
139139

140140
lv_task_t* taskRefresh;
141-
lv_font_t* font_7segments_20 = nullptr;
142-
lv_font_t* font_7segments_40 = nullptr;
143-
lv_font_t* font_7segments_75 = nullptr;
141+
lv_font_t* font_TechnologyBR_20 = nullptr;
142+
lv_font_t* font_TechnologyBR_40 = nullptr;
143+
lv_font_t* font_TechnologyBR_75 = nullptr;
144144
};
145145
}
146146

src/resources/fonts.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,43 +35,54 @@
3535
"format": "bin",
3636
"target_path": "/fonts/"
3737
},
38-
"7segments_20" : {
38+
"TechnologyBR_20" : {
3939
"sources": [
4040
{
41-
"file": "fonts/7segment.woff",
42-
"symbols": "0123456789: -MONTUEWEDTHUFRISATSUNW°P"
41+
"file": "fonts/Technology-Bold-Realign.ttf",
42+
"symbols": "0123456789- °MONTUEWDHFRISAK"
4343
}
4444
],
4545
"bpp": 1,
46-
"size": 20,
46+
"size": 24,
4747
"format": "bin",
4848
"target_path": "/fonts/"
4949
},
50-
"7segments_40" : {
50+
"TechnologyBR_40" : {
5151
"sources": [
5252
{
53-
"file": "fonts/7segment.woff",
54-
"symbols": "0123456789: -MONTUEWEDTHUFRISATSUNWK"
53+
"file": "fonts/Technology-Bold-Realign.ttf",
54+
"symbols": "0123456789: -"
5555
}
5656
],
5757
"bpp": 1,
58-
"size": 40,
58+
"size": 44,
5959
"format": "bin",
6060
"target_path": "/fonts/"
6161
},
62-
"7segments_75" : {
62+
"TechnologyBR_75" : {
6363
"sources": [
6464
{
65-
"file": "fonts/7segment.woff",
65+
"file": "fonts/Technology-Bold-Realign.ttf",
6666
"symbols": "0123456789: -"
6767
}
6868
],
6969
"bpp": 1,
70-
"size": 75,
70+
"size": 80,
71+
"format": "bin",
72+
"target_path": "/fonts/"
73+
},
74+
"7segments_40" : {
75+
"sources": [
76+
{
77+
"file": "fonts/7segment.woff",
78+
"symbols": "0123456789: -MONTUEWEDTHUFRISATSUNWK"
79+
}
80+
],
81+
"bpp": 1,
82+
"size": 40,
7183
"format": "bin",
7284
"target_path": "/fonts/"
7385
},
74-
7586
"7segments_115" : {
7687
"sources": [
7788
{
36.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)