2

I was inspired by Paul Ford to use IBMs font Plex for my emacs config. One of the strengths of IBM Plex is that all the four families each have eight weights.

The families: Mono, Sans, Sans Condensed, Serif

The weights: Thin, Extra Light, Light, Regular, Text, Medium, SemiBold, Bold

But I encounter three problems:

  1. setting :weight text (in the customize-area)

    '(variable-pitch ((t (:family "IBM Plex Sans" :height 152 :weight text))))
      Error Message:
    Invalid face weight: text
    
  2. medium and regular seem to be interpreted as the same font weight. At least nothing changes if I use :weight regular or :weight medium.

  3. The font on regular looks different (heavier) in emacs than what I see on the "Typetester" (white button) on the font's website.

Is there a way to enable all the eight font weights for use in emacs?

I am fairly new to emacs.

  • 1
    manual says : "‘'weight’ One of ‘light’, ‘medium’, ‘demibold’, ‘bold’ or ‘black’." I'm no expert in this, but you may be looking for XLFD description, take a look at fonts – Muihlinn Apr 20 at 6:24
0

I maybe found an answer, although I cannot verify it from the output, I think that this hack has the desired effect of being able to use all the eight font weights.

First I pasted (insert (prin1-to-string (x-list-fonts "*"))) into the scratch buffer (Ctrl x then b and type *scratch*)

Then I ran the command with Ctrl j at the end of the line and it printed all the fonts. I did a bit of cleanup (I used org-mode with query-replace and org-sort) and got the following:

[...]
"-IBM -IBM Plex Mono-bold-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-bold-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-extralight-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-extralight-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-light-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-light-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-semibold-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-semibold-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-thin-italic-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-thin-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
[...]

I got similar output for each IBM Plex font. Interestingly there is three times the same font in XLFD style:

"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 
"-IBM -IBM Plex Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1" 

I suppose that "Medium" and "Text" are recognized as another "Normal" (Regular).

I experimented with the priorities in Org-Mode and formatted every priority in a different face to quickly see the differences when switching. I got the desired effect using the weight in family instead of weight. Following combinations worked for me (in the customize-section)

:family "IBM Plex Mono" :weight normal

:family "IBM Plex Mono Medium" :weight normal

:family "IBM Plex Mono Text" :weight normal

The intuitive way :family "IBM Plex Mono" :weight medium did not work.

On my windows machine I had to use the weight sometimes in the family AND the weight like:

:family "IBM Plex Mono SemiBold" :weight semibold

The weight just in the family with :weight normal did not work for me exept for "Text" and "Medium".

My experience was that not every weight in every font has an easy notable difference. But with this hack, I am able to apply all the desired font styles.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.