1

I'm intending to increase the height of each line in Spacemacs. I tried to put some code into user-config block in the .spacemacs file in my home directory like below, but the line height doesn't change at all:

(defun dotspacemacs/user-config ()
  '(add-text-properties (point-min) (point-max)
                 '(line-spacing 0.25 line-height 1.25))
  )

Does anyone know how to do this in Spacemacs? I have just started to use Spacemacs for a week so I'm totally a newbie.

Drew
  • 29,895
  • 7
  • 74
  • 104
Henry Pham
  • 2,429
  • 3
  • 19
  • 19
  • 2
    `line-spacing` is a buffer-local variable that can be customized. The `:height` property is generally adjusted by customizing a particular face such as the `default` face. You can Google each one individually to find out how to do this with regular Emacs. I have no idea how to do this with Spacemacs. **How to set the font size in Emacs?**: http://stackoverflow.com/questions/294664/how-to-set-the-font-size-in-emacs and see https://www.emacswiki.org/emacs/LineSpacing – lawlist Nov 04 '16 at 03:00

3 Answers3

1

In addition to the other answers, you can the emacs UI to customize the vertical spacing. You do this by:
1. M-x
2. Type customize variable then press enter
3. Type line-spacing then press enter

You'll be taken to a UI menu for customizing the line spacing variable. On the line that says line spacing, go to the button that says value menu, press enter, press 1 to use a custom value. Then in the box to the right, you can change the value from 0.0 to whatever you'd like!

Then make sure to hit the save and apply button!

Vance Palacio
  • 1,280
  • 12
  • 17
0

After a while searching for the solution, I found out that there are lots of tricks to do to increase the line height, while keeping the text appearing at the center of the line. So I tried to modify the font instead using FontForge (increase the top and bottom space of the font).

For people who may want to achieve the same thing, I'd like to say that using FontForge to create a new font that suit you is far easier than finding a way to do it via configuration in Spacemacs.

Henry Pham
  • 2,429
  • 3
  • 19
  • 19
0

Just for information, evaluating (setq line-spacing 2) in a buffer increases the line spacing.

You can add (setq-default line-spacing 2) to your .emacs file to change it globally. setq wouldn't work because line-spacing is a buffer-local variable.

Yuan Fu
  • 191
  • 2
  • 15