2

I would like to make the bitmapped font Terminus the default font in all my "graphic"1 Emacs sessions.

Since Terminus is bitmapped, I want to use it only in one of its "native" sizes, and I want to make sure that the font is never anti-aliased.

I have something similar to the following in my .emacs file:

(set-face-attribute 'default nil
                    :family "Terminus"
                    :height some-height
                    :weight 'normal
                    :width 'normal)

I'm having a hard time figuring out what values to give to the :height parameter (IOW, what values the variable some-height in the snippet above may assume) in order to specify Terminus' native sizes.

Also, I'd like to know if there's some Emacs configuration that ensures that this font never gets anti-aliased.


In more detail, according to the documentation for the Terminus font installed on my system, its native sizes should be

6x12, 8x14, 8x16, 10x20, 11x22, 12x24, 14x28 and 16x32

On the other hand, the xfontsel utility reports the following values for the installed Terminus font's ptSz parameter:

120, 140, 160, 200, 220, 240, 280, 320

These values are all 10 times the second integer in the sizes cited earlier, which is encouraging.

Unfortunately, they don't seem to be quite what Emacs wants as the value for the :height parameter in the set-face-attribute call shown above. For example, I see no difference at all between the text resulting from values 280 and 320 for some-height2. In fact when both :height (Emacs) and ptSz (xfontsel) are set to 320, their text displays match closely when compared side-by-side, but when I perform the same comparison using 280 instead of 320, the text as displayed by Emacs looks distinctly larger than that displayed by xfontsel. IOW, setting :height to 280 in Emacs is decidedly not analogous to setting ptSz to 280 in xfontsel.

Is there a quick way to determine the values of the :height parameter that set-face-attribute will faithfully match to the native sizes listed above?


Also, the fact that Emacs seems to accept just about any positive integer for the :height parameter (which, obviously, cannot all correspond to distinct native font sizes) makes me wonder if for some settings of :height the font may be getting anti-aliased.

Is there some way to tell Emacs never to anti-alias this font?


1 By "graphic" I mean those sessions for which the expression (window-system) evaluates to non-nil.

2 When viewed with xfontsel these two are clearly different. In fact, not just the sizes of the letters are different, but also their geometries, as one would expect from two neighboring sizes of a bitmapped font. Furthermore, if I set some-height to 1, and evaluate the expression above, the text indeed becomes considerably smaller. These observations at least rule out some trivial explanations for my inability to see any difference between the characters resulting from the settings 280 and 320 for some-height.

Your Answer

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

Browse other questions tagged or ask your own question.