home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 215.lha / FTS / Fts.Doc < prev    next >
Text File  |  1996-02-15  |  6KB  |  153 lines

  1.  
  2.  
  3.         FTS: list fonts and their attributes
  4.  
  5. `fts' lists information that the system gives it about the fonts located 
  6. in "FONTS:".  The listing is sorted by font names and sizes.  The output 
  7. has 5 columns, like this:
  8.  
  9.     Name  Size  Type  Style  Flags
  10.  
  11. The `Name' column shows the font name.
  12.  
  13. The `Size' column prints in decimal the font size given by the value
  14. in the ta_YSize field in the TextAttr structure.  It's a measure of the 
  15. height of the font in pixels.
  16.  
  17. The `Type' column shows where the font is located, and has two fields, "dm",
  18. shown below.  Its information comes from af_Type in the AvailFont structure:
  19.  
  20.     d    disk        AFF_DISK
  21.     m    memory        AFF_MEMORY
  22.  
  23. The `Style' column has four fields, "ubie", shown below.  Its information
  24. comes from ta_Style in the TextAttr structure:
  25.  
  26.     e    extended    FSF_EXTENDED
  27.     i    italic        FSF_ITALIC
  28.     b    bold        FSF_BOLD
  29.     u    underline    FSF_UNDERLINED
  30.     
  31. Finally, the `Flags' column has 8 fields, "xspwtbdr", which come from the
  32. ta_Flags field in the TextAttr structure:
  33.  
  34.     x    removed        FPF_REMOVED
  35.     s    designed    FPF_DESIGNED
  36.     p    proportional    FPF_PROPORTIONAL
  37.     w    wide dot    FPF_WIDEDOT
  38.     t    tall dot    FPF_TALLDOT
  39.     b    backwards    FPF_REVPATH
  40.     d    disk font    FPF_DISKFONT
  41.     r    rom font    FPF_ROMFONT
  42.  
  43. To show how to invoke `fts', here is the usage information from `fts':
  44.     1> fts -?
  45.     Use:  fts  -t[dm] -s[eibu] -f[xspwtbdr] -y# -n(name) -S
  46.         Type:    -t    d = disk        m = memory
  47.         Style:    -s    e = extended        i = italics
  48.                 b = bold        u = underline
  49.         Flags:    -f    x = removed        s = designed
  50.                 p = proportional    w = wide dot
  51.                 t = tall dot        b = backwards
  52.                 d = disk font        r = rom
  53.         Size:    -y#    where `#' is YSize of the font
  54.         Name:    -n...    where `...' is the font name
  55.         Sort:    -S = sort by size instead of name
  56.  
  57. Calling `fts' with no arguments will print all the fonts the system
  58. finds under "FONTS:".  At the end of the list, it reports the number
  59. of selected fonts and the total number of fonts on the system.
  60.  
  61. The listing is sorted by name, and fonts with the same name are sorted
  62. by size.  To sort the listing by size instead of name, use the -S switch.
  63. When sorting by size, fonts of the same size are sorted by name.
  64.  
  65. The decision to print a font or not works like this:
  66.     - if the size doesn't match, the font isn't printed
  67.     - if the name doesn't match, the font isn't printed
  68.     - if the font attributes matches ANY of the requested attributes,
  69.       then font is printed
  70. Note that "-tdm" does NOT give fonts that are both in memory and on disk,
  71. it gives all fonts that are either in memory or on disk (i.e. all fonts).
  72.  
  73. Here is a shortened sample output:
  74.     1> fts
  75.     Font Name          Size Type Style  Flags
  76.     clean                   8   dm  ----  -s----dr
  77.      ...
  78.     Helvetica               9   d-  ----  -sp---d-
  79.     Helvetica              11   d-  ----  -sp---d-
  80.     Helvetica              13   d-  ----  -sp---d-
  81.     Helvetica              15   d-  ----  -sp---d-
  82.     Helvetica              18   d-  ----  -sp---d-
  83.     Helvetica              24   d-  ----  -sp---d-
  84.      ...
  85.     topaz                   8   -m  ----  -s-----r
  86.     topaz                   9   -m  e---  -s--t--r
  87.     65 / 66 fonts.
  88.  
  89. Note that `fts' will combine a disk-based and memory-based font on the
  90. same line, if all other attributes are the same (e.g. the "clean" font).
  91. Because of this, it says that 65 fonts were listed, although there are
  92. 66 available.
  93.  
  94. Also, `fts' shows the ROM based fonts, "topaz 8" and "topaz 9" (the Type
  95. is `m' which means in-memory, and the rom-font Flag is set.)
  96.  
  97. Here's another example, in which we sort by size, and ask for the fonts
  98. whose name begins with `cmr':
  99.     1> fts -ncmr -S 
  100.     Font Name          Size Type Style  Flags
  101.     cmr6                   26   d-  ----  -sp---d-
  102.     cmr8                   34   d-  ----  -sp---d-
  103.     cmr10                  42   d-  ----  -sp---d-
  104.     cmr12                  50   d-  ----  -sp---d-
  105.     cmr14                  59   d-  ----  -sp---d-
  106.     5 / 66 fonts.
  107.  
  108. And a case where we ask for the in-memory fonts:
  109.     1> fts -tm
  110.     Font Name          Size Type Style  Flags
  111.     clean                   8   dm  ----  -s----dr
  112.     topaz                   8   -m  ----  -s-----r
  113.     topaz                   9   -m  e---  -s--t--r
  114.     3 / 66 fonts.
  115.  
  116. And another case where we ask for the "tall-dot" fonts, sorted by size:
  117.     1> fts -ft -S
  118.     Font Name          Size Type Style  Flags
  119.     topaz                   9   -m  e---  -s--t--r
  120.     boarder                13   d-  e---  -s--t-dr
  121.     2 / 66 fonts.
  122.  
  123. Some future things to consider:
  124.     - performance: sort after select (?)
  125.     - collect on same line the same font with different sizes (how?)
  126.     - specify alternate "FONT:" path (via 'assign's?)
  127.     - specify and/or combinations of arguments (is this needed?)
  128.     - specify keyword arguments (i.e. "style bold") (like CLI commands)
  129.     - reallocate avail-font structure if it's not big enough
  130.  
  131. There is a compile-time option, FTS_LARGE, which adds in the selection,
  132. help, and sort features.  If you want a smaller version, just compile it
  133. plain; if you want all the options, compile with "-DFTS_LARGE".
  134. These are the sizes I get, compiling with Lattice 5.0:
  135.     fts.lrg          9068 ----rwed Today     20:58:39
  136.     fts.sm           7640 ----rwed Today     20:56:07
  137.  
  138. The buffer that I give the system to place the font information in
  139. is 2000 bytes long.  I believe that it should hold information for
  140. 199 fonts, but I haven't tested this.  If you get the message "Some
  141. fonts not gotten...", then increase the parameter AFSIZE from 2000L
  142. to ((10 * number-of-fonts) + 2).
  143.  
  144. I haven't checked on the validity of all the flag/style/type bits,
  145. but they look reasonable to me.  There are no bugs that I know of,
  146. but please let me know if something goes wrong, or if it just
  147. doesn't seem to work right!
  148.  
  149. Mike Hall            att!cuuxb!migh
  150. 2 S 461 Cherice Dr.        312-393-6350
  151. Warrenville, IL 60555
  152.  
  153.