From 120c5502fd5923442c25390c67c4efb1b11139f0 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 24 May 2026 20:58:52 +0200 Subject: [PATCH] feat(vector-text): afegeix el glyph / al charset El progres "i/n" del modal de redefinicio (ex. 1/4) sortia com a "14" perque VectorText no tenia shape per a la barra i emetia un warning. Afegim font/char_slash.shp (diagonal de baix-esquerra a dalt-dreta dins de la caixa 20x40) i el registrem al loader i al getShapeFilename. Co-Authored-By: Claude Opus 4.7 (1M context) --- data/shapes/font/char_slash.shp | 9 +++++++++ source/core/graphics/vector_text.cpp | 4 +++- source/core/graphics/vector_text.hpp | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 data/shapes/font/char_slash.shp diff --git a/data/shapes/font/char_slash.shp b/data/shapes/font/char_slash.shp new file mode 100644 index 0000000..399fcc7 --- /dev/null +++ b/data/shapes/font/char_slash.shp @@ -0,0 +1,9 @@ +# char_slash.shp - Símbol / (barra) +# Dimensions: 20×40 (blocky display) + +name: char_slash +scale: 1.0 +center: 10, 20 + +# Línia diagonal de baix-esquerra a dalt-dreta +line: 4,36 16,4 diff --git a/source/core/graphics/vector_text.cpp b/source/core/graphics/vector_text.cpp index 2e30810..fec3639 100644 --- a/source/core/graphics/vector_text.cpp +++ b/source/core/graphics/vector_text.cpp @@ -47,7 +47,7 @@ namespace Graphics { } // Cargar símbolos - const std::string SYMBOLS[] = {".", ",", "-", ":", "!", "?"}; + const std::string SYMBOLS[] = {".", ",", "-", ":", "!", "?", "/"}; for (const auto& sym : SYMBOLS) { char c = sym[0]; std::string filename = getShapeFilename(c); @@ -164,6 +164,8 @@ namespace Graphics { return "font/char_exclamation.shp"; case '?': return "font/char_question.shp"; + case '/': + return "font/char_slash.shp"; case ' ': return ""; // Espai es maneja sin load shape diff --git a/source/core/graphics/vector_text.hpp b/source/core/graphics/vector_text.hpp index 864390e..4978c74 100644 --- a/source/core/graphics/vector_text.hpp +++ b/source/core/graphics/vector_text.hpp @@ -21,7 +21,7 @@ namespace Graphics { // Renderizar string completo // - text: cadena a renderizar (soporta: A-Z, a-z, 0-9, '.', ',', '-', ':', - // '!', '?', ' ') + // '!', '?', '/', ' ') // - position: posición inicial (esquina superior izquierda) // - scale: factor de scale (1.0 = 20×40 px por carácter) // - spacing: espacio entre caracteres en píxeles (a scale 1.0)