diff --git a/ESP32_AP-Flasher/data/content_template.json b/ESP32_AP-Flasher/data/content_template.json
new file mode 100644
index 00000000..c0aa9d5f
--- /dev/null
+++ b/ESP32_AP-Flasher/data/content_template.json
@@ -0,0 +1,129 @@
+{
+ "1": {
+ "0": {
+ "weekday": [ 76, 10, "fonts/calibrib30" ],
+ "month": [ 76, 120, "fonts/calibrib30" ],
+ "day": [ 76, 42, "fonts/calibrib100" ]
+ },
+ "1": {
+ "weekday": [ 148, 10, "fonts/calibrib60" ],
+ "date": [ 148, 73, "fonts/calibrib50" ]
+ },
+ "2": {
+ "weekday": [ 200, 25, "fonts/calibrib60" ],
+ "month": [ 200, 225, "fonts/calibrib60" ],
+ "day": [ 200, 95, "fonts/calibrib150" ]
+ }
+ },
+ "2": {
+ "0": {
+ "fonts": [ "fonts/calibrib120", "fonts/calibrib80", "fonts/calibrib50", "fonts/calibrib50" ],
+ "xy": [ 76, 83 ]
+ },
+ "1": {
+ "fonts": [ "fonts/calibrib150", "fonts/calibrib150", "fonts/calibrib120", "fonts/calibrib100" ],
+ "xy": [ 148, 74 ]
+ },
+ "2": {
+ "fonts": [ "fonts/calibrib150", "fonts/calibrib150", "fonts/calibrib150", "fonts/calibrib120" ],
+ "xy": [ 200, 148 ]
+ }
+ },
+ "4": {
+ "0": {
+ "location": [ 10, 130, 2 ],
+ "wind": [ 140, 10, "fonts/bahnschrift30" ],
+ "temp": [ 10, 10, "fonts/bahnschrift30" ],
+ "icon": [ 33, 33, "fonts/weathericons78" ],
+ "dir": [ 100, -2, "fonts/weathericons30" ],
+ "umbrella": [ 115, 110 ]
+ },
+ "1": {
+ "location": [ 5, 5, "fonts/bahnschrift30" ],
+ "wind": [ 280, 5, "fonts/bahnschrift30" ],
+ "temp": [ 5, 65, "fonts/bahnschrift70" ],
+ "icon": [ 185, 32, "fonts/weathericons70" ],
+ "dir": [ 240, -3, "fonts/weathericons30" ],
+ "umbrella": [ 190, 0 ]
+ },
+ "2": {
+ "location": [ 20, 20, "fonts/calibrib30" ],
+ "wind": [ 290, 83, "fonts/calibrib60" ],
+ "temp": [ 20, 170, "fonts/calibrib150" ],
+ "icon": [ 100, 50, "fonts/weathericons78" ],
+ "dir": [ 220, 50, "fonts/weathericons78" ],
+ "umbrella": [ 330, 10 ]
+ }
+ },
+ "8": {
+ "1": {
+ "location": [ 5, 0, 2 ],
+ "column": [ 5, 59 ],
+ "day": [ 30, 18, "fonts/twcondensed20", 41, 108 ],
+ "icon": [ 12, 58, "fonts/weathericons30" ],
+ "wind": [ 17, 25 ],
+ "line": [ 20, 128 ]
+ },
+ "2": {
+ "location": [ 10, 10, "fonts/calibrib30" ],
+ "column": [ 6, 66 ],
+ "day": [ 33, 60, "fonts/bahnschrift20", 104, 230 ],
+ "rain": [ 34, 260 ],
+ "icon": [ 15, 145, "fonts/weathericons30" ],
+ "wind": [ 17, 90 ],
+ "line": [ 50, 300 ]
+ }
+ },
+ "9": {
+ "1": {
+ "title": [ 5, 3, "fonts/bahnschrift20" ],
+ "items": 8,
+ "line": [ 5, 34, 13 ],
+ "font": "glasstown_nbp_tf"
+ },
+ "2": {
+ "title": [ 10, 10, "fonts/calibrib30" ],
+ "items": 12,
+ "line": [ 10, 60, 20 ],
+ "font": "7x14_tf"
+ }
+ },
+ "10": {
+ "0": {
+ "title": [ 10, 3, 2 ],
+ "pos": [ 76, 20 ]
+ },
+ "1": {
+ "title": [ 10, 5, "fonts/bahnschrift20" ],
+ "pos": [ 149, 25 ]
+ },
+ "2": {
+ "title": [ 10, 10, "fonts/bahnschrift20" ],
+ "pos": [ 200, 30 ]
+ }
+ },
+ "11": {
+ "1": {
+ "title": [ 5, 2, "fonts/bahnschrift20" ],
+ "date": [ 290, 2 ],
+ "items": 7,
+ "red": [ 0, 21, 296, 14 ],
+ "line": [ 5, 32, 15, "t0_14b_tf", 50 ]
+ },
+ "2": {
+ "title": [ 10, 10, "fonts/bahnschrift30" ],
+ "date": [ 390, 10 ],
+ "items": 12,
+ "red": [ 0, 48, 400, 17 ],
+ "line": [ 10, 61, 18, "7x14_tf", 60 ]
+ }
+ },
+ "16": {
+ "1": {
+ "location": [ 5, 5, "fonts/bahnschrift30" ],
+ "title": [ 247, 11, "glasstown_nbp_tf" ],
+ "cols": [ 1, 125, 12 ],
+ "bars": [ 5, 111, 10 ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/ESP32_AP-Flasher/data/fonts/bahnschrift20.vlw b/ESP32_AP-Flasher/data/fonts/bahnschrift20.vlw
index 44aefdc3..d84a7716 100644
Binary files a/ESP32_AP-Flasher/data/fonts/bahnschrift20.vlw and b/ESP32_AP-Flasher/data/fonts/bahnschrift20.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/bahnschrift30.vlw b/ESP32_AP-Flasher/data/fonts/bahnschrift30.vlw
index 091a0d7c..ba0c7b6b 100644
Binary files a/ESP32_AP-Flasher/data/fonts/bahnschrift30.vlw and b/ESP32_AP-Flasher/data/fonts/bahnschrift30.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib100.vlw b/ESP32_AP-Flasher/data/fonts/calibrib100.vlw
index e4c2ce70..f6f008e9 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib100.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib100.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib120.vlw b/ESP32_AP-Flasher/data/fonts/calibrib120.vlw
index 5590633f..8308150e 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib120.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib120.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib150.vlw b/ESP32_AP-Flasher/data/fonts/calibrib150.vlw
index 1539e7ca..050cbd86 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib150.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib150.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib30.vlw b/ESP32_AP-Flasher/data/fonts/calibrib30.vlw
index 87c41c69..cd0a0fe7 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib30.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib30.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib60.vlw b/ESP32_AP-Flasher/data/fonts/calibrib60.vlw
index 04f6e3b1..3f6d44af 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib60.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib60.vlw differ
diff --git a/ESP32_AP-Flasher/data/fonts/calibrib80.vlw b/ESP32_AP-Flasher/data/fonts/calibrib80.vlw
index eb9f8dfe..c78c7915 100644
Binary files a/ESP32_AP-Flasher/data/fonts/calibrib80.vlw and b/ESP32_AP-Flasher/data/fonts/calibrib80.vlw differ
diff --git a/ESP32_AP-Flasher/data/www/content_cards.json b/ESP32_AP-Flasher/data/www/content_cards.json
index bc1c5641..f4a7fb6d 100644
--- a/ESP32_AP-Flasher/data/www/content_cards.json
+++ b/ESP32_AP-Flasher/data/www/content_cards.json
@@ -21,6 +21,16 @@
"name": "TimeToLive",
"desc": "Amount (minutes) that this image will stay valid. The tag might not respond meanwhile",
"type": "int"
+ },
+ {
+ "key": "dither",
+ "name": "Dithering",
+ "desc": "Turn halftone dithering on or off. Turn it on when displaying photos. For texts, you better leave if off",
+ "type": "select",
+ "options": {
+ "0": "off",
+ "1": "on"
+ }
}
]
},
diff --git a/ESP32_AP-Flasher/data/www/index.html b/ESP32_AP-Flasher/data/www/index.html
index 81a7e624..a18eb81f 100644
--- a/ESP32_AP-Flasher/data/www/index.html
+++ b/ESP32_AP-Flasher/data/www/index.html
@@ -105,7 +105,7 @@ Latency will be around 40 seconds.">
alias |
tags |
ch |
- fw ver |
+ AP ver |
diff --git a/ESP32_AP-Flasher/data/www/main.js b/ESP32_AP-Flasher/data/www/main.js
index 8688af1f..b775c95d 100644
--- a/ESP32_AP-Flasher/data/www/main.js
+++ b/ESP32_AP-Flasher/data/www/main.js
@@ -487,6 +487,15 @@ function contentselected() {
input.type = "text";
input.disabled = true;
break;
+ case 'select':
+ input = document.createElement("select");
+ for (const key in element.options) {
+ const optionElement = document.createElement("option");
+ optionElement.value = key;
+ optionElement.text = element.options[key];
+ input.appendChild(optionElement);
+ }
+ break;
}
input.id = 'opt' + element.key;
input.title = element.desc;
diff --git a/ESP32_AP-Flasher/include/contentmanager.h b/ESP32_AP-Flasher/include/contentmanager.h
index c11165a4..af98be72 100644
--- a/ESP32_AP-Flasher/include/contentmanager.h
+++ b/ESP32_AP-Flasher/include/contentmanager.h
@@ -2,6 +2,7 @@
#include
#include
+#include "U8g2_for_TFT_eSPI.h"
#include "makeimage.h"
#include "tag_db.h"
@@ -18,7 +19,7 @@ void contentRunner();
void drawNew(uint8_t mac[8], bool buttonPressed, tagRecord *&taginfo);
bool updateTagImage(String &filename, uint8_t *dst, uint16_t nextCheckin, tagRecord *&taginfo, imgParam &imageParams);
void drawString(TFT_eSprite &spr, String content, uint16_t posx, uint16_t posy, String font, byte align = 0, uint16_t color = TFT_BLACK);
-void initSprite(TFT_eSprite &spr, int w, int h);
+void initSprite(TFT_eSprite &spr, int w, int h, imgParam &imageParams);
void drawDate(String &filename, tagRecord *&taginfo, imgParam &imageParams);
void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord *&taginfo, imgParam &imageParams);
void drawWeather(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams);
@@ -35,4 +36,6 @@ int windSpeedToBeaufort(float windSpeed);
String windDirectionIcon(int degrees);
void getLocation(JsonObject &cfgobj);
void prepareNFCReq(uint8_t* dst, const char* url);
-void prepareLUTreq(uint8_t *dst, String input);
\ No newline at end of file
+void prepareLUTreq(uint8_t *dst, String input);
+void getTemplate(JsonDocument &json, const char *filePath, uint8_t id, uint8_t hwtype);
+void setU8G2Font(const String &title, U8g2_for_TFT_eSPI &u8f);
diff --git a/ESP32_AP-Flasher/include/makeimage.h b/ESP32_AP-Flasher/include/makeimage.h
index 165a2f2e..4f0cf0ce 100644
--- a/ESP32_AP-Flasher/include/makeimage.h
+++ b/ESP32_AP-Flasher/include/makeimage.h
@@ -8,6 +8,7 @@ struct imgParam {
uint8_t dataType;
bool dither;
bool grayLut = false;
+ uint8_t bpp = 8;
char segments[12];
uint16_t symbols;
diff --git a/ESP32_AP-Flasher/src/contentmanager.cpp b/ESP32_AP-Flasher/src/contentmanager.cpp
index 9589340b..9f4d9067 100644
--- a/ESP32_AP-Flasher/src/contentmanager.cpp
+++ b/ESP32_AP-Flasher/src/contentmanager.cpp
@@ -13,8 +13,10 @@
#ifdef CONTENT_RSS
#include
#endif
-#include
#include
+#include
+
+#include