In theory, anything can go into Org drawers but in practice, it tends to be metadata (e.g. header arguments for source code blocks). Unlike other "metadata elements" (e.g. keywords and begin/end of blocks), Org drawers use a variable pitch font. Wouldn't a fixed pitch font make more sense? Regular text in drawers can continue to use a variable pitch font.
I tried making the relevant faces inherit from fixed-pitch but that doesn't quite work as is clearly visible when enabling variable-pitch-mode, provided the line height of the variable pitch font differs from that of the fixed pitch font. Looking forward to hear your thoughts, thank you in advance.
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Unlike other "metadata elements" (e.g. keywords and begin/end of blocks), Org drawers use a variable pitch font.
In the past, they were configured to be fixed-pitch. Now I reviewed this to let them be variable-pitch when: (1) users opt for the theme option for variable-pitch headings, and (2) when variable-pitch-mode is enabled.
My rationale was that fixed-pitch did not offer anything in terms of the semantics/usability of those elements (unlike, say, what I reported here: https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00461.html). Perhaps though, I have not seen enough cases and there may be a good reason to make them fixed-pitch. No problem!
Some screenshots, which do not indicate to me that something is broken (again, I may be missing some case where it does):
Enable variable pitch headings
No variable pitch headings (default)
variable-pitch-mode
Notice the marked region in the last screenshot. Perhaps that is the part you want to make monospaced?
The properties drawer is variable pitch whereas the #+TITLE keyword and #+{BEGIN,END}_SRC lines are fixed pitch even though the former is similar in purpose to the later.
Looks good, thank you for taking the time to implement this.
Related to this but not related to the Modus themes. When I enable variable-pitch-mode, the space between the lines in the drawer grows. The reason is i) the variable pitch font takes more horizontal space compared to the fixed pitch font even though visually, the height of the characters is identical and ii) these lines still contain variable pitch characters (e.g. the newline and the space between header-args: and :mkdirp yes).
Looks good, thank you for taking the time to implement this.
And thanks for the valuable feedback. Closing this now (the discussion can always continue).
Any idea how I could fix this?
My understanding is that variable-pitch-mode remaps variable-pitch to the default face. So all spaces and every other character that does not have an explicit font-family, height, etc. will use the new default. This is why variable-pitch-modebreaks alignment based on spaces (bug reported upstream).
Now about the height, I think this has to do with the typeface you use. While not a genuine solution, a font with a shorter line height would make the effect less obvious (or non-existent if it is identical to your monospaced font). In my tests, Source Sans Pro is the tallest, FiraGO the shortest, and Roboto, Noto Sans, DejaVu Sans somewhere in the middle.
You could make each of default, fixed-pitch, variable-pitch have an absolute point size. That would allow you to make them look the same (for example, FiraGO 14pt is about the same as Hack 13pt). But it would then break text-scale-adjust…
Thank you for confirming my hunch. It's tricky to find a variable pitch font that looks good, matches the fixed pitch font yet looks sufficiently different from it, comes in italics, different weights, has decent Unicode coverage and is available under a free license. I'm happy with my choice of fonts. The height difference is only noticeable in drawers, I can live with it.
It's tricky to find a variable pitch font that looks good, matches the fixed pitch font yet looks sufficiently different from it, comes in italics, different weights, has decent Unicode coverage and is available under a free license.
Oh, I feel you! For monospaced fonts, I can only live with Hack or Iosevka. Both of which I have patched to align them with my expectations (I hate Iosevka's m, so using an alternative forced a rhythm for my entire styleset).[0][1]
Same story for variable pitch fonts. Excerpt from my dotemacs:
Any font I choose must support Latin and Greek character sets, be
readable at both small and large sizes, preferably offer roman and
italic variants with corresponding bold weights, not be too thin, not
have too short of an x-height, not be too wide, not have a name that
directly advertises some brand, not try to call too much attention to
its details, be equally readable against light and dark backdrops, and
use the =*.ttf= spec which yields the best results on GNU/Linux.
Shortlist of good and free proportionately spaced fonts: FiraGO, Alegreya, Alegreya Sans, Source Sans Pro. Open Sans has too thin glyphs. Noto Sans has exaggerated details. Merriweather lacks Greek glyphs. Roboto…
Okay, I stop (in Firefox there is a setting to prevent pages from loading their own fonts).
The height difference is only noticeable in drawers, I can live with it.
It also happens with tables, because you notice the distance between the | characters. Though I am also fine with it.
I've settled on PragmataPro Mono or Iosevka for fixed pitch and IBM Plex Sans for variable pitch. PragmataPro Mono isn't free, I bought it when there were fewer viable options. IBM Plex Sans advertises a brand which I don't mind as long as when using it, one isn't reminded of the brand, e.g., the Coca-Cola font. Alegreya looks blurry, at least on my screen. FiraGO is too heavy, the light weight too light.
I should look into Fontconfig and whatever else applications use to determine font configuration (e.g. XSETTINGS) but I'm afraid this will turn into another rabbit hole. In January, I decided to not be tempted by EXWM. Today, after figuring out how to reuse some of GNOME and writing just enough Elisp to configure my monitors from Emacs, I'm using EXWM. Not using browser tabs and instead managing browser windows with the help of the minibuffer and ibuffer is nice tough.
Pragmata Pro looks great. Never tried it though. Iosevka is fine too, though I absolutely dislike the default m (can't complain because it is possible to patch it and get what you want).
Branding aside, my issue with IBM Plex was some of its exaggerated italics. Can't recall the details now because it has been a while. The x was particularly noticeable.
Alegreya is indeed blurry at (i) small point sizes, or (ii) dark backgrounds. Actually this may be due to the serifs. What about Alegreya Sans? I prefer that variant.
I agree that FiraGO is heavier than, say, Open Sans, though this is something I only feel intensely after working with an Iosevka font (and Pragmata, I presume). I use it as my default font, Emacs notwithstanding. It has a bit more character than Roboto, is not as narrow as Source Sans Pro, heavier than Open Sans, and not as artistic as Alegreya Sans (or IBM Plex for that matter). So it is okay for a default. But yes, inside of Emacs I still am not entirely satisfied with it because it does not look good at larger point sizes (i.e. when I want to do focused reading/writing). I would have liked to test Merriweather, but it lacks Greek glyphs.
I used tiling window managers for most of my time in the free software space (~4 years) and even wrote a booklet about my setup at the time (with bspwm on Debian 10 'buster'). EXWM is quite different because of Emacs, but the idea of controlling the windows of different apps centrally no longer appeals to me. All because of how I use Emacs: it does my email, writing/reading, music, etc. to the point where I seldom run more than two applications at the same time (so Alt+Tab is okay, plus I rationalise this as an opportunity to relax and just use the mouse).