2

Over the decades, I've taken to painstakingly trying different fonts from different families to get a nice progression of sizes for xterm. The six that I found to be good in 2015 are prefixed by ~/.Xresources: below. Since Windows 7 became unsupported and ye olde laptop was too worn out to migrate to Windows 10, I bought a new laptop and freshly installed Cygwin's X-windows. The formerly good fonts now generate errors, prefixed by Error: below.

~/.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

Despite the errors generated when some of the above fonts are selected, the xterm still switches fonts, and I find the fonts to be good. I'm guessing that it's choosing some font with a very close specification.

If so, how can I find the full specification for the font that ends up being used? I want to use them in ~/.Xresources.

If not, then what is happenning when I get the error message and the font still appears to switch?

Finally, once I've identified the fonts that are being switched to, is there an efficient way to find the Cygwin package that contains them?

Note the the following merely echos the information in my ~/.Xresources rather than displaying the fonts that are actually being used (assuming that they differ from what's in ~/.Xresources, due to the errors):

appres XTerm xterm | grep -w xterm | grep font | sort
xrdb -query | grep -w xterm | grep font | sort

Troubleshooting with xterm -report-fonts

Thomas Dickey suggested xterm -report-fonts, which reports loaded fonts to 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

I added blank lines to separate redundant reports of VTFonts(default) from the centrally positioned main body of the output. I also removed all the detailed parameters associatd with each X logical font description (XLFD).

What seems to be happening is that each time I select an xterm font VTFonts(fonti) where fonti depends on the font chosen (either default or font1 through font6), xterm reports 4 font variations for the font. The font variations are named fNorm, fBold, fWide, and fWBold.

  • For all xterm fonts, variation fNorm always matches the XLFD in ~/.Xresources.

  • Variations fWide and fWBold match fNorm for all xterm fonts except default

  • Variation fWBold differs from fNorm for all xterm fonts except font1 and font6

  • Selecting xterm fonti generates an error about inabilty to load an apparently related font, where i is one of 1, 2, 3, 4, 6. These are the errors reported in the original question. The related font's XLFD matches none of the font variants (fNorm, fBold, fWide, fWBold)

From these observations, it seems that the originally posted XLFD errors might be unrelated to the ~/.Xresources fonts. The XLFDs don't match any of the font variants reported by xterm either. Without knowing enough about what goes on under the hood, it is possible in my mind that xterm might try to load some of XLFDs in the error messages, and being unable to, settles on the XLFDs reported using xterm -report-fonts.

I just find it odd that I'm encountering this behaviour. Over the decades, I've never had error messages about XLFDs that I did not specify. Perhaps X11 has evolved to look for XLFDs related to the ones I specified.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
user2153235
  • 388
  • 1
  • 11
  • 1
    xterm derives some combinations, and warns if those don't exist. The main offenders are the wide-fonts (long story). – Thomas Dickey Jan 26 '20 at 02:29
  • 1
    If you have xterm #330, for instance, that might have an extra warning that's fixed in #348 (looking at the versions of Cygwin packages). – Thomas Dickey Jan 26 '20 at 02:37
  • Thanks for pointing me to your [script download area](https://invisible-island.net/scripts/readme.html#download). I downloaded the `Special-purpose` tar ball and marvelled at the Perl code for `find-xterm-fonts`. Frankly, however, I'd have to take a hiatus to spin up on perl and X11 before I can modify it. Based on what I reported about using `xterm -report-fonts`, I'm going to live with the errors and the oddities they may create in bolded/slanted man page text. – user2153235 Jan 26 '20 at 02:52
  • Regarding `xterm` versions, `cygcheck -pv xterm` reports versions 329, 330, and 348. Not sure why so many, as this is a virgn Cygwin install, and I don't recall requesting more than the most recent version of anything. Perhaps different X11 packages require different `xterm` versions. – user2153235 Jan 26 '20 at 02:52
  • The documentation suggests `cygcheck -cv xterm` to report what is actually installed. Also, `xterm -v` reports its version. – Thomas Dickey Jan 26 '20 at 13:28
  • Doh. Thanks. I need to read more than just the first few words. I saw REGEXP and said "that's what I want". I discovered that `cygcheck -cv` accepts partial package names, i.e., `cygcheck -cv xterm` reports package `xterm` and version 348-1, even though `cygcheck -pv xterm` reports the full package name as `xterm-348-1 - xterm`. The package search service at cygwin.com reports the package name as slightly abbreviated `xterm-348-1`. – user2153235 Jan 26 '20 at 13:36

2 Answers2

1

xterm's -report-fonts option shows details on the font used.

There's a script find-xterm-fonts (which knows about Debian- and RPM-packages) that can show the package names used for the fonts (see example). Cygwin sort of neglects the command-line packaging tools which would make scripting this feature simple. You could modify the script to make it work with cygcheck, e.g., using the -f option:

   -f, --find-package   find the package to which FILE belongs

The script attempts to report the package containing font-files which have been found. Bitmap fonts are on the machine which runs the X server, so if you are running/displaying locally, the script can access all of the needed information.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • Thanks, Thomas. I'm going to update my question with what I found using `-report-fonts`. I followed both your links, but they cite each other. Wondering if I'm missing something. Is there a script somewhere?\ – user2153235 Jan 26 '20 at 01:14
0

For Lucida, I will try xorg-x11-fonts-dpi100 and 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
...

For my Lucida Fonts I am using the Windows font

 $ 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

For the fixed one you can try terminus-fonts or 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
matzeri
  • 8,062
  • 2
  • 15
  • 16
  • I appreciate the information that you've shared. It will help in exploring the fonts. This question was about how to identify a font that xterm is using, and whether there is an efficient way to identify a package once the font is known. It looks like the only way to do the latter is to go by package name, which looks quite informative. – user2153235 Jan 25 '20 at 04:38
  • It's in a tar-file linked in [Downloads](https://invisible-island.net/datafiles/release/misc-scripts.tar.gz). – Thomas Dickey Jan 26 '20 at 01:47