protesilaos / fontaine

Set Emacs font configurations using presets
https://protesilaos.com/emacs/fontaine
GNU General Public License v3.0
61 stars 1 forks source link

Support for line number and mode line faces #4

Open ashlineldridge opened 8 months ago

ashlineldridge commented 8 months ago

Thanks for the great package.

I've been using a less sophisticated hand-rolled version to help with switching between working on my laptop and working at a wide-screen monitor.

Would you consider adding support for mode line and line number faces? I have grown attached to having the line number height be smaller than the main text and italicizing the line number face.

Screenshot 2024-01-17 at 7 24 09 am

Another face that would be handy to be able to configure is the mode line face, which I also find is more visually appealing when it is slightly smaller than the main text.

protesilaos commented 7 months ago

From: Ashlin Eldridge @.***> Date: Tue, 16 Jan 2024 12:28:30 -0800

Thanks for the great package.

You are welcome!

I've been using a less sophisticated hand-rolled version to help with switching between working on my laptop and working at a wide-screen monitor.

Would you consider adding support for mode line and line number faces? I have grown attached to having the line number height be smaller than the main text and italicizing the line number face.

Screenshot 2024-01-17 at 7 24 09 am

Good idea! Though note that we do not support a different slant for the given face. So we would need to add that feature as well.

Another face that would be handy to be able to configure is the mode line face, which I also find is more visually appealing when it is slightly smaller than the main text.

I like this! Is it the 'mode-line', 'mode-line-active', and 'mode-line-inactive' faces you have in mind?

-- Protesilaos Stavrou https://protesilaos.com

protesilaos commented 7 months ago

Sorry for being slow to respond, by the way. My typing time is limited due to a pain in a my left arm.

ashlineldridge commented 7 months ago

Thanks for the response, @protesilaos. Sorry to hear about your arm - I do hope it is improving.

Good idea! Though note that we do not support a different slant for the given face. So we would need to add that feature as well.

Ah, I see.

I like this! Is it the 'mode-line', 'mode-line-active', and 'mode-line-inactive' faces you have in mind?

In my config, I set both the mode-line-active and mode-line-inactive faces. I found that if I only set mode-line then the inactive mode line will use a different face even though mode-line-inactive inherits from mode-line (didn't dig into why).

protesilaos commented 7 months ago

Hello again! I just added support for the extra faces. I included the header-line as well. Will also do it for the tab-bar-mode and tab-line-mode.

protesilaos commented 7 months ago

Next up is to support a slant per face.

ashlineldridge commented 6 months ago

Thanks a lot, @protesilaos! I appreciate the work. Will update and check it out.

protesilaos commented 6 months ago

Hello again! Recent changes include support for font slants as well. If you do try the development version, please let me know how it goes.

ashlineldridge commented 6 months ago

Hi @protesilaos, I've tried out the changes and they work really well! I can replace my custom setup with Fontaine now!

I did notice a couple of inconsistencies with the other faces though:

  1. The mode line and line number families don't seem to fall back to :default-family and I need to specifically set :mode-line-active-family, :mode-line-inactive-family, and :line-number-family.
  2. When using relative/decimal font heights for the two mode line faces, something odd happens with doom-modeline where the active mode line gets displayed with multiple different font sizes whereas the inactive mode line does not. This doesn't happen when using absolute sizes. The screenshot below shows the issue - I've specified a face height of 1.2 for both :mode-line-active-height and :mode-line-inactive-height. This seems to be a doom-modeline issue, however, as when I used the default mode line the issue doesn't occur.
Screenshot 2024-02-26 at 8 03 20 am
protesilaos commented 6 months ago

From: Ashlin Eldridge @.***> Date: Sun, 25 Feb 2024 13:12:27 -0800

Hi @protesilaos, I've tried out the changes and they work really well! I can replace my custom setup with Fontaine now!

Very well!

I did notice a couple of inconsistencies with the other faces though:

Thank you for taking the time to report these!

1 The mode line and line number families don't seem to fall back to : default-family and I need to specifically set : mode-line-active-family, :mode-line-inactive-family, and : line-number-family.

Okay, I will check this out. Note that I changed how fallbacks work, so that it resolves to the values of the underlying face. These should, in principle, be 'unspecified' (meaning that the 'default' values are used).

2 When using relative/decimal font heights for the two mode line faces, something odd happens with doom-modeline where the active mode line gets displayed with multiple different font sizes whereas the inactive mode line does not. This doesn't happen when using absolute sizes. The screenshot below shows the issue - I've specified a face height of 1.2 for both :mode-line-active-height and :mode-line-inactive-height. This seems to be a doom-modeline issue, however, as when I used the default mode line the issue doesn't occur.

Strange... Can you do M-x list-faces-display and check the doom-modeline faces? Set the Fontaine mode line heights to something easy to spot, like 2.0, and then try to find the faces not covered by this. It could be a doom-modeline issue or something to do with how the Fontaine fallback values work.

-- Protesilaos Stavrou protesilaos.com

ashlineldridge commented 5 months ago

Apologies for the very late reply. I'm quite sure this issue is doom-modeline specific at this point. However, I wasn't able to use list-faces-display to diagnose the specific faces in doom-modeline that were problematic as the sizes of the faces aren't previewed for me. Is that what you were suggesting? That I should try spot the faces that don't appear to have 2.0 applied?

Screenshot 2024-03-24 at 7 07 12 AM

I did see https://github.com/seagle0128/doom-modeline/issues/704 and thought it could be related but it the corresponding PR doesn't seem to affect the issue I described.

It's not a big deal for me to specify absolute face sizes to work around this. So I'm still able to use Fontaine and it's an improvement over what I had before.