2015-12-08 84 views
0

我正在努力將一些包含devicons的字體添加到我的$ HOME目錄中,以用於vim和gvim。 VIM需要的字體在終端,所以我想這個命令並得到一個xterm: unable to open font <name>, trying "fixed"錯誤:fonts.dir中的字體在xfontsel或gvim中不可用

xterm -u8 -fn '-misc-knack-bold-i-normal--0-0-0-0-p-0-iso8859-15' 

我看到,在fonts.dir文件指定的字體,我已經更新我的緩存與fc-cache -f -v。 fc-list顯示Knack:style=NerdFontPlusOcticonsPlusPomicons,但使用該字符串會得到相同的結果。 xfontsel不會將此顯示爲可用字體,但gvim確實會將此字體顯示爲選項。

爲什麼字體會顯示在fonts.dir(和fonts.scale)中,但不在xfontsel中?

爲什麼gvim看到字體而不是X11?

Shell在Suse11系統上是tcsh。

回答

1

-misc-knack-bold-i-normal--0-0-0-0-p-0-iso8859-15 

是如mkfontdir描述的可伸縮的字體,因爲所有的尺寸都是零。 xtermxfd需要尺寸。你可以用

#!/bin/sh 
FONT=`xfontsel -print` 
test -n "$FONT" && xfd -fn "$FONT 

實驗,看看想傳遞一個字體的非縮放版本,或從fc-list-fa選項xtermxfd使用的名稱是什麼尺寸的字體服務器:

-fapattern
This option sets the pattern for fonts selected from the FreeType library if support for that library was compiled into xterm. This corresponds to the faceName resource. When a CJK double-width font is specified, you also need to turn on the cjkWidth resource.

進一步閱讀: