Re: [gentoo-user] X11 server not seeing font dirs
On 11/21/20 7:02 PM, k...@aspodata.se wrote: $ xlsfonts | grep -i mono $ xset +fp /usr/share/fonts/freefont $ xlsfonts | grep -i mono | head -1 -misc-freemono-bold-o-normal--0-0-0-0-m-0-adobe-standard $ I.e. it works as expected. Okay, that's good to know. I'm unfortunately not at the machine that was giving me problems, I'll to through those exact steps in a week or two. # emerge -aqv media-fonts/courier-prime ... $ xset +fp /usr/share/fonts/courier-prime $ xset q | grep prime /usr/share/fonts/courier-prime,/usr/share/fonts/freefont,/usr/local/share/fonts,/usr/share/fonts/misc/,/usr/share/fonts/OTF/,/usr/share/fonts/Type1/,/usr/share/fonts/100dpi/,/usr/share/fonts/75dpi/,built-ins $ xlsfonts | grep -i prime $ So my courier-prime fp doesn't dissapear, but xlsfonts doesn't report them as a core font. I run fvwm2 on an older X without udev, can it be a fancy modern destop that changes this under the hood for you ? I run fvwm2, too. :-) I can see the font with $ fc-list 'Courier prime' /usr/share/fonts/courier-prime/Courier Prime Bold.ttf: Courier Prime:style=Bold /usr/share/fonts/courier-prime/Courier Prime.ttf: Courier Prime:style=Regular /usr/share/fonts/courier-prime/Courier Prime Bold Italic.ttf: Courier Prime:style=Bold Italic /usr/share/fonts/courier-prime/Courier Prime Italic.ttf: Courier Prime:style=Italic Isn't the fontconfig system a separate, disconnected font service? $ xfd -fa 'Courier prime' ... I don't have that command and didn't find a man page right away on the internet. I see there's a gentoo package for it, it looks useful. Can the problem be that there is a space in the x core font name? I renamed the files in the courier-prime package with dashes and regenerated fonts.dir and the other one, too. Didn't help. $ head -2 /usr/share/fonts/courier-prime/fonts.dir 16 Courier prime bold italic.ttf -misc-courier prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 $ If I, as root, do: cd /usr/share/fonts/courier-prime/ perl -wpi.bak -e 'tr/ /_/; s/_-/ -/' fonts.dir perl -wpi.bak -e 'tr/ /_/; s/_-/ -/' fonts.scale list=`ls -1 | grep Cour | tr ' ' '_'` for i in $list; do b=`echo $i | tr '_' ' '`; mv "$b" $i; done Then I can do: $ xset fp rehash I used my fixms(1) script (attached). $ xlsfonts | grep -i prime | head -1 -misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 $ xfd -fn -misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 Warning: Missing charsets in String to FontSet conversion Warning: Unable to load any usable fontset Warning: Cannot convert string "-misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1" to type FontStruct xfd: no font to display $ xterm -fn -misc-courier_prime-medium-r-normal--17-120-100-100-m-0-iso10646-1 xterm: cannot load font "-misc-courier_prime-medium-r-normal--17-120-100-100-m-0-iso10646-1" Unfortunately, I cannot use it... I don't think x likes core fonts with spaces in font- nor filenames. Regards, /Karl Hammar Okay, I didn't get that far. I'll try to get more documentation. Thanks for looking into it. #!/usr/bin/env bash for f in "$@"; do if [ -r "$f" ]; then tgt=$(echo "$f" | tr " " '-' | tr -d "'") if [ $tgt = "$f" ]; then continue fi echo mv "$f" $tgt if [ -f $tgt ]; then echo "$0: $tgt exists" >&2 exit 1 fi echo -n "Move [ny]?" read answer case "$answer" in [yY]|[yY]es|[yY]ES) /bin/mv "$f" $tgt ;; esac else echo "$0: $f not readable" >&2 fi done
Re: [gentoo-user] X11 server not seeing font dirs
n952162: > Can anyone say why I have the error messages in my Xorg.0.log file that > I list below? > > xlsfonts(1) does not list fonts that are in /usr/share/fonts. > > If I add them with "xset +fp /usr/share/fonts/courier-prime" they appear > and then disappear in the "xset -q" display. They are not available to > xlsfonts, though. > > Interestingly enough, adding them with the plus in back: "xset fp+ > /user/..." causes them to persist, but still not be available to xlsfonts. ... $ xlsfonts | grep -i mono $ xset +fp /usr/share/fonts/freefont $ xlsfonts | grep -i mono | head -1 -misc-freemono-bold-o-normal--0-0-0-0-m-0-adobe-standard $ I.e. it works as expected. # emerge -aqv media-fonts/courier-prime ... $ xset +fp /usr/share/fonts/courier-prime $ xset q | grep prime /usr/share/fonts/courier-prime,/usr/share/fonts/freefont,/usr/local/share/fonts,/usr/share/fonts/misc/,/usr/share/fonts/OTF/,/usr/share/fonts/Type1/,/usr/share/fonts/100dpi/,/usr/share/fonts/75dpi/,built-ins $ xlsfonts | grep -i prime $ So my courier-prime fp doesn't dissapear, but xlsfonts doesn't report them as a core font. I run fvwm2 on an older X without udev, can it be a fancy modern destop that changes this under the hood for you ? I can see the font with $ fc-list 'Courier prime' /usr/share/fonts/courier-prime/Courier Prime Bold.ttf: Courier Prime:style=Bold /usr/share/fonts/courier-prime/Courier Prime.ttf: Courier Prime:style=Regular /usr/share/fonts/courier-prime/Courier Prime Bold Italic.ttf: Courier Prime:style=Bold Italic /usr/share/fonts/courier-prime/Courier Prime Italic.ttf: Courier Prime:style=Italic $ xfd -fa 'Courier prime' ... Can the problem be that there is a space in the x core font name? $ head -2 /usr/share/fonts/courier-prime/fonts.dir 16 Courier prime bold italic.ttf -misc-courier prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 $ If I, as root, do: cd /usr/share/fonts/courier-prime/ perl -wpi.bak -e 'tr/ /_/; s/_-/ -/' fonts.dir perl -wpi.bak -e 'tr/ /_/; s/_-/ -/' fonts.scale list=`ls -1 | grep Cour | tr ' ' '_'` for i in $list; do b=`echo $i | tr '_' ' '`; mv "$b" $i; done Then I can do: $ xset fp rehash $ xlsfonts | grep -i prime | head -1 -misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 $ xfd -fn -misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1 Warning: Missing charsets in String to FontSet conversion Warning: Unable to load any usable fontset Warning: Cannot convert string "-misc-courier_prime-bold-i-normal--0-0-0-0-m-0-iso10646-1" to type FontStruct xfd: no font to display $ xterm -fn -misc-courier_prime-medium-r-normal--17-120-100-100-m-0-iso10646-1 xterm: cannot load font "-misc-courier_prime-medium-r-normal--17-120-100-100-m-0-iso10646-1" Unfortunately, I cannot use it... I don't think x likes core fonts with spaces in font- nor filenames. Regards, /Karl Hammar
[gentoo-user] X11 server not seeing font dirs
Can anyone say why I have the error messages in my Xorg.0.log file that I list below? xlsfonts(1) does not list fonts that are in /usr/share/fonts. If I add them with "xset +fp /usr/share/fonts/courier-prime" they appear and then disappear in the "xset -q" display. They are not available to xlsfonts, though. Interestingly enough, adding them with the plus in back: "xset fp+ /user/..." causes them to persist, but still not be available to xlsfonts. An inspection of /var/log/Xorg.0.log shows this: [ 663.033] (WW) The directory "/usr/share/fonts/TTF/" does not exist. [ 663.033] Entry deleted from font path. [ 663.033] (WW) The directory "/usr/share/fonts/OTF/" does not exist. [ 663.033] Entry deleted from font path. [ 663.033] (WW) The directory "/usr/share/fonts/Type1/" does not exist. [ 663.033] Entry deleted from font path. [ 663.033] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/". [ 663.033] Entry deleted from font path. [ 663.033] (Run 'mkfontdir' on "/usr/share/fonts/100dpi/"). [ 663.033] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/". [ 663.033] Entry deleted from font path. [ 663.033] (Run 'mkfontdir' on "/usr/share/fonts/75dpi/"). [ 663.033] (==) FontPath set to: /usr/share/fonts/misc/ These directories all exist and have populated fonts.dir and fonts.scale files in them.