Public Access
Add Interstellar and Your Name pages
Interstellar: Gargantua with a time dilation clock (Earth today vs. Miller's planet), TARS with his settings and remarks about the house, the Endurance spinning at a solar-driven RPM while a Ranger docks, and the tesseract's bookshelf with the time in binary dust and the Message's first word in Morse on a watch. Your Name: comet Tiamat splitting over Itomori's lake, and kataware-doki, a countdown to sunset from sun.sun where two silhouettes stand on the crater rim during the twilight hour. HomeData gains sunset, sunrise and sun elevation (with an ISO time parser); wrap() and typed() move to el512_pages.h. Share Tech Mono 22 gets the full Latin set. All pages are in the renderer, checked with normal, busy and empty data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a4ce97d744
commit
f46f7ab6c5
22 files changed
+1159
-110
No files matched your search
@@ -51,38 +51,6 @@ void ripple(EL512Display &it, uint32_t age, uint32_t dur, float amp) {
|
||||
it.shift_rows(y, 1, (int) std::lround(a * std::sin(y * 0.11f + age * 0.025f)));
|
||||
}
|
||||
|
||||
std::vector<std::string> wrap(Display &it, display::BaseFont *font, const std::string &text, int width,
|
||||
size_t max_lines) {
|
||||
std::vector<std::string> lines;
|
||||
std::string line;
|
||||
size_t i = 0;
|
||||
while (i <= text.size()) {
|
||||
size_t j = text.find(' ', i);
|
||||
if (j == std::string::npos)
|
||||
j = text.size();
|
||||
const std::string word = text.substr(i, j - i);
|
||||
const std::string joined = line.empty() ? word : line + " " + word;
|
||||
if (!line.empty() && text_width(it, font, joined.c_str()) > width) {
|
||||
lines.push_back(line);
|
||||
line = word;
|
||||
} else {
|
||||
line = joined;
|
||||
}
|
||||
i = j + 1;
|
||||
}
|
||||
if (!line.empty())
|
||||
lines.push_back(line);
|
||||
if (lines.size() > max_lines) {
|
||||
lines.resize(max_lines);
|
||||
lines.back() += "...";
|
||||
}
|
||||
for (auto &l : lines)
|
||||
l = fit(font, l, width);
|
||||
return lines;
|
||||
}
|
||||
|
||||
std::string typed(const std::string &s, uint32_t t, int cps) { return s.substr(0, std::min<size_t>(s.size(), t * cps / 1000)); }
|
||||
|
||||
std::string watts_text(float w) { return std::isnan(w) ? "--" : watts(w); }
|
||||
std::string temp_text(float v) { return std::isnan(v) ? "--" : str("%.1f C", v); }
|
||||
|
||||
|
||||
Reference in new issue
Block a user