Hi:
I am having some trouble creating an of font names in Ksh (public Korn Shell).
The font names are likes this and are the output of xlsfonts (a
program that is part of X)
-adobe-avantgarde-book-o-normal--0-0-0-0-p-0-iso8859-1
-adobe-avantgarde-book-r-normal--0-0-0-0-p-0-iso8859-1
-adobe-avantgarde-demibold-o-normal--0-0-0-0-p-0-iso8859-1
-adobe-avantgarde-demibold-r-normal--0-0-0-0-p-0-iso8859-1
-adobe-bookman-demibold-i-normal--0-0-0-0-p-0-iso8859-1
-adobe-bookman-demibold-r-normal--0-0-0-0-p-0-iso8859-1
-adobe-bookman-light-i-normal--0-0-0-0-p-0-iso8859-1
-adobe-bookman-light-r-normal--0-0-0-0-p-0-iso8859-1
-adobe-courier-bold-o-normal--0-0-0-0-p-0-iso8859-1
-adobe-courier-bold-o-normal--10-100-75-75-m-60-iso10646-1
The X program xfd will show you the details of these fonts. Run it like so:
$ xfd -fn -adobe-avantgarde-demibold-o-normal--0-0-0-0-p-0-iso8859-1
and a GUI will come up and show you the details of this font.
Now I want to store a bunch of these fonts in an array (or by some
other means). The easy way to store these in Korn Shell is to do:
set -A Array_Foo one two three ....
and then you can use Array_Foo to access thes guys. So I do the following
$ set -A Fonts $(xlsfonts)
ksh: set: -d: unknown option
and Wooops! It interprets the -ad, of
-adobe-avantgarde-book-o-normal--0-0-0-0-p-0-iso8859-1 as a flag.
Furthemore I can't escape it. I should say I can't figure out how to
escape it.
So scratch that Idea and switch to Awk. I write the following awk
script; very simple:
{
N=split($0,A)
for(i=1; i <= N; i++)
print(A[i])
}
The command split creates an array from the input line ($0 is the
entire record). It stores the number of fields in N. I then do:
$ awk -f xfd.awk $(xlsfonts) | xargs xfd -fn
ksh: awk: Argument list too long
so I then do:
$ xlsfonts > furk.txt
and trim that to about 25 fonts. I then do:
$ awk -f xfd.awk furk.txt | xargs xfd -fn
usage: xfd [-options ...] -fn font
xfd [-options ...] -fa font
and I can't get it to work.
How do I get a shell script to go through 25 or so fonts so I can
look at the xfd gui and then cloes it and look at the next one?
TIA
Jon
_______________________________________________
CWE-LUG mailing list
http://www.cwelug.org/
[email protected]
http://lists.firepipe.net/listinfo/cwe-lug