[arch-general] How to specify a Type 1 font in .Xresources?
When I execute "fc-list : file" (as stated at https://wiki.archlinux.org/index.php/Font_Configuration ) one of the lines is: /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb: How do I now tell a particular class of xterm to use this font? In the ~/.Xresources I have a class called "drlog", and so I have a line that starts: ---- drlog*VT100*font: ---- but what do I put after the colon to force this class to use the font in the file /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb? Doc -- Web: http://www.sff.net/people/N7DR
On 31 October 2012 01:11, D. R. Evans <doc.evans@gmail.com> wrote:
When I execute "fc-list : file" (as stated at https://wiki.archlinux.org/index.php/Font_Configuration )
one of the lines is: /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb:
How do I now tell a particular class of xterm to use this font?
In the ~/.Xresources I have a class called "drlog", and so I have a line that starts:
---- drlog*VT100*font: ----
but what do I put after the colon to force this class to use the font in the file /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb?
There are two types of font systems in Linux/X11. So the answer depends on what application you need it for. One is the old style X11 (core) fonts - rarely used nowdays. You get a list of those fonts with xlsfonts. You'll get an ugly string like: -misc-fixed-medium-r-semicondensed--0-0-75-75-c-0-iso8859-1 which is the font identifier. XFT/Fontconfig - you get a list of fonts with fc-list. In config files you ussually specify the font either with "DejaVu Sans 10" or in some apps "xft:DejaVu Sans Mono:pixelsize=14" depends on the application -- damjan
Damjan Georgievski said the following at 10/31/2012 08:24 AM :
There are two types of font systems in Linux/X11. So the answer depends on what application you need it for.
How can I tell which system I am using in the application? The application uses plain old xlib calls. (Indeed, I don't know any other way to write reliable low-level X code, but I can't say I've looked very hard.) Doc -- Web: http://www.sff.net/people/N7DR
On сре, 31 окт 2012 16:19:17 CET, D. R. Evans wrote:
Damjan Georgievski said the following at 10/31/2012 08:24 AM :
There are two types of font systems in Linux/X11. So the answer depends on what application you need it for.
How can I tell which system I am using in the application? The application uses plain old xlib calls. (Indeed, I don't know any other way to write reliable low-level X code, but I can't say I've looked very hard.)
You can tell the name of the program for one. Secondly, you can check if it links to /usr/lib/libXft.so.2 or /usr/lib/libfontconfig.so.1 Anyway, assuming your application uses X11 core fonts, xlsfonts will list them all. The Xorg server has bult-in support for TrueType, Type1 and bitmap fonts, and a default search path for them (check for "FontPath set to" in the /var/log/Xorg.0.log file). Fonts installed by packages are usually automatically available. -- дамјан
Damjan said the following at 10/31/2012 12:08 PM :
Anyway, assuming your application uses X11 core fonts, xlsfonts will list them all. The Xorg server has bult-in support for TrueType, Type1 and bitmap fonts, and a default search path for them (check for "FontPath set to" in the /var/log/Xorg.0.log file). Fonts installed by packages are usually automatically available.
0a. "xlsfonts" returns 3730 lines of fonts. How do I tell whether the font contained in ufonts.com_ti92pluspc.pfb is one of them? Grepping for, for example, "ti92" or "ufont" returns no hits, but perhaps neither of those strings is relevant, since those are in the file name, not necessarily the font name. So how can I tell what name to search for? 0b. If I open ufonts.com_ti92pluspc.pfb with KFontFiew, then it calls the font "Ti92Pluspc, Regular". But if I execute "xlsfonts | grep [Pp]lus" I still get no hits. 1. There is no /var/log/Xorg.0.log file. (I saw that the wiki entry at https://wiki.archlinux.org/index.php/Font_Configuration says to check this, so I had already tried to do that and discovered that the file doesn't exist.) 2. Executing "xset q" tells me (slightly reformatted so as to avoid wrapping issues): FontPath: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/75dpi/:unscaled, /usr/share/fonts/X11/Type1, /usr/share/fonts/X11/100dpi, /usr/share/fonts/X11/75dpi, /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, built-ins 3. The font I want to use is in one of those directories: $ ls -al /usr/share/fonts/X11/Type1 total 76 drwxr-xr-x 2 root root 4096 Oct 30 17:50 . drwxr-xr-x 3 root root 4096 Oct 30 17:50 .. -rw-r--r-- 1 root root 184 Oct 30 17:50 fonts.dir -rw-r--r-- 1 root root 184 Oct 30 17:50 fonts.scale -rw-r--r-- 1 root root 58184 Oct 30 17:50 ufonts.com_ti92pluspc.pfb $ So that suggests that the font should be available. But I have no idea: a) how to check that it is in fact available; nor b) what to put in the .Xresources file so that the xterm class uses it As usual, I have looked at a lot of UNIX font-related web pages before ever posting here, but they are so contradictory and ambiguous that they were worse than useless. Doc -- Web: http://www.sff.net/people/N7DR
0b. If I open ufonts.com_ti92pluspc.pfb with KFontFiew, then it calls the font "Ti92Pluspc, Regular". But if I execute "xlsfonts | grep [Pp]lus" I still get no hits.
1. There is no /var/log/Xorg.0.log file. (I saw that the wiki entry at https://wiki.archlinux.org/index.php/Font_Configuration says to check this, so I had already tried to do that and discovered that the file doesn't exist.)
notimportant but interesting?? Xorg.1.log maybe.
2. Executing "xset q" tells me (slightly reformatted so as to avoid wrapping issues): FontPath: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/75dpi/:unscaled, /usr/share/fonts/X11/Type1, /usr/share/fonts/X11/100dpi, /usr/share/fonts/X11/75dpi, /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, built-ins
hmm, why is it /usr/share/fonts/X11/ it's just /usr/share/fonts/ here
3. The font I want to use is in one of those directories: $ ls -al /usr/share/fonts/X11/Type1 total 76 drwxr-xr-x 2 root root 4096 Oct 30 17:50 . drwxr-xr-x 3 root root 4096 Oct 30 17:50 .. -rw-r--r-- 1 root root 184 Oct 30 17:50 fonts.dir -rw-r--r-- 1 root root 184 Oct 30 17:50 fonts.scale -rw-r--r-- 1 root root 58184 Oct 30 17:50 ufonts.com_ti92pluspc.pfb $
grep ti92 /usr/share/fonts/X11/Type1/fonts.dir -- damjan
D. R. Evans said the following at 10/30/2012 06:11 PM :
When I execute "fc-list : file" (as stated at https://wiki.archlinux.org/index.php/Font_Configuration )
one of the lines is: /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb:
How do I now tell a particular class of xterm to use this font?
In the ~/.Xresources I have a class called "drlog", and so I have a line that starts:
---- drlog*VT100*font: ----
but what do I put after the colon to force this class to use the font in the file /usr/share/fonts/Type1/ufonts.com_ti92pluspc.pfb?
I never found any kind of step-by-step guide or even anything that suggested the solution that actually worked, but I suppose if one fumbles around at random there's a non-zero chance that one will stumble across the solution to a problem. The answer I discovered is not to use a font resource at all, but rather the faceName and a faceSize resources, setting the faceName resource to the basic name provided by KFontView when it is used to open the pfb font file. In this case that meant setting faceName to "Ti92Pluspc" (although the full name returned by KFontView was "Ti92Pluspc, Regular"). Doc -- Web: http://www.sff.net/people/N7DR
participants (3)
-
D. R. Evans
-
Damjan
-
Damjan Georgievski