better letter-spacing

This commit is contained in:
2026-05-19 09:16:32 +02:00
parent 5d939aa1c6
commit 518f0ac00b

View File

@@ -32,11 +32,11 @@ for (const txt of titles) {
let wdth_wght_ratio = wdth*wght / 10000;
console.log('wdth_wght_ratio',wdth_wght_ratio);
char.style.letterSpacing = wdth_wght_ratio < 1 ? "0.2em" : ital ? "0.05em" : 0;
// char.style.letterSpacing = wdth_wght_ratio < 1 ? "0.5em" : ital ? "0.05em" : 0;
if (ital) {
let prev_char = char.previousSibling;
if (prev_char) {
prev_char.style.letterSpacing = "0.1em";
char.style.letterSpacing = prev_char.style.letterSpacing = "0.03em";
}
}
}