I recently declared .emacs bankrupcy and reorganized my init stuff. In the process, I ripped out all the hacky font selection stuff I had accrued over the years, figuring there are probably easier ways to accomplish what I want in the most modern version of emacs.
我最近宣布.emacs破产并重组了我的初始化东西。在这个过程中,我撕掉了多年来积累的所有hacky字体选择,想象在最现代版本的emacs中可能有更简单的方法来实现我想要的东西。
GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.14.4)
on a GNU/Linux System (Ubuntu 8.10).
Let's ignore, for the moment, the fact that I also run emacs under Mac OS X (GUI+Terminal) and occasionally on Windows and just focus on the X11 case:
让我们暂时忽略这样一个事实:我还在Mac OS X(GUI +终端)下运行emacs,偶尔在Windows上运行,只关注X11案例:
(Background: The font 6x13 has been part of X11 for as long as I can remember. (a.k.a misc-fixed semi-condensed ...). It's a bitmap font.)
(背景:只要我记得,字体6x13就是X11的一部分。(a.k.a misc-fixed semi-condensed ...)。它是一个位图字体。)
- I want emacs to always use the X11 bitmap font 6x13. (This gives me two buffers next to eachother on my netbook.)
- I don't want to see DejaVu Sans Mono 16pt or whatever the heck comes up by default on my netbook (it's huge!)
- I want every new frame and window to use this font.
- I want derived faces (like org-mode-column) to use 6x13 font and not mysteriously switch back to DejaVu Sans Mono
- I don't care what GNOME and X11 think the logical DPI of my screen is. I want 6x13.
- When I remote into my netbook (NX Machine) I don't want to see 6x10. I want 6x13.
- In case there's any doubt: I want 6x13.
我希望emacs始终使用X11位图字体6x13。 (这给我上网本旁边的两个缓冲区。)
我不想看到DejaVu Sans Mono 16pt或默认情况下我的上网本上出现的任何东西(它太大了!)
我希望每个新的框架和窗口都使用这种字体。
我希望派生面(如org-mode-column)使用6x13字体而不是神秘地切换回DejaVu Sans Mono
我不在乎GNOME和X11认为我的屏幕的逻辑DPI是什么。我想要6x13。
当我远程进入我的上网本(NX机器)时,我不想看到6x10。我想要6x13。
如果有任何疑问:我想要6x13。
What's the canonical way to do to make this happen?
实现这一目标的规范方法是什么?
And before some smart-aleck tells me about menu: Options>>Set Default Font: the resulting dialog box doesn't even offer bitmap fonts, so there's no way to choose 6x13. Furthermore, it doesn't solve the problem with org-mode: table-views still come up with the wrong font.
之前一些smart-aleck告诉我菜单:选项>>设置默认字体:结果对话框甚至不提供位图字体,因此无法选择6x13。此外,它没有解决org-mode的问题:table-views仍然出现错误的字体。
3 个解决方案
#1
I control this stuff from my .Xresources
file.
我从.Xresources文件中控制这些东西。
Personally I have
就我个人而言
emacs.reverseVideo: true
emacs.font: 7x13bold
(And I quite agree... long live the bitmap fonts! I'll take my xterm
with
(而且我非常同意......位图字体万岁!我会带着我的xterm
XTerm*foreground: green
XTerm*background: black
XTerm*font: 7x13bold
... over the Gnome terminal any day).
...任何一天在Gnome终端上。
If you're playing with .Xresources
from within a session, xrdb
command is useful to reload them.
如果您正在使用会话中的.Xresources,则xrdb命令可用于重新加载它们。
#2
You want to set the default frame parameters in your .emacs.
您想在.emacs中设置默认帧参数。
- find out the name of the font you want to use
- add the needed value to the
default-frame-alist
.
找出您要使用的字体的名称
将所需的值添加到default-frame-alist。
The easiest way, actually, is to use customize and customize default-frame-alist, but can also use elisp and write
实际上,最简单的方法是使用自定义和自定义default-frame-alist,但也可以使用elisp和write
(setq default-frame-alist
'(font . "-*-*-medium-r-normal--16-*-*-*-*-*-fontset-hiramin_w6"))
That's stolen from my emacs, you'll need to find the full font name (xfontsel?) for the font you want.
这是从我的emacs中窃取的,你需要找到你想要的字体的完整字体名称(xfontsel?)。
See also the EmacsWiki on setting fonts and faces.
另请参阅设置字体和面的EmacsWiki。
#3
For anyone reading this with a recent Linux distribution you will have to install 6x13 first (yes, sounds obvious..). There are instructions here for Ubuntu/Debian which should work on other distros too if you skip the apt-getting of random fonts. Install the "FixedSC" .tgz from there (it unpacks to /usr/local/share/fonts) then follow the instructions to add it to the font cache so it will appear in the Gnome Font selection dialog.
对于使用最新的Linux发行版阅读此内容的任何人,您必须首先安装6x13(是的,听起来很明显......)。这里有Ubuntu / Debian的说明,如果你跳过随机字体的apt-getting,它也应该适用于其他发行版。从那里安装“FixedSC”.tgz(它解压缩到/ usr / local / share / fonts)然后按照说明将其添加到字体缓存中,以便它出现在Gnome字体选择对话框中。
#1
I control this stuff from my .Xresources
file.
我从.Xresources文件中控制这些东西。
Personally I have
就我个人而言
emacs.reverseVideo: true
emacs.font: 7x13bold
(And I quite agree... long live the bitmap fonts! I'll take my xterm
with
(而且我非常同意......位图字体万岁!我会带着我的xterm
XTerm*foreground: green
XTerm*background: black
XTerm*font: 7x13bold
... over the Gnome terminal any day).
...任何一天在Gnome终端上。
If you're playing with .Xresources
from within a session, xrdb
command is useful to reload them.
如果您正在使用会话中的.Xresources,则xrdb命令可用于重新加载它们。
#2
You want to set the default frame parameters in your .emacs.
您想在.emacs中设置默认帧参数。
- find out the name of the font you want to use
- add the needed value to the
default-frame-alist
.
找出您要使用的字体的名称
将所需的值添加到default-frame-alist。
The easiest way, actually, is to use customize and customize default-frame-alist, but can also use elisp and write
实际上,最简单的方法是使用自定义和自定义default-frame-alist,但也可以使用elisp和write
(setq default-frame-alist
'(font . "-*-*-medium-r-normal--16-*-*-*-*-*-fontset-hiramin_w6"))
That's stolen from my emacs, you'll need to find the full font name (xfontsel?) for the font you want.
这是从我的emacs中窃取的,你需要找到你想要的字体的完整字体名称(xfontsel?)。
See also the EmacsWiki on setting fonts and faces.
另请参阅设置字体和面的EmacsWiki。
#3
For anyone reading this with a recent Linux distribution you will have to install 6x13 first (yes, sounds obvious..). There are instructions here for Ubuntu/Debian which should work on other distros too if you skip the apt-getting of random fonts. Install the "FixedSC" .tgz from there (it unpacks to /usr/local/share/fonts) then follow the instructions to add it to the font cache so it will appear in the Gnome Font selection dialog.
对于使用最新的Linux发行版阅读此内容的任何人,您必须首先安装6x13(是的,听起来很明显......)。这里有Ubuntu / Debian的说明,如果你跳过随机字体的apt-getting,它也应该适用于其他发行版。从那里安装“FixedSC”.tgz(它解压缩到/ usr / local / share / fonts)然后按照说明将其添加到字体缓存中,以便它出现在Gnome字体选择对话框中。