Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify font size in modeline? #189

Closed
AmaiKinono opened this issue Jun 30, 2019 · 9 comments
Closed

Specify font size in modeline? #189

AmaiKinono opened this issue Jun 30, 2019 · 9 comments

Comments

@AmaiKinono
Copy link

I would like to use smaller font size/height in modeline. Is there anyway to do this?

@seagle0128 seagle0128 added the help wanted Extra attention is needed label Jul 1, 2019
@seagle0128
Copy link
Owner

seagle0128 commented Jul 1, 2019

Please refer to #187.

Another method is setting smaller font height for mode-line via set-face-attribute.

e.g.

(set-face-attribute 'mode-line nil :height 120)

@AmaiKinono
Copy link
Author

Thanks.

That means the height of mode-line should be the max value of doom-modeline-height and the font height.

I don't think so... I did this:

(set-face-attribute 'mode-line nil :height 50)
(setq doom-modeline-height 1)

and the modeline looks like this:

2019-07-01-155219_836x65_scrot

It's larger than both the maximum height of the font, and doom-modeline-height.

@seagle0128
Copy link
Owner

Please provide more information below.

  • OS, Emacs version, doom-modeline version
  • doom-modeline-height, (doom-modeline--font-height)
  • error logs, messages, etc.

You'd better update to the latest version and restart Emacs.

@AmaiKinono
Copy link
Author

  • OS: Manjaro 18.0.4 with kernel 4.19.49
  • Emacs version: 26.2
  • doom-modeline version: commit ee4619d3670830180ffd87b1598d74312b5b9808. I've just pulled it so it's the latest.
  • doom-modeline-height: 1
  • (doom-modeline--font-height): 44
  • logs / messages: no. It's just the display issue, and nothing is reported with emacs --debug-init.

@seagle0128
Copy link
Owner

Obviously, the font height of mode-line is 44. That's why the mode-line looks so big. The behaviors are as designed. Again, please refer to #187.

@AmaiKinono
Copy link
Author

Thanks. Advising doom-modeline--font-height now works. But it looks weird to me to set the height according to (frame-char-height). would using (face-attribute 'mode-line :height) be better?

@seagle0128
Copy link
Owner

seagle0128 commented Jul 1, 2019

@AmaiKinono I've already been working on it. Will commit soon. And the advice will be simple. But it's not recommended to change the font size, since the right segments may not be aligned.

(setq doom-modeline-height 1)
(set-face-attribute 'mode-line nil :height 100)
(set-face-attribute 'mode-line-inactive nil :height 100)

@AmaiKinono
Copy link
Author

This works. But seems the face attributes must be set or it goes wrong. I tried in emacs -q to require doom-modeline and call doom-modeline-mode, the modeline won't show up and emacs throws an error:

doom-modeline-refresh-bars: Wrong type argument: number-or-marker-p, unspecified

and It works after setting the face attributes.

@seagle0128
Copy link
Owner

Fix in 68362f2.

seagle0128 added a commit that referenced this issue Jul 1, 2019
@seagle0128 seagle0128 removed the help wanted Extra attention is needed label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants