feat: sostituzione faux-cirillica (homoglyph) sui testi statici

This commit is contained in:
Matteo Benedetto
2026-08-16 17:12:18 +02:00
parent a3f1feaf7e
commit 3a5d24a0a5
6 changed files with 37 additions and 10 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import "fauxcyrillic.js" as Faux
// Selettore a tendina etichettato in stile costruttivista.
@@ -21,7 +22,7 @@ Column {
spacing: 4
Text {
text: comboWrap.label
text: Faux.apply(comboWrap.label)
color: "#f0dfba"
font.family: themeFont.name
font.pixelSize: 12
+2 -1
View File
@@ -1,4 +1,5 @@
import QtQuick 2.15
import "fauxcyrillic.js" as Faux
// Campo di input etichettato in stile costruttivista.
@@ -20,7 +21,7 @@ Column {
spacing: 4
Text {
text: field.label
text: Faux.apply(field.label)
color: "#f0dfba"
font.family: themeFont.name
font.pixelSize: 12
+8 -7
View File
@@ -6,6 +6,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import "fauxcyrillic.js" as Faux
Rectangle {
id: root
@@ -38,7 +39,7 @@ Rectangle {
function tryLogin() {
var username = userModel.count > 0 ? root.selectedUser : userField.text
if (username.length === 0) {
errorText.text = "INSERISCI L'UTENTE"
errorText.text = Faux.apply("INSERISCI L'UTENTE")
shake.start()
return
}
@@ -137,7 +138,7 @@ Rectangle {
Text {
id: dateText
anchors.horizontalCenter: parent.horizontalCenter
text: root.italianDate(new Date())
text: Faux.apply(root.italianDate(new Date()))
color: "#ef6a55"
font.family: themeFont.name
font.pixelSize: Math.max(13, Math.min(root.width * 0.014, 22))
@@ -151,7 +152,7 @@ Rectangle {
running: true
onTriggered: {
clockText.text = Qt.formatTime(new Date(), "HH:mm")
dateText.text = root.italianDate(new Date())
dateText.text = Faux.apply(root.italianDate(new Date()))
}
}
}
@@ -208,7 +209,7 @@ Rectangle {
spacing: 2
Text {
text: "ACCESSO"
text: Faux.apply("ACCESSO")
color: root.cream
font.family: themeFont.name
font.pixelSize: Math.max(20, Math.min(root.width * 0.024, 34))
@@ -217,7 +218,7 @@ Rectangle {
}
Text {
text: "INSERISCI LE CREDENZIALI"
text: Faux.apply("INSERISCI LE CREDENZIALI")
color: "#e85a48"
font.family: themeFont.name
font.pixelSize: Math.max(10, Math.min(root.width * 0.011, 15))
@@ -289,7 +290,7 @@ Rectangle {
Text {
anchors.centerIn: parent
text: "ENTRA"
text: Faux.apply("ENTRA")
color: root.paper
font.bold: true
font.letterSpacing: 3
@@ -392,7 +393,7 @@ Rectangle {
Connections {
target: sddm
function onLoginFailed() {
errorText.text = "ACCESSO NEGATO"
errorText.text = Faux.apply("ACCESSO NEGATO")
passField.text = ""
shake.start()
}
+2 -1
View File
@@ -1,4 +1,5 @@
import QtQuick 2.15
import "fauxcyrillic.js" as Faux
// Pulsante di sistema (sospendi / riavvia / spegni).
@@ -21,7 +22,7 @@ Rectangle {
Text {
anchors.centerIn: parent
text: pbtn.label
text: Faux.apply(pbtn.label)
color: pbtn.enabled ? "#f0dfba" : "#aaf0dfba"
font.family: themeFont.name
font.pixelSize: 13
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
// Sostituzione faux-cirillica: lettere latine → omologhe cirilliche
// visivamente identiche (homoglyph), per l'effetto manifesto sovietico.
// Le lettere senza omologo convincente (S, N, R, D, G, I, L, U, V, W, Z, F, Q, J)
// restano latine per mantenere la leggibilità.
.pragma library
var MAP = {
'A': '\u0410', 'B': '\u0412', 'E': '\u0415', 'K': '\u041A', 'M': '\u041C',
'H': '\u041D', 'O': '\u041E', 'P': '\u0420', 'C': '\u0421', 'T': '\u0422',
'X': '\u0425', 'Y': '\u0423',
'a': '\u0430', 'e': '\u0435', 'k': '\u043A', 'm': '\u043C', 'h': '\u043D',
'o': '\u043E', 'p': '\u0440', 'c': '\u0441', 't': '\u0442', 'x': '\u0445',
'y': '\u0443'
};
function apply(text) {
var out = '';
for (var i = 0; i < text.length; i++) {
var ch = text.charAt(i);
out += MAP[ch] !== undefined ? MAP[ch] : ch;
}
return out;
}