Let's say I want to write a package which uses proportional font. But I don't want to hardcode a specific font, because the user may not have it installed.

How can I refer to the system default proportional font which can be configured by the user?


Does using face variable-pitch do what you want?

See the Elisp manual, node Basic Faces for info about this and other predefined basic faces.

More precisely, since you want a font, not a face, maybe programmatically pick up the font or font family from the attributes of that face. That font is likely to be different for different platforms, even though the face used is the same (the face may be defined differently on different platforms, but it has the same name).

  • Thanks, looks good. I don't know how it's set, but I assume it uses some system default. – Tom Apr 7 '20 at 17:29

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.