I am having difficulty getting text to fully justify when I use a proportional font. When I do, I get staggered text. As I understand it, the way emacs generally handles filling is by number of characters.

Is there an easy way to justify proportional fonts or fix this problem?

Aligned version (monofont): enter image description here

Proportional font: enter image description here

  • 1
    Could you perhaps include a screenshot, or fake it with text, to show what you mean: what you see now and what you would like to see?
    – Drew
    May 25, 2021 at 15:02
  • Hey @Drew - does this clarify the question? I've been looking at implementing a function myself, but the (char-width) function seems to return widths in terms of columns, which obviously isn't useful when a character doesn't fill a column. Any ideas?
    – strange
    May 26, 2021 at 21:57
  • 1
    Yes, thanks. Hopefully someone will have a useful answer for you.
    – Drew
    May 27, 2021 at 1:20
  • @strange Do not use char-width but window-text-pixel-size. Compare shr-string-pixel-width.
    – Tobias
    May 27, 2021 at 4:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.