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
@@ -99,40 +99,6 @@ void bar(Display &it, int x, int y, int w, int h, float frac) {
|
||||
it.filled_rectangle(x + 2, y + 2, (int) ((w - 4) * std::clamp(frac, 0.0f, 1.0f)), h - 4);
|
||||
}
|
||||
|
||||
// Greedy word wrap into at most max_lines lines of `width` pixels.
|
||||
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;
|
||||
}
|
||||
|
||||
// The first part of `s` that has been typed at `cps` characters per second.
|
||||
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)); }
|
||||
|
||||
// Dissolve the page in over its first 400 ms.
|
||||
void intro(EL512Display &it, uint32_t t) {
|
||||
if (t < 400)
|
||||
|
||||
Reference in new issue
Block a user