Does anyone know it there is a way to set the letter spacing to fit to the box the variable is in? I am trying to space the letters of a variable to line up with a header. I realize it won’t be perfect I was just hoping for a better result than setting it to one size and going with it.
I am looking to space out the text to fit in the box. I have a variable that contains 0, 1 and/or D’s. There are twelve per variable and I am trying to line each letter with a header letter, but with character width of a D is a lot wider than 0 or 1. If i set the spacing static either the D’s don’t fit in the box or the 0 and 1 are way to small.
I managed to do this by creating a custom Handlebars helper which wraps each character in a element and subsequently use a CSS trick to distribute the elements.
In the section the expression looks like this:
{{{wrapChars somecare}}}
This sits inside a paragraph and applied some inline styles (could also be handled through a stylesheet), the source looks like this.
In case anyone is curious how this would work in the upcoming Chromium-based edition of 2026.1:
Justifying text by adding space between characters is a standard CSS feature. In theory all you would need is text-align: justify in combination with text-justify: inter-character, and if this would also need to apply to the last line you would include text-align-last: justify. No scripting needed.
Unfortunately we did not have enough time to include this in 2026.1. It will work out of the box in 2026.2 though.