Page 1 of 1

Align Right without Word Break

Posted: Thu Feb 12, 2026 1:37 am
by gurok
Hello,

What does Align Right do when "Word break at column number" is unchecked? I can't work out exactly what it's aligning to. In my experience, it seems to be about 4/5 of the width of the window. The documentation says aligning text uses the right margin, but isn't specific about whether that margin applies when word break isn't checked.

Re: Align Right without Word Break

Posted: Thu Feb 12, 2026 8:53 am
by bbadmin
This depends on the font. The right margin is calculated to be the maximum number of characters of maximum width which will fit. If the displayed characters are thinner than the maximum, you get this effect. There was a time when "fixed width font" meant exactly that, but not any more, unfortunately.

Re: Align Right without Word Break

Posted: Fri Feb 13, 2026 1:58 am
by gurok
bbadmin wrote: Thu Feb 12, 2026 8:53 am This depends on the font. The right margin is calculated to be the maximum number of characters of maximum width which will fit. If the displayed characters are thinner than the maximum, you get this effect. There was a time when "fixed width font" meant exactly that, but not any more, unfortunately.
Good to know. Thanks. I suppose it worked well with the old Courier 10pt bitmap font.

The font I'm having trouble with is Consolas, 12pt. I've also tried Courier New and Lucida Console and I haven't found one that works. Is that right? There's no good option among the default fonts on Windows 10/11?

It would be interesting to know which character TextPad considers the widest in each font. My guess was something from a Unicode fallback font, but then I tried right aligning "你好你好你好你好你好你好你好你好你好你好你好你好你好你好" (which is usually a fallback font, SimSun) and it went right over the window boundary. My test text that right aligns to around 4/5 of the window width is "octopuses".

I have a suggestion, but I know I don't fully understand what TextPad's doing internally, so apologies if I'm off base. Rather than trusting what the font says is widest, TextPad should just measure the width of "M" and assume that. Based on my limited testing, that would give consistent results for Latin text in monospace fonts. It can also be pretty easily understood and documented.

Re: Align Right without Word Break

Posted: Fri Feb 13, 2026 6:39 am
by AmigoJack
gurok wrote: Fri Feb 13, 2026 1:58 amTextPad should just measure the width of "M"
That could be an optional setting, maybe even with defining which letter to use. But then again I virtually never use TextPad to align texts...

Re: Align Right without Word Break

Posted: Fri Feb 13, 2026 12:57 pm
by bbadmin
The maximum and average width of a font's characters are defined in its metadata. It turns out that using the average width for ANSI characters results in the behavior you expect, so that will be used in the next release.

Re: Align Right without Word Break

Posted: Wed Feb 18, 2026 12:30 am
by gurok
bbadmin wrote: Fri Feb 13, 2026 12:57 pm The maximum and average width of a font's characters are defined in its metadata. It turns out that using the average width for ANSI characters results in the behavior you expect, so that will be used in the next release.
Thank you. Looking forward to the new version.

Re: Align Right without Word Break

Posted: Sat Feb 21, 2026 5:09 pm
by bbadmin
The fix is now available in release 9.9.4.