Fonts 确定正在使用的xterm字体和相应的Cygwin软件包?

Fonts 确定正在使用的xterm字体和相应的Cygwin软件包?,fonts,cygwin,x11,xterm,Fonts,Cygwin,X11,Xterm,几十年来,我一直在努力尝试不同家族的不同字体,以获得xterm尺寸的良好进展。我在2015年发现的六个好项目的前缀是~/.Xresources:。由于Windows7不受支持,旧的笔记本电脑太旧,无法迁移到Windows10,我买了一台新的笔记本电脑,新安装了Cygwin的X-Windows。以前好的字体现在会产生错误,前缀为Error: ~/.Xresources: xterm*font: -misc-fixed-medium-r-semicondensed--13-120-75

几十年来,我一直在努力尝试不同家族的不同字体,以获得xterm尺寸的良好进展。我在2015年发现的六个好项目的前缀是
~/.Xresources:
。由于Windows7不受支持,旧的笔记本电脑太旧,无法迁移到Windows10,我买了一台新的笔记本电脑,新安装了Cygwin的X-Windows。以前好的字体现在会产生错误,前缀为
Error:

~/.Xresources: xterm*font:        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
Error: None

~/.Xresources: xterm*font1:       -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
Error: xterm: cannot load font "-B&H-LucidaTypewriter-medium-R-*-*-11-80-100-100-M-140-ISO10646-1"

~/.Xresources: xterm*font2:     -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
Error: xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-140-ISO10646-1"

~/.Xresources: xterm*font3:     -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
Error: xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-160-ISO10646-1"

~/.Xresources: xterm*font4:       -*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*
Error: xterm: cannot load font "-B&H-LucidaTypewriter-medium-R-*-*-14-140-75-75-M-180-ISO10646-1"

~/.Xresources: xterm*font5:    -b&h-lucidatypewriter-bold-r-normal-sans-14-*-*-*-m-*-*-*
Error: None

~/.Xresources: xterm*font6:     -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
Error: xterm: cannot load font "-Misc-Fixed-medium-R-*-*-20-200-75-75-C-200-ISO10646-1"

Other lines in ~/.Xresources
----------------------------
xterm*toolBar:  false
xterm*background:       rgb:00/00/66
xterm*foreground:       White
尽管在选择上面的一些字体时会产生错误,但xterm仍然会切换字体,我发现这些字体很好。我猜它选择了一些规格非常接近的字体

如果是,如何找到最终使用的字体的完整规范?我想在
~/.Xresources
中使用它们

如果没有,那么当我收到错误消息并且字体仍然显示为切换时会发生什么情况?

最后,一旦我确定了要切换到的字体,是否有一种有效的方法来查找包含这些字体的Cygwin包?

请注意,以下内容仅响应my ~/.Xresources中的信息,而不是显示实际使用的字体(假设由于错误,它们与
~/.Xresources
中的字体不同):

使用
xterm-报告字体进行故障排除

Thomas Dickey建议使用
xterm-report font
,它将加载的字体报告给
stdout

Loaded VTFonts(default)
   fNorm: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-60-ISO8859-1
   fWide: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
   fWBold: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
Loaded VTFonts(default)
   fNorm: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-60-ISO8859-1
   fWide: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
   fWBold: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1

Loaded VTFonts(default)
   fNorm: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-60-ISO8859-1
   fWide: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
   fWBold: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
Loaded VTFonts(font1)
   fNorm: -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
   fBold: -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
   fWide: -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
   fWBold: -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
Loaded VTFonts(font2)
   fNorm: -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-70-ISO8859-1
   fWide: -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
   fWBold: -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
Loaded VTFonts(font3)
   fNorm: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-80-ISO8859-1
   fWide: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
   fWBold: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
Loaded VTFonts(font4)
   fNorm: -*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*
   fBold: -B&H-LucidaTypewriter-bold-R-*-*-14-140-75-75-M-90-ISO8859-1
   fWide: -*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*
   fWBold: -*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*
Loaded VTFonts(font5)
   fNorm: -b&h-lucidatypewriter-bold-r-normal-sans-14-*-*-*-m-*-*-*
   fBold: -B&H-LucidaTypewriter-bold-R-*-*-14-140-75-75-M-90-ISO8859-1
   fWide: -b&h-lucidatypewriter-bold-r-normal-sans-14-*-*-*-m-*-*-*
   fWBold: -b&h-lucidatypewriter-bold-r-normal-sans-14-*-*-*-m-*-*-*
Loaded VTFonts(font6)
   fNorm: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
   fBold: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
   fWide: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
   fWBold: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1

Loaded VTFonts(default)
   fNorm: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
   fBold: -Misc-Fixed-bold-R-*-*-13-120-75-75-C-60-ISO8859-1
   fWide: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
   fWBold: -Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1
我添加了空行,以分离重复的
VTFonts(默认)
从位于中心位置的 输出。我还删除了与此相关的所有详细参数 每个X逻辑字体描述(XLFD)

似乎每次我选择
xterm
字体时 VTFonts(fonti),其中fonti取决于所选字体 (无论是
default
还是
font1
通过
font6
),
xterm
报告4字体 字体的变体。字体变体命名为
fNorm
fBold
fWide
fWBold

  • 对于所有
    xterm
    字体,变体
    fNorm
    始终与中的XLFD匹配
    ~/.Xresources

  • 变体
    fWide
    fWide
    匹配所有的
    fNorm
    xterm
    字体,默认字体除外

  • 所有
    xterm
    字体的变体
    fBold
    不同于
    fNorm
    除了
    font1
    font6

  • 选择
    xterm
    fonti会生成一个关于不适合 加载一个明显相关的字体,其中i是1、2、3、4、6中的一个。 这些是原始问题中报告的错误。 相关字体的XLFD不匹配任何字体变体(
    fNorm
    fBold
    fWide
    fWide

从这些观察结果来看,似乎最初发布的XLFD 错误可能与
~/.Xresources
字体无关。XLFDs 也不匹配xterm报告的任何字体变体。 如果对引擎盖下发生的事情了解不够,它就是 在我看来,xterm可能会尝试在 错误消息和无法处理的消息将取决于报告的XLFDs 使用
xterm-报告字体

我只是觉得我遇到这种行为很奇怪。越过 几十年来,我从未收到过关于XLFD的错误消息,但我没有 具体说明也许X11已经进化到寻找与
我指定的。对于Lucida,我将尝试xorg-x11-fonts-dpi100和xorg-x11-fonts-dpi75

$ cygcheck -p lucida
Found 18 matches for lucida
font-bh-lucidatypewriter-dpi100-7.5-2 - font-bh-lucidatypewriter-dpi100: Obsolet
ed by xorg-x11-fonts-dpi100 (installed binaries and support files)
font-bh-lucidatypewriter-dpi100-7.5-3 - font-bh-lucidatypewriter-dpi100: Obsolet
ed by xorg-x11-fonts-dpi100 (installed binaries and support files)
font-bh-lucidatypewriter-dpi100-7.5-4 - font-bh-lucidatypewriter-dpi100: Obsolet
ed by xorg-x11-fonts-dpi100
font-bh-lucidatypewriter-dpi75-7.5-2 - font-bh-lucidatypewriter-dpi75: Obsoleted
 by xorg-x11-fonts-dpi75 (installed binaries and support files)
font-bh-lucidatypewriter-dpi75-7.5-3 - font-bh-lucidatypewriter-dpi75: Obsoleted
 by xorg-x11-fonts-dpi75 (installed binaries and support files)
font-bh-lucidatypewriter-dpi75-7.5-4 - font-bh-lucidatypewriter-dpi75: Obsoleted
 by xorg-x11-fonts-dpi75
texlive-collection-context-20170520-1 - texlive-collection-context: TeX Live con
text package collection
texlive-collection-context-20180414-1 - texlive-collection-context: TeX Live con
text package collection
texlive-collection-context-20190509-1 - texlive-collection-context: TeX Live con
text package collection
xorg-x11-fonts-dpi100-7.5-2 - xorg-x11-fonts-dpi100: X11 core fonts (installed b
inaries and support files)
xorg-x11-fonts-dpi100-7.5-3 - xorg-x11-fonts-dpi100: X11 core fonts (installed b
inaries and support files)
xorg-x11-fonts-dpi100-7.5-4 - xorg-x11-fonts-dpi100: X11 core fonts
xorg-x11-fonts-dpi75-7.5-2 - xorg-x11-fonts-dpi75: X11 core fonts (installed bin
aries and support files)
xorg-x11-fonts-dpi75-7.5-3 - xorg-x11-fonts-dpi75: X11 core fonts (installed bin
aries and support files)
xorg-x11-fonts-dpi75-7.5-4 - xorg-x11-fonts-dpi75: X11 core fonts
...
对于我的Lucida字体,我使用的是Windows字体

 $ fc-list.exe | grep -i lucida
/usr/share/fonts/microsoft/lucon.ttf: Lucida Console:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Navadno,Arrunta
/usr/share/fonts/microsoft/l_10646.ttf: Lucida Sans Unicode:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/microsoft/luconP.ttf: Lucida ConsoleP:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Navadno,Arrunta
对于固定字体,您可以尝试terminus字体或texlive collection fontsextra

$ cygcheck -p fixed| grep font | grep -v src
terminus-fonts-4.40-1 - terminus-fonts: Terminus fixed width font (installed binaries and support files)
...
texlive-collection-fontsextra-20170520-1 - texlive-collection-fontsextra: TeX Live fontsextra package collection
texlive-collection-fontsextra-20180414-1 - texlive-collection-fontsextra: TeX Live fontsextra package collection
texlive-collection-fontsextra-20190509-1 - texlive-collection-fontsextra: TeX Live fontsextra package collection
xterm的选项显示所用字体的详细信息

有一个脚本(了解Debian和RPM软件包)可以显示用于字体的软件包名称(请参阅)。Cygwin有点忽略了命令行打包工具,这使得编写此功能的脚本变得简单。您可以修改脚本以使其工作,例如,使用
-f
选项:

-f, --find-package find the package to which FILE belongs -f、 --查找包查找文件所属的包
脚本尝试报告包含已找到字体文件的包。位图字体位于运行X服务器的计算机上,因此如果您在本地运行/显示,脚本可以访问所有需要的信息。

非常感谢您共享的信息。这将有助于探索字体。这个问题是关于如何识别xterm正在使用的字体,以及一旦知道字体,是否有一种有效的方法来识别包。看起来实现后者的唯一方法是按包名,这看起来信息量很大。它位于链接到的tar文件中。谢谢,Thomas。我将使用
-报告字体
更新我的问题。我跟踪了你的两个链接,但他们互相引用。想知道我是否遗漏了什么。某个地方有脚本吗?\xterm派生一些组合,并在这些组合不存在时发出警告。主要的缺点是宽字体(说来话长)。例如,如果你有xterm#330,那可能会有一个额外的警告,该警告在#348(查看Cygwin软件包的版本)中修复。谢谢你给我指点你的。我下载了
Special purpose
tar ball,并对
find xterm fonts
的Perl代码感到惊讶。不过,坦白地说,在修改perl和X11之前,我必须先暂停一下,然后才能启动它。根据我所报告的使用
xterm-report字体的情况,我将接受它们可能以粗体/斜体显示的错误和奇怪之处
-f, --find-package   find the package to which FILE belongs