radian-software / radian

🍉 Dotfiles that marry elegance and practicality.
MIT License
490 stars 47 forks source link

Difficulty customizing font #444

Closed redpanda1234 closed 1 year ago

redpanda1234 commented 5 years ago

In the README, the suggested local init file contains the following:

(setq radian-font ...)
(setq radian-font-size ...)

A few things:

  1. It might be worth mentioning explicitly in a comment here that the radian-font-size counts the actual number of pixels in the font face instead of something the size in pt. Otherwise, many people might do what I did and try (setq radian-font-size 12) thinking this will map to a "12 pt font", only to get something totally unreadable.

  2. Choosing a font with (setq radian-font ...) appears to discard information from (setq radian-font-size ...). In particular:

    ;; (setq radian-font "Ubuntu Mono")
    (setq radian-font-size 80)

    results in appropriately scaled text with the default system font. However, after uncommenting (setq radian-font "Ubuntu Mono"), no matter what value is used in (setq radian-font-size <val>), the text size doesn't change. C-h v radian-font-size indicates that radian-font-size is not being overwritten (it still contains <val>), it simply isn't taken into account.

raxod502 commented 5 years ago

Fair enough. Contributions welcome!

jnboehm commented 4 years ago

As more or less of a workaround. The way the radian-font is used by adding it to thedefault-frame-alist it should be sufficient to specify the font with the size present (this time in pt) like so Ubuntu Mono-12. Yet another workaround could be to specify the font in the Xresources, which Emacs will use as a default AFAIR.

My personal issue with this is that for me the respective part of the code (see below) is not triggered. This could either be that the radian-font customization is not picked up when the respective part of the code is executed (I'm not that familiar with the innards of this system). https://github.com/raxod502/radian/blob/532497569b7ff4d2230afd7d4f399a1b04ac3075/emacs/radian.el#L5283

Another cause of this issue could be that at the time the code is executed the graphical system may not have been set up, which is guarding the expression (see below). I think that this check is not necessary since only the variable is mutated and the graphical system will pick up on the change later on. https://github.com/raxod502/radian/blob/532497569b7ff4d2230afd7d4f399a1b04ac3075/emacs/radian.el#L5251

raxod502 commented 1 year ago

It might be worth mentioning explicitly in a comment here that the radian-font-size counts the actual number of pixels

Docstring for radian-font-size now reads Default font size, in pixels. Nil means use the default.

Choosing a font with (setq radian-font ...) appears to discard information from (setq radian-font-size ...).

Tested just now with e.g.

(setq radian-font "Tinos")
(setq radian-font-size 100)

with various values replacing 100, this appears to be fixed now.