0

I'd like to use a fractional font size throughout Emacs. I have been able to set my default font size on launch using custom-set-faces:

(custom-set-faces
 '(default ((t (:inherit nil :stipple nil :background "#212121"
    :foreground "#e8e8d3" :inverse-video nil :box nil
    :strike-through nil :overline nil :underline nil :slant normal
    :weight normal :height 185 :width normal :foundry "nil" :family "Menlo")))))

The above configuration works fine on launch after Emacs finally settles on its default frame size.

However, when I create a new frame, this font is not utilized. I understand that I can use default-frame-alist to configure the new frame font, but default-frame-alist uses entirely different configuration data which does not seem to support fractional sizes:

(setq default-frame-alist
        '((width . 142)
          (height . 54)
          (font . "-*-Menlo-normal-normal-normal-*-18.5-185-*-*-m-0-iso10646-1")))

The above configuration does not work as expected -- the fractional portion is ignored and I simply receive a frame with an 18 point font.

  • The custom-set-faces call should affect ll frames rather than just the first, so I suggest you M-x report-emacs-bug. – Stefan Feb 27 '17 at 5:20
1

Configuring the default font is the best way to go, rather than using frame parameters. As you can see, the font frame parameter is equivalent only to the :font attribute of the default face. It can be any font name your system supports, so you can probably use an xft-style font name as well. The older style of font name that you're using basically pre-dates vector fonts, so it's integers all the way.

I would turn off all of your frame parameter customizations and see if you can get back to having it just work with the default font. That's the default behavior, so something must be changing it.

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.