On Fri, Aug 05, 2022 at 11:25:44AM +0200, Matthieu Herrb wrote:
> On Thu, Aug 04, 2022 at 04:42:57PM +0200, Walter Alejandro Iglesias wrote:
> > Run xterm with the default system Xresources, open the "VT Fonts" dialog
> > (holding down Ctrl and pressing right mouse button) check TrueType
> > Fonts.  At least to me, fontconfig writes the following error:
> > 
> >   $ xterm
> >   Fontconfig error: Cannot load default config file: No such file: (null)
> > 
> > Even if you implicitly set the variables the result is the same:
> > 
> >   $ export FONTCONFIG_FILE=/etc/fonts/fonts.conf
> >   $ export FONTCONFIG_PATH=/etc/fonts
> >   $ xterm -xrm xterm*renderFont:false
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Try without this option.

> >   Fontconfig error: Cannot load default config file: No such file:
> >   (null)
> 
> You must have caused some damage to the default installation.
> Did you check that /etc/fonts/fonts.conf still exists and is readable
> by everyone ? (and that the directories /etc and /etc/fonts still have
> the correct mode).

The first time I thought that, I'd installed from a miniroot image with
a bad conection.  Then I downloaded the install image, checked with
SHA256, reinstalled the system and the issue didn't go.  Tell me if
something is wrong with this:

# ls -ld /etc /etc/fonts
drwxr-xr-x  35 root  wheel  2048 Aug  5 10:53 /etc
drwxr-xr-x   4 root  wheel   512 Aug  4 13:41 /etc/fonts
# ls -l /etc/fonts
total 36
drwxr-xr-x  2 root  wheel  1536 Aug  3 01:09 conf.avail
drwxr-xr-x  2 root  wheel  1024 Aug  3 08:52 conf.d
-r--r--r--  1 root  bin    2699 Aug  3 01:08 fonts.conf
-r--r--r--  1 root  bin    8254 Aug  3 01:08 fonts.dtd

I don't modify system files unless I really need to do it.  I didn't
touch those files, nor the files in /etc/X11R6.  I do all customizations
in my home directory.  Anyways, if none else can reproduce this bug I'll
reinstall the system once again and, being sure of not touching anything,
I'll let you know if I can reproduce this bug.

> 
> > 
> > Another issue I can reproduce with xterm is running it with a xft font
> > and selecting in the same mentioned dialog the "Unreadable" font:
> > 
> >   $ xterm -fa "DejaVu Sans Mono"
> >   xterm: Selected font has no valid height for ISO-8859-1 encoding
> >   xterm: Selected font has no valid width for ISO-8859-1 encoding
> > 
> > 
> > Finally, the following issue doesn't affect the mentioned bug, but cause
> > some problems in some applications.  I noticed that this directory:
> > 
> >   /usr/X11R6/lib/X11/fonts/misc/
> > 
> > is *far* more populated in Debian than in OpenBSD, so I copied those fonts
> > from Debian to OpenBSD, and this solved encoding errors in fvwm2, for
> > example.  I don't know if those fonts were removed upstream or by some
> > OpenBSD maintainer to win space.  Be aware that even when OpenBSD
> > supports only UTF-8 those fonts are still needed by some applications.
> > 
> 
> We removed all bitmapped fonts with encodings other than iso8859-1 and
> utf8 last year.  The ISO-8859-1 are still there. I can't reproduce the
> error message that you show with xterm, so either you also have a
> damaged /usr/X11R6 or there is some other setting in your environment
> that cauases that.
> 
> I know that some applications using libXfont2 will complain if they
> can't find easter european, koi8 or iso1022-jp encoded bitmap fonts,
> but we've not yet found an application in ports where these message
> cause it to mal-function.
> 
> There are fonts with those encoding available in ports (and it's still
> possible to package the fonts with extra encodings  in ports if there
> is a real need -- but it didn't show up yet).

So far I can mention three: fvwm2, fvwm3 and twm.  I bet that if you let
me investigate a bit I'll find more. :-)

fvwm2 shows these errors:

$ cat ~/.xsession-errors
[...]
[fvwm][FlocaleGetFontSet]: 
(-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-16-*-*-*-*-*-*-*)
 Missing font charsets:
ISO8859-14
[fvwm][FlocaleGetFontSet]: 
(-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,*) Missing font charsets:
ISO8859-14
[fvwm][FlocaleGetFontSet]: (-*-fixed-bold-*-*-*-13-*-*-*-*-*-*-*,*) Missing 
font charsets:
ISO8859-14
[FvwmIconMan][FlocaleGetFontSet]: 
(-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,*) Missing font charsets:
ISO8859-14
[FvwmIconMan][FlocaleGetFontSet]: 
(-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-16-*-*-*-*-*-*-*)
 Missing font charsets:
ISO8859-14
[FvwmPager][FlocaleGetFontSet]: 
(-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,*) Missing font charsets:
ISO8859-14

And is unable to render menus correctly without those fonts.  fvwm3 in
ports doesn't report the errors but it's also unable to render the fonts
and menus correctly.

Despite fvwm1, twm can render utf-8 titles.  But not without the full
misc set.  Try the following:

$ echo 'TitleFont "-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*"' > ~/.twmrc
$ echo '<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>This is a euro symbol: €</title>
</head>
<body>
<p>This is a euro symbol: €</p>
</body>
</html>' > ~/Downloads/example.html
$ echo 'xterm &
twm' > ~/.xinitrc
$ startx

Or restart xenodm.  Once on X run:
$ firefox ~/Downloads/example.html 

Do you see the euro symbol in the title?

Now, download the full "misc" set from here:

  https://en.roquesor.com/Downloads/misc.tar.gz

Untar it in your local font path:

 $ tar xvfz misc.tar.gz ~/.local/share/fonts/

Load those fonts
 
 $ xset +fp ~/.local/share/fonts/misc

Restart twm.  Now you should see the euro symbol with the same fixed
font.


> -- 
> Matthieu Herrb


   Walter

Reply via email to