feat(menu): primera versió del menú de servei

This commit is contained in:
JailDesigner committed 2026-04-22 18:15:00 +02:00
1 parent e4a8b4cd3e
commit 350625dec0
21 files changed
+1477 -16

No files matched your search

+10
View File
@@ -47,6 +47,14 @@ class Text {
Text(const std::shared_ptr<Surface>& surface, const std::shared_ptr<File>& text_file);
~Text() = default;
// Kerning per defecte de la font (separació entre glifs en píxels, sumat
// a l'amplada natural). Els callers poden passar un kerning explícit a
// write/length, o llegir aquest valor i reenviar-lo; així cada font pot
// tenir un kerning pròpi (p. ex. negatiu per a displays amb sidebearings
// amples) sense obligar els callers a saber-ho.
void setDefaultKerning(int kerning) { default_kerning_ = kerning; }
[[nodiscard]] auto getDefaultKerning() const -> int { return default_kerning_; }
Text(const Text&) = delete;
Text(Text&&) = delete;
auto operator=(const Text&) -> Text& = delete;
@@ -64,6 +72,7 @@ class Text {
[[nodiscard]] auto length(const std::string& text, int kerning = 1) const -> int;
[[nodiscard]] auto lengthMonoDigits(const std::string& text, int digit_cell_w, int kerning = 1) const -> int;
[[nodiscard]] auto getCharacterSize() const -> int { return box_width_; }
[[nodiscard]] auto getLineHeight() const -> int { return box_height_; }
static auto loadTextFile(const std::string& file_path) -> std::shared_ptr<File>;
static auto nextCodepoint(const std::string& s, std::size_t& pos) -> std::uint32_t;
@@ -76,5 +85,6 @@ class Text {
std::unique_ptr<Sprite> sprite_;
int box_width_{0};
int box_height_{0};
int default_kerning_{1};
std::unordered_map<std::uint32_t, Offset> offset_;
};