home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
215.lha
/
FTS
/
Fts.Doc
< prev
next >
Wrap
Text File
|
1996-02-15
|
6KB
|
153 lines
FTS: list fonts and their attributes
`fts' lists information that the system gives it about the fonts located
in "FONTS:". The listing is sorted by font names and sizes. The output
has 5 columns, like this:
Name Size Type Style Flags
The `Name' column shows the font name.
The `Size' column prints in decimal the font size given by the value
in the ta_YSize field in the TextAttr structure. It's a measure of the
height of the font in pixels.
The `Type' column shows where the font is located, and has two fields, "dm",
shown below. Its information comes from af_Type in the AvailFont structure:
d disk AFF_DISK
m memory AFF_MEMORY
The `Style' column has four fields, "ubie", shown below. Its information
comes from ta_Style in the TextAttr structure:
e extended FSF_EXTENDED
i italic FSF_ITALIC
b bold FSF_BOLD
u underline FSF_UNDERLINED
Finally, the `Flags' column has 8 fields, "xspwtbdr", which come from the
ta_Flags field in the TextAttr structure:
x removed FPF_REMOVED
s designed FPF_DESIGNED
p proportional FPF_PROPORTIONAL
w wide dot FPF_WIDEDOT
t tall dot FPF_TALLDOT
b backwards FPF_REVPATH
d disk font FPF_DISKFONT
r rom font FPF_ROMFONT
To show how to invoke `fts', here is the usage information from `fts':
1> fts -?
Use: fts -t[dm] -s[eibu] -f[xspwtbdr] -y# -n(name) -S
Type: -t d = disk m = memory
Style: -s e = extended i = italics
b = bold u = underline
Flags: -f x = removed s = designed
p = proportional w = wide dot
t = tall dot b = backwards
d = disk font r = rom
Size: -y# where `#' is YSize of the font
Name: -n... where `...' is the font name
Sort: -S = sort by size instead of name
Calling `fts' with no arguments will print all the fonts the system
finds under "FONTS:". At the end of the list, it reports the number
of selected fonts and the total number of fonts on the system.
The listing is sorted by name, and fonts with the same name are sorted
by size. To sort the listing by size instead of name, use the -S switch.
When sorting by size, fonts of the same size are sorted by name.
The decision to print a font or not works like this:
- if the size doesn't match, the font isn't printed
- if the name doesn't match, the font isn't printed
- if the font attributes matches ANY of the requested attributes,
then font is printed
Note that "-tdm" does NOT give fonts that are both in memory and on disk,
it gives all fonts that are either in memory or on disk (i.e. all fonts).
Here is a shortened sample output:
1> fts
Font Name Size Type Style Flags
clean 8 dm ---- -s----dr
...
Helvetica 9 d- ---- -sp---d-
Helvetica 11 d- ---- -sp---d-
Helvetica 13 d- ---- -sp---d-
Helvetica 15 d- ---- -sp---d-
Helvetica 18 d- ---- -sp---d-
Helvetica 24 d- ---- -sp---d-
...
topaz 8 -m ---- -s-----r
topaz 9 -m e--- -s--t--r
65 / 66 fonts.
Note that `fts' will combine a disk-based and memory-based font on the
same line, if all other attributes are the same (e.g. the "clean" font).
Because of this, it says that 65 fonts were listed, although there are
66 available.
Also, `fts' shows the ROM based fonts, "topaz 8" and "topaz 9" (the Type
is `m' which means in-memory, and the rom-font Flag is set.)
Here's another example, in which we sort by size, and ask for the fonts
whose name begins with `cmr':
1> fts -ncmr -S
Font Name Size Type Style Flags
cmr6 26 d- ---- -sp---d-
cmr8 34 d- ---- -sp---d-
cmr10 42 d- ---- -sp---d-
cmr12 50 d- ---- -sp---d-
cmr14 59 d- ---- -sp---d-
5 / 66 fonts.
And a case where we ask for the in-memory fonts:
1> fts -tm
Font Name Size Type Style Flags
clean 8 dm ---- -s----dr
topaz 8 -m ---- -s-----r
topaz 9 -m e--- -s--t--r
3 / 66 fonts.
And another case where we ask for the "tall-dot" fonts, sorted by size:
1> fts -ft -S
Font Name Size Type Style Flags
topaz 9 -m e--- -s--t--r
boarder 13 d- e--- -s--t-dr
2 / 66 fonts.
Some future things to consider:
- performance: sort after select (?)
- collect on same line the same font with different sizes (how?)
- specify alternate "FONT:" path (via 'assign's?)
- specify and/or combinations of arguments (is this needed?)
- specify keyword arguments (i.e. "style bold") (like CLI commands)
- reallocate avail-font structure if it's not big enough
There is a compile-time option, FTS_LARGE, which adds in the selection,
help, and sort features. If you want a smaller version, just compile it
plain; if you want all the options, compile with "-DFTS_LARGE".
These are the sizes I get, compiling with Lattice 5.0:
fts.lrg 9068 ----rwed Today 20:58:39
fts.sm 7640 ----rwed Today 20:56:07
The buffer that I give the system to place the font information in
is 2000 bytes long. I believe that it should hold information for
199 fonts, but I haven't tested this. If you get the message "Some
fonts not gotten...", then increase the parameter AFSIZE from 2000L
to ((10 * number-of-fonts) + 2).
I haven't checked on the validity of all the flag/style/type bits,
but they look reasonable to me. There are no bugs that I know of,
but please let me know if something goes wrong, or if it just
doesn't seem to work right!
Mike Hall att!cuuxb!migh
2 S 461 Cherice Dr. 312-393-6350
Warrenville, IL 60555