0

I noticed recently that across all my files, each line is slightly misaligned.

enter image description here

enter image description here

As you can see, depending on the line number, the text is off a bit. I tried changing fonts with no luck.

Which setting is causing this?

Some of my settings:

(set-face-attribute 'default nil :font "Jetbrains Mono" :height 150)

(column-number-mode)
(global-display-line-numbers-mode 1) ;; line numbers globally

3
  • BTW, in the second image it looks as if the line wrapped. It's not clear to me that that's evidence of misalignment. Am I missing something?
    – NickD
    Commented Dec 11, 2022 at 15:41
  • Even if there is line wrap, doesnt the line start after the numbers on the left? Nether the less, the first image does show misalignment.
    – Vinn
    Commented Dec 12, 2022 at 16:38
  • Yes, you are right. It should have a fringe indicator too which I don't see.
    – NickD
    Commented Dec 12, 2022 at 17:19

1 Answer 1

1

You are clearly using a proportional font, rather than a monospaced font. Use C-u C-x = to view the details for any character in the buffer. You will see there the actual font used to render that character. Perhaps “Jetbrains Mono” wasn’t available?

9
  • Also, when i try to load a font that is not available, I get an error in the mini buffer. Jetbrains Mono is the font being used in that image.
    – Vinn
    Commented Dec 11, 2022 at 6:45
  • Result from C-u Cx = is => mac-ct:-*-JetBrains Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1
    – Vinn
    Commented Dec 11, 2022 at 6:59
  • 1
    Are you sure that’s the same font shown in your first screenshot? It’s clearly not monospaced.
    – db48x
    Commented Dec 11, 2022 at 9:04
  • mmm I could be wrong about that then. How can I confirm and fix it? the C-u C-x says its JetBrains Mono though, so what should I take from that?
    – Vinn
    Commented Dec 11, 2022 at 9:25
  • 1
    OK - do M-x describe-face RET linum, click on any inherited attribute too (if applicable) and add the result to your question.
    – NickD
    Commented Dec 12, 2022 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.