For a long time I've been using DejaVu Sans Mono as my programming font. I've yet to find a better font.
But a little while ago I discovered Mozilla's Fira, which looks very nice for code. So I decided to give it a try in Emacs.
Unfortunately, when I use it in Emacs, the line spacing blows up and reduces the number of lines I can see by about 10.
I've tried (setq line-spacing 0)
and different combinations of things like (set-frame-font (font-spec :name "Fira Mono" :width 'normal :height 100))
, but no matter what I do, the excessive line spacing remains. (It's not possible to use negative line-spacing
values in Emacs, unfortunately, which would seem like the obvious solution.)
It doesn't seem to be a bug in the font though, because when I use Fira Mono in Kate at the same size, the line spacing is what I would consider normal, and apparently about the same as the Emacs line spacing with DejaVu Sans.
Is this a bug in Emacs? Is there any way to fix this?
Thanks for any advice.
--line-spacing=PIXELS
on the command line withemacs
, but my guess is that that won't help. My crystal ball tells me that line spacing is not inserting any extra pixels and that the problem is with Emacs's display of the font. Does the buffer mode make any difference? (I assume that you've checkedframe-parameters
to see what the font is etc.)minspace=true
to the FontConfig font definition? E.g. something likeemacs -fn 'Fira Mono:minspace=true'
, or whatever the name of the font.:height
and that's it. Emacs doesn't really have good control of distance between lines, and adjusting it just causes more problems. Perhaps a feature request would be appropriate -- e.g., to set distance between lines in pixels and have it work with all fonts.