You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1684 lines
75KB

  1. _____ ___ ____ __ _
  2. | ___||_ _|/ ___| / _| ___ _ __ | |_ ___ _
  3. | |_ | || | _ | |_ / _ \ | '_ \ | __|/ __|(_)
  4. | _| | || |_| || _|| (_) || | | || |_ \__ \ _
  5. |_| |___|\____||_| \___/ |_| |_| \__||___/(_)
  6. The FIGfont Version 2 FIGfont and FIGdriver Standard
  7. === ======= ======= = ======= === ========= ========
  8. Draft 2.0 Copyright 1996, 1997
  9. by John Cowan and Paul Burton
  10. Portions Copyright 1991, 1993, 1994
  11. by Glenn Chappell and Ian Chai
  12. May be freely copied and distributed.
  13. _____ __ __
  14. / ___/__ ___ / /____ ___ / /____
  15. / /__/ _ \/ _ \/ __/ -_) _ \/ __(_-<
  16. \___/\___/_//_/\__/\__/_//_/\__/___/
  17. INTRODUCTION
  18. BASIC DEFINITIONS AND CONCEPTS
  19. "FIGfont"
  20. "FIGcharacters" and "Sub-characters"
  21. "FIGdriver"
  22. "FIGure"
  23. "FIG"
  24. "Layout Modes"
  25. "Smushing Rules"
  26. "Hardblanks"
  27. CREATING FIGFONTS
  28. The Header Line
  29. Interpretation of Layout Parameters
  30. Setting Layout Parameters Step-by-Step
  31. FIGfont Comments
  32. FIGcharacter Data
  33. - Basic Data Structure
  34. - Character Codes
  35. - Required FIGcharacters
  36. - Code Tagged FIGcharacters
  37. NOTES - AVOIDING ERRORS AND GENERAL ADVICE
  38. CONTROL FILES
  39. Standard Format
  40. Extended Commands
  41. STANDARDIZED CAPABILITIES OF CURRENT AND FUTURE FIGDRIVERS
  42. CHART OF CAPABILITIES OF FIGLET 2.2 AND FIGWIN 1.0
  43. INTRODUCTION
  44. ============
  45. This document specifies the format of font files, and the associated control
  46. files, used by the FIGlet and FIGWin programs (FIGdrivers). It is written
  47. for designers who wish to build fonts (FIGfonts) usable by either program,
  48. and also serves as a standard for development of future versions or similar
  49. FIGdrivers. Some features explained here are not supported by both programs.
  50. See separate documentation to learn how to use FIGlet or FIGWin.
  51. NOTE: FIGWin 1.0 is packaged with a program called FIGfont Editor for Windows
  52. 1.0, which is just that. It does not require a complete understanding of
  53. this document to create FIGfonts. However it is a good idea to become
  54. familiar with the "BASIC DEFINITIONS AND CONCEPTS" information before using
  55. it.
  56. If you design a FIGfont, please send an e-mail announcement to
  57. <figletfonts@onelist.com>, the FIGlet fonts mailing list, and email a copy
  58. to ianchai@usa.net for him to put it at the ftp site.
  59. BASIC DEFINITIONS AND CONCEPTS
  60. ===== =========== === ========
  61. "FIGfont"
  62. A FIGfont is a file which represents the graphical arrangement of characters
  63. representing larger characters. Since a FIGfont file is a text file, it can
  64. be created with any text editing program on any platform. The filename of a
  65. FIGfont file must end with ".flf", which stands for "<F>IG<L>ettering
  66. <F>ont".
  67. "FIGcharacters" and "Sub-characters"
  68. Because FIGfonts describe large characters which consist of smaller
  69. characters, confusion can result when descussing one or the other.
  70. Therefore, the terms "FIGcharacter" and "sub-character" are used,
  71. respectively.
  72. "FIGdriver"
  73. The term FIGdriver is used in this document to encompass FIGlet, FIGWin, and
  74. any future programs which use FIGfonts.
  75. "FIGure"
  76. A FIGure (thusly capitalized) is an image created by a FIGdriver.
  77. "FIG"
  78. A bit of history:
  79. In Spring 1991, inspired by the Email signature of a friend named Frank, and
  80. goaded on by Ian Chai, Glenn Chappell wrote a nifty little 170-line "C"
  81. program called "newban", which would create large letters out of ordinary
  82. text characters. At the time, it was only compiled for UNIX. In hindsight,
  83. we now call it "FIGlet 1.0". FIGlet stands for <F>rank, <I>an, and <G>lenn's
  84. <let>ters. In various incarnations, newban circulated around the net for a
  85. couple of years. It had one font, which included only lowercase letters.
  86. In early 1993, Ian decided newban was due for a few changes, so together Ian
  87. and Glenn added the full ASCII character set, to start with. First, though,
  88. Ian had to find a copy of the source, since Glenn had tossed it away as not
  89. worth the disk space. Ian and Glenn discussed what could be done with it,
  90. decided on a general re-write, and, 7 months later, ended up with 888 lines
  91. of code, 13 FIGfonts and documentation. This was FIGlet 2.0, the first real
  92. release.
  93. To their great surprise, FIGlet took the net by storm. They received floods
  94. of "FIGlet is great!" messages and a new contributed FIGfont about once a
  95. week. To handle all the traffic, Ian quickly set up a mailing list, Daniel
  96. Simmons kindly offered space for an FTP site, several people volunteered to
  97. port FIGlet to non-Unix operating systems, ...and bug reports poured in.
  98. Because of these, and the need to make FIGlet more "international", Ian and
  99. Glenn released a new version of FIGlet which could handle non-ASCII character
  100. sets and right-to-left printing. This was FIGlet 2.1, which, in a couple of
  101. weeks, became figlet 2.1.1. This weighed in at 1314 lines, and there were
  102. over 60 FIGfonts.
  103. By late 1996, FIGlet had quite a following of fans subscribing to its mailing
  104. list. It had been ported to MS-DOS, Macintosh, Amiga, Apple II GS, Atari ST,
  105. Acorn and OS/2. FIGlet had been further updated, and there were nearly 200
  106. FIGfonts.
  107. John Cowan and Paul Burton are two FIGlet fans who decided to create new
  108. versions. While John wrote FIGlet version 2.2 using C, Paul wrote FIGWin
  109. 1.0, the first true GUI (Windows) implementation of FIGlet, using Visual
  110. Basic. John and Paul worked together to add new features to FIGfont files
  111. which could be read by both programs, and together wrote this document, which
  112. we hope helps to establish consistency in FIGfonts and help with the creation
  113. of future FIGdrivers. FIGlet 2.2 has about 4800 lines of code, of which
  114. over half is a support library for reading compressed files.
  115. FIGlet 2.2 and FIGWin 1.0 both allow greater flexibility by use of new
  116. information which can be contained in FIGfont files without interfering with
  117. the function of older FIGdrivers.
  118. NOTE: The Macintosh version of FIGlet is still command-line driven as of this
  119. writing, and a GUI version is very much in demand. The FIGlet C code is
  120. written to be easily plugged in to a GUI shell, so it will be a relatively
  121. easy task for a Macintosh developer.
  122. "Layout Modes"
  123. A FIGdriver may arrange FIGcharacters using one of three "layout modes",
  124. which define the spacing between FIGcharacters. The layout mode for the
  125. horizontal axis may differ from the layout mode for the vertical axis. A
  126. default choice is defined for each axis by every FIGfont.
  127. The three layout modes are:
  128. Full Size (Separately called "Full Width" or "Full Height".)
  129. Represents each FIGcharacter occupying the full width or
  130. height of its arrangement of sub-characters as designed.
  131. Fitting Only (Separately called "Kerning" or "Vertical Fitting".)
  132. Moves FIGcharacters closer together until they touch.
  133. Typographers use the term "kerning" for this phenomenon
  134. when applied to the horizontal axis, but fitting also
  135. includes this as a vertical behavior, for which there is
  136. apparently no established typographical term.
  137. Smushing (Same term for both axes.)
  138. Moves FIGcharacters one step closer after they touch, so that
  139. they partially occupy the same space. A FIGdriver must decide
  140. what sub-character to display at each junction. There are two
  141. ways of making these decisions: by controlled smushing or by
  142. universal smushing.
  143. Controlled smushing uses a set of "smushing rules" selected by
  144. the designer of a FIGfont. (See "Smushing Rules" below.)
  145. Each rule is a comparison of the two sub-characters which must
  146. be joined to yield what to display at the junction.
  147. Controlled smushing will not always allow smushing to occur,
  148. because the compared sub-characters may not correspond to any
  149. active rule. Wherever smushing cannot occur, fitting occurs
  150. instead.
  151. Universal smushing simply overrides the sub-character from the
  152. earlier FIGcharacter with the sub-character from the later
  153. FIGcharacter. This produces an "overlapping" effect with some
  154. FIGfonts, wherin the latter FIGcharacter may appear to be "in
  155. front".
  156. A FIGfont which does not specify any smushing rules for a
  157. particular axis indicates that universal smushing is to occur
  158. when smushing is requested. Therefore, it is not possible for
  159. a FIGfont designer to "forbid" smushing. However there are
  160. ways to ensure that smushing does not cause a FIGfont to be
  161. illegible when smushed. This is especially important for
  162. smaller FIGfonts. (See "Hardblanks" for details.)
  163. For vertical fitting or smushing, entire lines of output FIGcharacters are
  164. "moved" as a unit.
  165. Not all FIGdrivers do vertical fitting or smushing. At present, FIGWin 1.0
  166. does, but FIGlet 2.2 does not. Further, while FIGlet 2.2 allows the user to
  167. override the FIGfont designer's set of smushing rules, FIGWin 1.0 does not.
  168. NOTE: In the documentation of FIGlet versions prior to 2.2, the term
  169. "smushmode" was used to mean the layout mode, and this term further included
  170. the smushing rules (if any) to be applied. However, since the layout mode
  171. may or may not involve smushing, we are straying from the use of this
  172. somewhat misleading term.
  173. "Smushing Rules"
  174. Again, smushing rules are for controlled smushing. If none are defined to be
  175. active in a FIGfont, universal smushing occurs instead.
  176. Generally, if a FIGfont is "drawn at the borders" using sub-characters
  177. "-_|/\[]{}()<>", you will want to use controlled smushing by selecting from
  178. the rules below. Otherwise, if your FIGfont uses a lot of other
  179. sub-characters, do not select any rules and universal smushing will occur
  180. instead. (See "Hardblanks" below if your FIGfont is very small and would
  181. become illegible if smushed.) Experimentation is the best way to make these
  182. decisions.
  183. There are six possible horizontal smushing rules and five possible vertical
  184. smushing rules. Below is a description of all of the rules.
  185. NOTE: Ignore the "code values" for now. They are explained later.
  186. The Six Horizontal Smushing Rules
  187. Rule 1: EQUAL CHARACTER SMUSHING (code value 1)
  188. Two sub-characters are smushed into a single sub-character
  189. if they are the same. This rule does not smush
  190. hardblanks. (See "Hardblanks" below.)
  191. Rule 2: UNDERSCORE SMUSHING (code value 2)
  192. An underscore ("_") will be replaced by any of: "|", "/",
  193. "\", "[", "]", "{", "}", "(", ")", "<" or ">".
  194. Rule 3: HIERARCHY SMUSHING (code value 4)
  195. A hierarchy of six classes is used: "|", "/\", "[]", "{}",
  196. "()", and "<>". When two smushing sub-characters are
  197. from different classes, the one from the latter class
  198. will be used.
  199. Rule 4: OPPOSITE PAIR SMUSHING (code value 8)
  200. Smushes opposing brackets ("[]" or "]["), braces ("{}" or
  201. "}{") and parentheses ("()" or ")(") together, replacing
  202. any such pair with a vertical bar ("|").
  203. Rule 5: BIG X SMUSHING (code value 16)
  204. Smushes "/\" into "|", "\/" into "Y", and "><" into "X".
  205. Note that "<>" is not smushed in any way by this rule.
  206. The name "BIG X" is historical; originally all three pairs
  207. were smushed into "X".
  208. Rule 6: HARDBLANK SMUSHING (code value 32)
  209. Smushes two hardblanks together, replacing them with a
  210. single hardblank. (See "Hardblanks" below.)
  211. The Five Vertical Smushing Rules
  212. Rule 1: EQUAL CHARACTER SMUSHING (code value 256)
  213. Same as horizontal smushing rule 1.
  214. Rule 2: UNDERSCORE SMUSHING (code value 512)
  215. Same as horizontal smushing rule 2.
  216. Rule 3: HIERARCHY SMUSHING (code value 1024)
  217. Same as horizontal smushing rule 3.
  218. Rule 4: HORIZONTAL LINE SMUSHING (code value 2048)
  219. Smushes stacked pairs of "-" and "_", replacing them with
  220. a single "=" sub-character. It does not matter which is
  221. found above the other. Note that vertical smushing rule 1
  222. will smush IDENTICAL pairs of horizontal lines, while this
  223. rule smushes horizontal lines consisting of DIFFERENT
  224. sub-characters.
  225. Rule 5: VERTICAL LINE SUPERSMUSHING (code value 4096)
  226. This one rule is different from all others, in that it
  227. "supersmushes" vertical lines consisting of several
  228. vertical bars ("|"). This creates the illusion that
  229. FIGcharacters have slid vertically against each other.
  230. Supersmushing continues until any sub-characters other
  231. than "|" would have to be smushed. Supersmushing can
  232. produce impressive results, but it is seldom possible,
  233. since other sub-characters would usually have to be
  234. considered for smushing as soon as any such stacked
  235. vertical lines are encountered.
  236. "Hardblanks"
  237. A hardblank is a special sub-character which is displayed as a blank (space)
  238. in rendered FIGures, but is treated more like a "visible" sub-character when
  239. fitting or smushing horizontally. Therefore, hardblanks keep adjacent
  240. FIGcharacters a certain distance apart.
  241. NOTE: Hardblanks act the same as blanks for vertical operations.
  242. Hardblanks have three purposes:
  243. 1) Hardblanks are used to create the blank (space) FIGcharacter.
  244. Usually the space FIGcharacter is simply one or two vertical
  245. columns of hardblanks. Some slanted FIGfonts as shown below
  246. have a diagonal arrangement of hardblanks instead.
  247. 2) Hardblanks can prevent "unreasonable" fitting or smushing.
  248. Normally when fitting or smushing, the blank (space)
  249. sub-character is considered "vacant space". In the following
  250. example, a capital "C" FIGcharacter is smushed with a "minus"
  251. FIGcharacter.
  252. ______ ______
  253. / ____/ / ____/
  254. / / ____ >>-Becomes-> / / ____
  255. / /___ /___/ / /__/___/
  256. \____/ \____/
  257. The FIGure above looks like a capital G. To prevent this, a
  258. FIGfont designer might place a hardblank in the center of the
  259. capital C. In the following example, the hardblank is
  260. represented as a "$":
  261. ______ ______
  262. / ____/ / ____/
  263. / / $ ____ >>-Becomes-> / / ____
  264. / /___ /___/ / /___/___/
  265. \____/ \____/
  266. Using hardblanks in this manner ensures that FIGcharacters
  267. with a lot of empty space will not be unreasonably "invaded"
  268. by adjacent FIGcharacters. Generally, FIGcharacters such as
  269. capital C, L or T, or small punctuation marks such as commas,
  270. may contain hardblanks, since they may contain a lot of vacant
  271. space which is "accessible" from either side.
  272. 3) Hardblanks can prevent smushing from making FIGfonts illegible.
  273. This legitimate purpose of hardblanks is often overused. If a
  274. FIGfont designer is absolutely sure that smushing "visible"
  275. sub-characters would make their FIGfont illegible, hardblanks
  276. may be positioned at the end of each row of sub-characters,
  277. against the visible sub-characters, creating a barrier.
  278. With older FIGdrivers, using hardblanks for this purpose meant
  279. that FIGcharacters would have to be separated by at least one
  280. blank in output FIGures, since only a hardblank could smush
  281. with another hardblank. However with the advent of universal
  282. smushing, this is no longer necessary. Hardblanks ARE
  283. overriden by any visible sub-character when performing
  284. universal smushing. Hardblanks still represent a "stopping
  285. point", but only AFTER their locations are occupied.
  286. NOTE: Earlier it was stated that universal smushing overrides
  287. the sub-character from the former FIGcharacter with the
  288. sub-character from the latter FIGcharacter. Hardblanks (and
  289. blanks or spaces) are the exception to this rule; they will
  290. always be overriden by visible sub-characters, regardless of
  291. which FIGcharacter contains the hardblank. This ensures that
  292. no visible sub-characters "disappear".
  293. Therefore, one can design a FIGfont with a default behavior of
  294. universal smushing, while the output FIGure would LOOK like
  295. the effect of fitting, or even full size if additional
  296. hardblanks are used. If a user "scales down" the layout mode
  297. to fitting, the result would look like "extra spacing" between
  298. FIGcharacters.
  299. Taking this concept further, a FIGcharacter may also include
  300. extra blanks (spaces) on the left side of each FIGcharacter,
  301. which would define the FIGcharacter's width as slightly larger
  302. than required for the visible sub-characters and hardblanks.
  303. With such a FIGfont, a user who further "scales down" the
  304. layout mode to full size would see even greater spacing.
  305. These techniques prevent horizontal smushing from causing a
  306. FIGfont to become illegible, while offering greater
  307. flexibility of output to users.
  308. NOTE: These techniques cannot be used to prevent vertical
  309. smushing of visible sub-characters, since hardblanks are not
  310. respected in the vertical axis. Although it is possible to
  311. select only one vertical smushing rule which involves only
  312. sub-characters which are not used in your FIGfont, it is
  313. recommend that you do NOT do so. In our opinion, most users
  314. would prefer to get what they ask for, rather than being
  315. told, in effect: "I, the FIGfont designer, have decided that
  316. you wouldn't like the results of vertical smushing, so I have
  317. prevented you from trying it." Instead, we recommend setting
  318. the default behavior to either fitting or full height, and
  319. either allowing universal smushing, or selecting vertical
  320. smushing rules which seem most appropriate. A user of your
  321. FIGfont will quickly see why you did not choose smushing as
  322. the default vertical layout mode, and will agree with you.
  323. "Character Sets" and "Character Codes"
  324. When you type using your keyboard, you are actually sending your computer a
  325. series of numbers. Each number must be interpreted by your computer so that
  326. it knows what character to display. The computer uses a list of definitions,
  327. called a "character set". The numbers which represent each character are
  328. called "character codes".
  329. There are many character sets, most of which are internationally accepted as
  330. standards. By far, the most common character set is ASCII, which stands for
  331. "American Standard Code for Information Interchange". ASCII identifies its
  332. characters with codes ranging from 0 to 127.
  333. NOTE: The term "ASCII art" has become well-understood to mean artistic images
  334. which consist of characters on your screen (such as FIGures).
  335. For a list of the printable ASCII characters with the corresponding codes,
  336. see the section "REQUIRED CHARACTERS" below. The other ASCII codes in the
  337. range of 0 through 31 are "control characters" such as carriage-return
  338. (code 13), linefeed/newline (code 10), tab (code 9), backspace (code 8) or
  339. null (code 0). Code 127 is a delete in ASCII.
  340. Getting more technical for just a moment: A byte consisting of 8 bits (eight
  341. 1's or 0's) may represent a number from 0 to 255. Therefore, most computers
  342. have DIRECT access to 256 characters at any given time. A character set
  343. which includes 256 characters is called an 8-bit character set.
  344. For Latin-based languages, ASCII is almost always the first half of a larger
  345. 8-bit character set. Latin-1 is the most common example of an 8-bit
  346. character set. Latin-1 includes all of ASCII, and adds characters with codes
  347. from 128 to 255 which include umlauted ("double-dotted") letters and
  348. characters with various other accents. In the United States, Windows and
  349. most Unix systems have Latin-1 directly available.
  350. Most modern systems allow the possibility of changing 8-bit character sets.
  351. On Windows systems, character sets are referred to as "code pages". There
  352. are many other character sets which are not mentioned here. DOS has its own
  353. character set (which also has international variants) that includes graphics
  354. characters for drawing lines. It is also an extension of ASCII.
  355. For some languages, 8-bit character sets are insufficient, particularly on
  356. East Asian systems. Therefore, some systems allow 2 bytes for each
  357. character, which multiplies the 256 possibilties by 256, resulting in 65536
  358. possible characters. (Much more than the world will ever need.)
  359. Unicode is a character set standard which is intended to fulfill the
  360. worldwide need for a single character set which includes all characters used
  361. worldwide. Unicode includes character codes from 0 to 65535, although at
  362. present, only about 22,000 characters have been officially assigned and named
  363. by the Unicode Consortium. The alphabets and other writing systems
  364. representable with Unicode include all Latin-alphabet systems, Greek,
  365. Russian and other Cyrillic-alphabet systems, Hebrew, Arabic, the various
  366. languages of India, Chinese, Japanese, Korean, and others. The existing
  367. Unicode symbols include chess pieces, astrological signs, gaming symbols,
  368. telephones, pointing fingers, etc. --- just about any type of FIGcharacter
  369. you may wish to create. Unicode is constantly (but slowly) being extended
  370. to handle new writing systems and symbols. Information on Unicode is
  371. available at http://www.unicode.org and at ftp://unicode.org .
  372. Unicode, Latin-1, and ASCII all specify the same meanings for overlapping
  373. character codes: ASCII 65 = Latin-1 65 = Unicode 65 = "A", formally known
  374. as "LATIN CAPITAL LETTER A".
  375. Since a keyboard usually has only about 100 keys, your computer may contain
  376. a program called a "keyboard map", which will interpret certain keystrokes
  377. or combinations of keystrokes as different character codes. Keyboard maps
  378. use "mapping tables" to make these determinations. The appropriate keyboard
  379. activity for a given character code may involve several keystrokes. Almost
  380. all systems are capable of handling at least 8-bit character sets (containing
  381. 256 characters), so there is always an active keyboard map, at least for
  382. those characters which are not actually painted on the keys. (United States
  383. users may not even know that their computer can interpret special keystrokes.
  384. Such keystrokes may be something similar to holding down the ALT key while
  385. typing a character code on the numeric keypad. Try it!)
  386. Below are characters 160 through 255, AS REPRESENTED ON YOUR SYSTEM.
  387. ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ
  388. ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
  389. IMPORTANT NOTE: Depending on which character set is active on your system,
  390. you may see different characters. This document (like all computer
  391. documents) does not contains characters per se, only bytes. What you see
  392. above is your particular computer's representation of these byte values.
  393. In other words, your active character set. However, if it is Latin-1, the
  394. first visible character is an inverted "!", and the last is an umlauted "y".
  395. Although we can safely assume your computer has ASCII, it does not
  396. necessarily have the Latin-1 character set active.
  397. What does all this have to do with FIGfonts???
  398. First, it should be evident that it is best to use only ASCII characters for
  399. sub-characters when possible. This will ensure portability to different
  400. platforms.
  401. FIGlet has gained international popularity, but early versions were made to
  402. handle only FIGcharacters with assigned character codes corresponding to
  403. ASCII. So, over the years there have been four methods used to create
  404. "virtual mapping tables" within the program itself:
  405. The first method was simply to create FIGcharacters which do not
  406. look like the ASCII character set implies. For example, a
  407. FIGfont might contain Greek letters, and within its comments, it
  408. may say, "If you type A, you'll get a Greek Alpha" etc. With
  409. the advent of newer features, it is preferable not to use this
  410. method. Instead, when possible, add new FIGcharacters to
  411. existing FIGfonts or create new FIGfonts with FIGcharacters coded
  412. to match the expectations of ASCII/Latin-1/Unicode, and create an
  413. appropriate control file. (See "CONTROL FILES" below.) Remember
  414. that Unicode includes almost any character for which you may want
  415. to create a FIGcharacter.
  416. The second method was very specific, to accommodate the German
  417. audience. A special option was added to the FIGlet program
  418. which would re-route input characters "[", "\", and "]" to
  419. umlauted A, O and U, while "{", "|", and "}" would become the
  420. respective lowercase versions of these. Also, "~" was made to
  421. become the s-z character when this special option was used. This
  422. was called "the -D option." The addition of this feature meant
  423. that all compatible FIGfonts must contain these Deutsch (German)
  424. FIGcharacters, in addition to the ASCII FIGcharacters. Although
  425. this option is still available in the most recent version, it is
  426. no longer necessary, as the same result can be achieved by the
  427. newer features described below. However, the requirement for
  428. Deutsch FIGcharacters remains for backward compatibility. (Or at
  429. least zero-width FIGcharacters in their place.)
  430. Later, FIGlet was made to accept control files, which are quite
  431. literally a form of mapping table. (See "CONTROL FILES" below.)
  432. This was a significant advance for internationalization.
  433. FIGlet 2.2 can now accept specially encoded formats of input
  434. text which imply more than one byte per character.
  435. CREATING FIGFONTS
  436. ======== ========
  437. NOTE: FIGWin 1.0 is packaged with a program called FIGfont Editor for Windows
  438. 1.0, which is just that. There is no need to read further if you intend to
  439. use it. However, the section "CONTROL FILES" below is still relevant.
  440. Since a FIGfont file is a text file, it can be created with any text editing
  441. program on any platform, and will still be compatible with FIGdrivers on all
  442. operating systems, except that the bytes used to indicate the end of each
  443. text line may vary. (PC's use carriage return and linefeed at the end of
  444. each line, Macintosh uses carriage return only, and UNIX uses linefeed only.)
  445. This minor difference among operating systems is handled easily by setting
  446. your FTP program to ASCII mode during upload or download. So there is no
  447. need to be concerned about this as long as you remember to do this during
  448. file transfer.
  449. The filename of a FIGfont file must end with ".flf", which stands for
  450. "<F>IG<L>ettering <F>ont". The first part of the filename should contain
  451. only letters, and should be lowercase on operating systems which permit case
  452. sensitive filenames. The filename should be unique in the first 8
  453. characters, since some older file systems truncate longer filenames.
  454. It is easier to modify an existing FIGfont than it is to create a new one
  455. from scratch. The first step is to read and understand this document.
  456. You may want to load "standard.flf" or another FIGfont into a text editor as
  457. an example while you read.
  458. A FIGfont file contains three portions: a header line, comments, and
  459. FIGcharacter data.
  460. THE HEADER LINE
  461. The header line gives information about the FIGfont. Here is an example
  462. showing the names of all parameters:
  463. flf2a$ 6 5 20 15 3 0 143 229 NOTE: The first five characters in
  464. | | | | | | | | | | the entire file must be "flf2a".
  465. / / | | | | | | | \
  466. Signature / / | | | | | \ Codetag_Count
  467. Hardblank / / | | | \ Full_Layout*
  468. Height / | | \ Print_Direction
  469. Baseline / \ Comment_Lines
  470. Max_Length Old_Layout*
  471. * The two layout parameters are closely related and fairly complex.
  472. (See "INTERPRETATION OF LAYOUT PARAMETERS".)
  473. For those desiring a quick explanation, the above line indicates that this
  474. FIGfont uses "$" to represent the hardblank in FIGcharacter data, it has
  475. FIGcharacters which are 6 lines tall, 5 of which are above the baseline, no
  476. line in the FIGfont data is more than 20 columns wide, the default horizontal
  477. layout is represented by the number 15, there are 3 comment lines, the
  478. default print direction for this FIGfont is left-to-right, a complete
  479. description of default and possible horizontal and vertical layouts is
  480. represented by the number 143, and there are 229 code-tagged characters.
  481. The first seven parameters are required. The last three (Direction,
  482. Full_Layout, and Codetag_Count, are not. This allows for backward
  483. compatibility with older FIGfonts, but a FIGfont without these parameters would
  484. force a FIGdriver to "guess" (by means not described in this document) the
  485. information it would expect to find in Full_Layout. For this reason, inclusion
  486. of all parameters is strongly recommended.
  487. Future versions of this standard may add more parameters after Codetag_Count.
  488. A description of each parameter follows:
  489. Signature
  490. The signature is the first five characters: "flf2a". The first four
  491. characters "flf2" identify the file as compatible with FIGlet version 2.0 or
  492. later (and FIGWin 1.0). The "a" is currently ignored, but cannot be omitted.
  493. Different characters in the "a" location may mean something in future
  494. versions of this standard. If so, you can be sure your FIGfonts will still
  495. work if this character is "a".
  496. Hardblank
  497. Immediately following the signature is the hardblank character. The
  498. hardblank character in the header line defines which sub-character will be
  499. used to represent hardblanks in the FIGcharacter data.
  500. By convention, the usual hardblank is a "$", but it can be any character
  501. except a blank (space), a carriage-return, a newline (linefeed) or a null
  502. character. If you want the entire printable ASCII set available to use, make
  503. the hardblank a "delete" character (character code 127). With the exception
  504. of delete, it is inadvisable to use non-printable characters as a hardblank.
  505. Height
  506. The Height parameter specifies the consistent height of every FIGcharacter,
  507. measured in sub-characters. Note that ALL FIGcharacters in a given FIGfont
  508. have the same height, since this includes any empty space above or below.
  509. This is a measurement from the top of the tallest FIGcharacter to the bottom
  510. of the lowest hanging FIGcharacter, such as a lowercase g.
  511. Baseline
  512. The Baseline parameter is the number of lines of sub-characters from the
  513. baseline of a FIGcharacter to the top of the tallest FIGcharacter. The
  514. baseline of a FIGfont is an imaginary line on top of which capital letters
  515. would rest, while the tails of lowercase g, j, p, q, and y may hang below.
  516. In other words, Baseline is the height of a FIGcharacter, ignoring any
  517. descenders.
  518. This parameter does not affect the output of FIGlet 2.2 or FIGWin 1.0, but
  519. future versions or other future FIGdrivers may use it. The Baseline
  520. parameter should be correctly set to reflect the true baseline as described
  521. above. It is an error for Baseline to be less than 1 or greater than the
  522. Height parameter.
  523. Max_Length
  524. The Max_Length parameter is the maximum length of any line describing a
  525. FIGcharacter. This is usually the width of the widest FIGcharacter, plus 2
  526. (to accommodate endmarks as described later.) However, you can (and probably
  527. should) set Max_Length slightly larger than this as a safety measure in case
  528. your FIGfont is edited to include wider FIGcharacters. FIGlet (but not
  529. FIGWin 1.0) uses this number to minimize the memory taken up by a FIGfont,
  530. which is important in the case of FIGfonts with many FIGcharacters.
  531. Old_Layout
  532. (See "INTERPRETATION OF LAYOUT PARAMETERS" below.)
  533. Comment_Lines
  534. Between the first line and the actual FIGcharacters of the FIGfont are the
  535. comment lines. The Comment_Lines parameter specifies how many lines there
  536. are. Comments are optional, but recommended to properly document the origin
  537. of a FIGfont.
  538. Print_Direction
  539. The Print_Direction parameter tells which direction the font is to be
  540. printed by default. A value of 0 means left-to-right, and 1 means
  541. right-to-left. If this parameter is absent, 0 (left-to-right) is assumed.
  542. Print_Direction may not specify vertical print, although FIGdrivers are
  543. capable of vertical print. Versions of FIGlet prior to 2.1 ignore this
  544. parameter.
  545. Full_Layout
  546. (See "INTERPRETATION OF LAYOUT PARAMETERS" just below.)
  547. Codetag_Count
  548. Indicates the number of code-tagged (non-required) FIGcharacters in this
  549. FIGfont. This is always equal to the total number of FIGcharacters in the font
  550. minus 102. This parameter is typically ignored by FIGdrivers, but can be
  551. used to verify that no characters are missing from the end of the FIGfont.
  552. The chkfont program will display the number of codetagged characters
  553. in the FIGfont on which it is run, making it easy to insert this parameter
  554. after a FIGfont is written.
  555. INTERPRETATION OF LAYOUT PARAMETERS
  556. Full_Layout describes ALL information about horizontal and vertical layout:
  557. the default layout modes and potential smushing rules, even when smushing is
  558. not a default layout mode.
  559. Old_Layout does not include all of the information desired by the most
  560. recent FIGdrivers, which is the inspiration for the creation of the new
  561. Full_Layout parameter. Old_Layout is still required for backward
  562. compatibility, and FIGdrivers must be able to interpret FIGfonts which do not
  563. have the Full_Layout parameter. (See "STANDARDIZED CAPABILITIES OF CURRENT
  564. AND FUTURE FIGDRIVERS".)
  565. Versions of FIGlet prior to 2.2 do not recognize the Full_Layout parameter.
  566. Documentation accompanying FIGlet versions prior to 2.2 refer to Old_Layout
  567. as "smushmode", which is somewhat misleading since it can indicate layout
  568. modes other than smushing.
  569. Old_Layout and Full_Layout must contain some redundant information.
  570. Setting the layout parameters is a matter of adding numbers together ("code
  571. values"). What follows is a chart of the meanings of all code values.
  572. (You may skip down to "SETTING LAYOUT PARAMETERS STEP BY STEP" if you prefer,
  573. or if you find this portion confusing.)
  574. Full_Layout: (Legal values 0 to 32767)
  575. 1 Apply horizontal smushing rule 1 when smushing
  576. 2 Apply horizontal smushing rule 2 when smushing
  577. 4 Apply horizontal smushing rule 3 when smushing
  578. 8 Apply horizontal smushing rule 4 when smushing
  579. 16 Apply horizontal smushing rule 5 when smushing
  580. 32 Apply horizontal smushing rule 6 when smushing
  581. 64 Horizontal fitting (kerning) by default
  582. 128 Horizontal smushing by default (Overrides 64)
  583. 256 Apply vertical smushing rule 1 when smushing
  584. 512 Apply vertical smushing rule 2 when smushing
  585. 1024 Apply vertical smushing rule 3 when smushing
  586. 2048 Apply vertical smushing rule 4 when smushing
  587. 4096 Apply vertical smushing rule 5 when smushing
  588. 8192 Vertical fitting by default
  589. 16384 Vertical smushing by default (Overrides 8192)
  590. When no smushing rules are included in Full_Layout for a given axis, the
  591. meaning is that universal smushing shall occur, either by default or when
  592. requested.
  593. Old_Layout: (Legal values -1 to 63)
  594. -1 Full-width layout by default
  595. 0 Horizontal fitting (kerning) layout by default*
  596. 1 Apply horizontal smushing rule 1 by default
  597. 2 Apply horizontal smushing rule 2 by default
  598. 4 Apply horizontal smushing rule 3 by default
  599. 8 Apply horizontal smushing rule 4 by default
  600. 16 Apply horizontal smushing rule 5 by default
  601. 32 Apply horizontal smushing rule 6 by default
  602. * When Full_Layout indicates UNIVERSAL smushing as a horizontal default
  603. (i.e., when none of the code values of horizontal smushing rules are included
  604. and code value 128 is included in Full_Layout) Old_Layout must be set to 0
  605. (zero). Older FIGdrivers which cannot read the Full_Layout parameter are
  606. also incapable of universal smushing. Therefore they would be directed to
  607. the "next best thing", which is horizontal fitting (kerning).
  608. NOTE: You should NOT add the -1 value to any positive code value for
  609. Old_Layout. This would be a logical contradiction.
  610. See "STANDARDIZED CAPABILITIES OF CURRENT AND FUTURE FIGDRIVERS" for the
  611. behavior of a FIGdriver when the Full_Layout parameter is absent (presumably
  612. in an older FIGfont).
  613. The following rules establish consistency between Old_Layout and Full_Layout.
  614. If full width is to be the horizontal default:
  615. Old_Layout must be -1.
  616. Full_Layout must NOT include code values 64 nor 128.
  617. If horizontal fitting (kerning) is to be default:
  618. Old_Layout must be 0.
  619. Full_Layout must include code value 64.
  620. Full_Layout must NOT include code value 128.
  621. If CONTROLLED smushing is to be the horizontal default:
  622. Old_Layout must be a positive number, represented by the added
  623. code values of all desired horizontal smushing rules.
  624. Full_Layout must include the code values for the SAME set of
  625. horizontal smushing rules as included in Old_Layout.
  626. Full_Layout must include code value 128.
  627. If UNIVERSAL smushing is to be the horizontal default:
  628. Old_Layout must be 0.
  629. Full_Layout must include code value 128.
  630. Full_Layout must NOT include any code value under 64.
  631. In general terms, if Old_Layout specifies horizontal smushing rules,
  632. Full_Layout must specify the same set of horizontal rules, and both must
  633. indicate the same horizontal default layout mode.
  634. SETTING LAYOUT PARAMETERS STEP-BY-STEP
  635. The following step-by-step process will yield correct and consistent values
  636. for the two layout parameters. You may skip this if you find the
  637. explanations above easier to use.
  638. Step 1: Start with 0 for both numbers.
  639. Write "Old_Layout" and "Full_Layout" on a piece of paper.
  640. Write the number 0 next to each.
  641. The number 0 may be crossed out and changed several times below.
  642. Go to step 2.
  643. Step 2: Set the DEFAULT HORIZONTAL LAYOUT MODE.
  644. If you want to use FULL WIDTH as the default
  645. Make Old_Layout -1
  646. Go to step 3.
  647. If you want to use HORIZONTAL FITTING (kerning) as the default
  648. Make Full_Layout 64
  649. Go to step 3.
  650. If you want to use HORIZONTAL SMUSHING as the default
  651. Make Full_Layout 128
  652. Go to step 3.
  653. Step 3: Specify HOW TO SMUSH HORIZONTALLY WHEN SMUSHING.
  654. If you want to use UNIVERSAL smushing for the horizontal axis
  655. Go to step 4.
  656. If you want to use CONTROLLED smushing for the horizontal axis
  657. Add together the code values for all the horizontal smushing
  658. rules you want from the list below to get the horizontal
  659. smushing rules total.
  660. EQUAL CHARACTER SMUSHING 1
  661. UNDERSCORE SMUSHING 2
  662. HIERARCHY SMUSHING 4
  663. OPPOSITE PAIR SMUSHING 8
  664. BIG X SMUSHING 16
  665. HARDBLANK SMUSHING 32
  666. Horizontal smushing rules total: ___
  667. If Full_Layout is currently 128
  668. Change Old_Layout to the horizontal smushing rules total.
  669. Increase Full_Layout by the horizontal smushing rules total.
  670. Go to Step 4.
  671. If Full_Layout is currently 0 or 64
  672. Increase Full_Layout by the horizontal smusing rules total.
  673. Go to Step 4.
  674. Step 4: Set the DEFAULT VERTICAL LAYOUT MODE.
  675. If you want to use FULL HEIGHT as the default
  676. Go to step 5.
  677. If you want to use VERTICAL FITTING as the default
  678. Increase Full_Layout by 8192.
  679. Go to step 5.
  680. If you want to use VERTICAL SMUSHING as the default
  681. Increase Full_Layout by 16384.
  682. Go to step 5.
  683. Step 5: Specify HOW TO SMUSH VERTICALLY WHEN SMUSHING.
  684. If you want to use UNIVERSAL smushing for the vertical axis
  685. Go to step 6.
  686. If you want to use CONTROLLED smushing for the vertical axis
  687. Add together the code values for all the vertical smushing
  688. rules you want from the list below to get the vertical
  689. smushing rules total.
  690. EQUAL CHARACTER SMUSHING 256
  691. UNDERSCORE SMUSHING 512
  692. HIERARCHY SMUSHING 1024
  693. HORIZONTAL LINE SMUSHING 2048
  694. VERTICAL LINE SUPERSMUSHING 4096
  695. Vertical smushing rules total: ____
  696. Increase Full_Layout by the vertical smushing rules total.
  697. Go to step 6.
  698. Step 6: You're done.
  699. The resulting value of Old_Layout will be a number from -1 to 63.
  700. The resulting value of Full_Layout will be a number from 0 and 32767.
  701. FIGFONT COMMENTS
  702. After the header line are FIGfont comments. The comments can be as many
  703. lines as you like, but should at least include your name and Email address.
  704. Here is an example which also shows the header line.
  705. flf2a$ 6 5 20 15 3 0 143
  706. Example by Glenn Chappell <ggc@uiuc.edu> 8/94
  707. Permission is hereby given to modify this font, as long as the
  708. modifier's name is placed on a comment line.
  709. Comments are not required, but they are appreciated. Please comment your
  710. FIGfonts.
  711. Remember to adjust the Comment_Lines parameter as you add lines to your
  712. comments. Don't forget that blank lines DO count.
  713. FIGCHARACTER DATA
  714. ============ ====
  715. The FIGcharacter data begins on the next line after the comments and
  716. continues to the end of the file.
  717. BASIC DATA STRUCTURE
  718. The sub-characters in the file are given exactly as they should be output,
  719. with two exceptions:
  720. 1) Hardblanks should be the hardblank character specified in the
  721. header line, not a blank (space).
  722. 2) Every line has one or two endmark characters, whose column
  723. locations define the width of each FIGcharacter.
  724. In most FIGfonts, the endmark character is either "@" or "#". The FIGdriver
  725. will eliminate the last block of consecutive equal characters from each line
  726. of sub-characters when the font is read in. By convention, the last line of
  727. a FIGcharacter has two endmarks, while all the rest have one. This makes it
  728. easy to see where FIGcharacters begin and end. No line should have more
  729. than two endmarks.
  730. Below is an example of the first few FIGcharacters, taken from small.flf.
  731. NOTE: The line drawn below consisting of "|" represents the left margin of
  732. your editor. It is NOT part of the FIGfont. Also note that hardblanks are
  733. represented as "$" in this FIGfont, as would be described in the header line.
  734. |$@
  735. |$@
  736. blank/space |$@
  737. |$@
  738. |$@@
  739. | _ @
  740. || |@
  741. exclamation point ||_|@
  742. |(_)@
  743. | @@
  744. | _ _ @
  745. |( | )@
  746. double quote | V V @
  747. | $ @
  748. | @@
  749. | _ _ @
  750. | _| | |_ @
  751. number sign ||_ . _|@
  752. ||_ _|@
  753. | |_|_| @@
  754. | @
  755. | ||_@
  756. dollar sign |(_-<@
  757. |/ _/@
  758. | || @@
  759. Notice that each FIGcharacter occupies the same number of lines (6 lines, in
  760. this case), which must also be expressed in the header line as the Height
  761. parameter.
  762. Also notice that for every FIGcharacter, there must be a consistent width
  763. (length) for each line once the endmarks are removed. To do otherwise would
  764. be an error.
  765. Be aware of the vertical alignment of each FIGcharacter within its height,
  766. so that all FIGcharacters will be properly lined up when printed.
  767. If one of the last sub-characters in a particular FIGcharacter is "@", you
  768. should use another character for the endmark in that FIGcharacter so that
  769. the intended "@" is not interpreted as an endmark. "#" is a common
  770. alternative.
  771. Load a few existing FIGfonts into your favorite text editor for other
  772. examples.
  773. REQUIRED FIGCHARACTERS
  774. Some FIGcharacters are required, and must be represented in a specific order.
  775. Specifically: all of the printable character codes from ASCII shown in the
  776. table below, in order, plus character codes 196, 214, 220, 228, 246, 252,
  777. and 223, in that order. In Latin-1, these extra 7 characters represent the
  778. following German characters: umlauted "A", "O", "U", "a", "o" and "u"; and
  779. also "ess-zed".
  780. Printable portion of the ASCII character set:
  781. 32 (blank/space) 64 @ 96 `
  782. 33 ! 65 A 97 a
  783. 34 " 66 B 98 b
  784. 35 # 67 C 99 c
  785. 36 $ 68 D 100 d
  786. 37 % 69 E 101 e
  787. 38 & 70 F 102 f
  788. 39 ' 71 G 103 g
  789. 40 ( 72 H 104 h
  790. 41 ) 73 I 105 i
  791. 42 * 74 J 106 j
  792. 43 + 75 K 107 k
  793. 44 , 76 L 108 l
  794. 45 - 77 M 109 m
  795. 46 . 78 N 110 n
  796. 47 / 79 O 111 o
  797. 48 0 80 P 112 p
  798. 49 1 81 Q 113 q
  799. 50 2 82 R 114 r
  800. 51 3 83 S 115 s
  801. 52 4 84 T 116 t
  802. 53 5 85 U 117 u
  803. 54 6 86 V 118 v
  804. 55 7 87 W 119 w
  805. 56 8 88 X 120 x
  806. 57 9 89 Y 121 y
  807. 58 : 90 Z 122 z
  808. 59 ; 91 [ 123 {
  809. 60 < 92 \ 124 |
  810. 61 = 93 ] 125 }
  811. 62 > 94 ^ 126 ~
  812. 63 ? 95 _
  813. Additional required Deutsch FIGcharacters, in order:
  814. 196 (umlauted "A" -- two dots over letter "A")
  815. 214 (umlauted "O" -- two dots over letter "O")
  816. 220 (umlauted "U" -- two dots over letter "U")
  817. 228 (umlauted "a" -- two dots over letter "a")
  818. 246 (umlauted "o" -- two dots over letter "o")
  819. 252 (umlauted "u" -- two dots over letter "u")
  820. 223 ("ess-zed" -- see FIGcharacter illustration below)
  821. ___
  822. / _ \
  823. | |/ /
  824. Ess-zed >>---> | |\ \
  825. | ||_/
  826. |_|
  827. If you do not wish to define FIGcharacters for all of those required above,
  828. you MAY create "empty" FIGcharacters in their place by placing endmarks flush
  829. with the left margin. The Deutsch FIGcharacters are commonly created as
  830. empty. If your FIGfont includes only capital letters, please copy them to
  831. the appropriate lowercase locations, rather than leaving lowercase letters
  832. empty. A FIGfont which does not include at least all ASCII letters, a space,
  833. and a few basic punctuation marks will probably frustrate some users. (For
  834. example "@" is more frequently desired as a FIGcharacter than you may think,
  835. since Email addresses may be written as FIGures.)
  836. CODE TAGGED FIGCHARACTERS
  837. After the required FIGcharacters, you may create FIGcharacters with any
  838. character code in the range of -2147483648 to +2147483647. (Over four
  839. billion possibilities, which is "virtual infinity" for this purpose.)
  840. One exception: character code -1 is NOT allowed for technical reasons.
  841. It is advisable to assign character codes such that the appearance of your
  842. FIGcharacters matches the expectations of ASCII/Latin-1/Unicode, with a few
  843. exceptions:
  844. 1) If a FIGcharacter with code 0 is present, it is treated
  845. specially. It is a FIGfont's "missing character". Whenever
  846. the FIGdriver is told to print a character which doesn't exist
  847. in the current FIGfont, it will print FIGcharacter 0. If there
  848. is no FIGcharacter 0, nothing will be printed.
  849. 2) If a FIGfont contains a non-Latin alphabet in character codes
  850. in the ASCII range 32-126 (which is discouraged), we have found
  851. it helpful to include a human-readable translation table as one
  852. of the FIGcharacters instead of a "glyph". Typically, the "~"
  853. would contain this table. The translation table FIGcharacter
  854. would contain a list of all the special characters in the
  855. FIGfont, along with the ASCII characters to which they
  856. correspond. Keep this table no more than 79 columns wide.
  857. (Thanks to Gedaliah Friedenberg for this idea.)
  858. 3) In more extensive Unicode fonts, you can assign a negative
  859. character code (other than -1) to one or more translation
  860. tables, similar to #2 above. (All Unicode character codes are
  861. positive.) And, you will most likely suggest within the
  862. comments that a user access one of several control files (See
  863. "CONTROL FILES" below) to gain access to Latin-2, Latin-3, or
  864. other 8-bit standardized character sets. The control files may
  865. redirect the "~" character to one of the negative character codes so
  866. that the translation table would display the table when "~" is
  867. given for input. Doing this allows you to still have a "~"
  868. FIGcharacter for those who do not use a control file.
  869. Those FIGcharacters which are not required must have an explicit character
  870. code in a separate line preceding them, called a "code tag". A code tag
  871. contains the value of the character code, followed by whitespace (a few
  872. spaces), and perhaps an optional comment. The comment is usually the name of
  873. the FIGcharacter. The Unicode Consortium has assigned formal names to all
  874. officially accepted characters, and these may be used. An entire code tag,
  875. including the comment, should not occupy more than 95 columns. (Over 100
  876. characters here may make older versions of FIGlet crash.)
  877. Here is an example, showing two code tagged FIGcharacters after the last two
  878. required Deutsch FIGcharacters. Again, the line drawn below consisting of
  879. "|" represents the left margin of your editor, and is NOT part of the FIGfont.
  880. | _ _ @
  881. |(_) (_)@
  882. || | | |@
  883. || |_| |@
  884. | \__,_|@
  885. | @@
  886. | ___ @
  887. | / _ \@
  888. || |/ /@
  889. || |\ \@
  890. || ||_/@
  891. ||_| @@
  892. |161 INVERTED EXCLAMATION MARK
  893. | _ @
  894. |(_)@
  895. || |@
  896. || |@
  897. ||_|@
  898. | @@
  899. |162 CENT SIGN
  900. | _ @
  901. | | | @
  902. | / __)@
  903. || (__ @
  904. | \ )@
  905. | |_| @@
  906. A character code may be expressed in decimal (as shown above, numbers we're
  907. all familiar with), or in Octal (seldom used) or in hexadecimal.
  908. Character codes expressed in octal must be preceded by "0" (zero), and if
  909. negative, "-" (minus) must precede the "0". There are eight octal digits:
  910. 01234567. You may recall octal numbers from school as "base 8 numbers".
  911. Character codes expressed in hexadecimal must be preceded by "0x" or "0X".
  912. (That's also a zero.) If negative, the "-" must precede the "0x". There are
  913. 16 hexadecimal digits: 01234567890ABCDEF. (The "letter-digits" may also be
  914. lowercase.) Hexadecimal is "base 16".
  915. It is common to express character codes less than 256 (in the range of an
  916. 8-bit character set) as decimal, while FIGfonts which extend into the Unicode
  917. range would have character codes expressed in hexadecimal. This is because
  918. the Unicode Standard expresses character codes in hexadecimal, which is
  919. helpful for programmers.
  920. The code tagged FIGcharacters may be listed in any order, but simple
  921. sequential order is recommended.
  922. If two or more FIGcharacters have the same character code, the last one in
  923. the FIGfont is the one used. It is common for the Deutsch FIGcharacters to
  924. be given twice in a FIGfont, just to maintain a consistent order for the
  925. Latin-1 range (128 to 255).
  926. It is not advisable to assign character codes in the range of 1 to 31, since
  927. this range includes control characters in ASCII. Character code 127 is a
  928. delete in ASCII, and is also not advised. Character codes 128 to 159 are
  929. additional control characters in Latin-1, and they too should not be used.
  930. All of the above are legal, technically, but are not part of what is legal
  931. for input, so they could only be accessed by use of a control file.
  932. (See "CONTROL FILES" below.) If you are still tempted to use them, consider
  933. negative character codes instead, which are meaningless in all standardized
  934. character sets.
  935. Again, the character code -1 is illegal for technical reasons.
  936. NOTES - AVOIDING ERRORS AND GENERAL ADVICE
  937. ===== ======== ====== === ======= ======
  938. It is very important that every character in a font has the same height, and,
  939. once the endmarks are removed, that all the lines constituting a single
  940. FIGcharacter have the same length. Be careful also that no lines in the font
  941. file have trailing blanks (spaces), as the FIGdriver will take these to be
  942. the endmarks. (FIGWin 1.0 will not consider blanks to be endmarks.)
  943. Errors in a FIGfont can be detected by using the "chkfont" program,
  944. part of the standard FIGlet package, and also available, as of this
  945. writing from http://st-www.cs.uiuc.edu/users/chai/figlet.html.
  946. For FIGWin users, the FIGWin program will report errors when a FIGfont is
  947. read in; it is less forgiving than FIGlet, which can produce nonsense if the
  948. FIGfont is incorrectly formatted.
  949. Remember that sub-characters outside of the ASCII range will not necessarily
  950. display the same way on your system as on others.
  951. The blank (space) FIGcharacter should usually consist of one or two columns
  952. of hardblanks and nothing else; slanted fonts are an exception to this rule.
  953. If the space FIGcharacter does not contain any hardblanks, it will disappear
  954. when horizontal fitting (kerning) or smushing occurs.
  955. Again, if you design a FIGfont, please let us know!
  956. CONTROL FILES
  957. ======= =====
  958. A FIGfont control file is a separate text file, associated with one or more
  959. FIGfonts, that indicates how to map input characters into FIGfont character
  960. codes. By default, FIGdrivers read single bytes from the input source and
  961. interpret them as Latin-1 FIGcharacters.
  962. FIGlet version 2.2 (and later) can optionally interpret its input as DBCS or
  963. UTF-8 characters, making it possible to access FIGcharacters with codes
  964. outside the Latin-1 range (greater than 255).
  965. In addition, though, all versions of FIGlet can use control files to
  966. transform specific character codes (or ranges of codes) as other codes
  967. (or ranges). Multiple control files can be specified, in which case multiple
  968. stages of transformation are performed.
  969. The filename of a control file always ends with ".flc".
  970. CONTROL FILE FORMAT
  971. Control files contain several kinds of lines. Lines beginning with "#", as
  972. well as blank lines, are comment lines and are ignored. All other lines are
  973. command lines, with one of the following formats:
  974. t inchar outchar
  975. t inchar1-inchar2 outchar1-outchar2
  976. number number
  977. f
  978. h
  979. j
  980. b
  981. u
  982. g{0|1|2|3} {94|96|94x94} [char]
  983. g{L|R} {0|1|2|3}
  984. where "inchar", "outchar", and "char" are either Latin-1 characters
  985. representing their own codes, or else are numeric character codes preceded by
  986. a "\" character; and "number" is a numeric character code with no preceding
  987. "\" character.
  988. Thus "A" represents the code 65, as does "\65", and "\0x100" represents the
  989. code 256 (100 in hexadecimal). In addition, "\ " (backslash followed by a
  990. space) represents the code 32 (space), and the following backslash sequences
  991. are also understood:
  992. \a code 7 (a bell/alert)
  993. \b code 8 (a backspace)
  994. \e code 27 (an ESC character)
  995. \f code 12 (a form feed)
  996. \n code 10 (a newline/line feed)
  997. \r code 13 (a carriage return)
  998. \t code 9 (a horizontal tab)
  999. \v code 11 (a vertical tab)
  1000. \\ code 92 (a backslash)
  1001. All of these combinations except perhaps "\\" are very unlikely to be used,
  1002. but they are provided just in case they are needed.
  1003. Whitespace characters are used between "t" and "inchar" and between "inchar"
  1004. and "outchar", but not around the "-" characters used in the second type of
  1005. "t" command.
  1006. The term "string" refers to any number of characters represented in the
  1007. format given above. The characters begin after the whitespace following the
  1008. letter "s", and continue to the end of the line.
  1009. Anything following the first letter of an "f", "h", "j", or "u" command is
  1010. ignored.
  1011. The first type of "t" command transforms characters with the code "inchar"
  1012. into characters with the code "outchar". The second type of "t" command
  1013. transforms characters in the range "inchar1" to "inchar2" as the
  1014. corresponding codes in the range "outchar1" to "outchar2". Both ranges must
  1015. be of the same size. The form "number number" is equivalent to a "t"
  1016. command of the first type, and is provided for compatibility with the mapping
  1017. tables issued by the Unicode Consortium.
  1018. Multiple transformation stages can be encoded in a single control file by
  1019. using "f" commands to separate the stages.
  1020. Versions of FIGlet before 2.1 required that the first line of a control file
  1021. consist of the signature string "flc2a". This signature line is still
  1022. permitted in FIGlet 2.2 and later versions, but is no longer required.
  1023. Here is an example of a control file. The blanks at the beginning of each
  1024. line are for readability only, and are not part of the file.
  1025. The following control file:
  1026. flc2a
  1027. t # $
  1028. t A-Z a-z
  1029. will map the "#" character to "$", and will also convert uppercase ASCII to
  1030. lowercase ASCII.
  1031. If a number of consecutive "t" commands are given, then for each character
  1032. processed, only the first applicable command (if any) will be executed.
  1033. Consider this control file:
  1034. t A B
  1035. t B A
  1036. It will swap the characters "A" and "B". If the FIGdriver reads an "A", the
  1037. first command will change "A" to "B", in which case the second will not be
  1038. executed. If the FIGdriver reads a "B", the first command will have no
  1039. effect, and the second command will change "B" to "A". Here is another
  1040. control file:
  1041. t A B
  1042. t A C
  1043. In this example, the second line is never executed. In short, a sequence of
  1044. "t" lines "does what it ought to".
  1045. More complex files, in which a single character is acted upon by several "t"
  1046. commands, can be set up using an "f" command. For example:
  1047. flc2a
  1048. t a-z A-Z
  1049. f
  1050. t Q ~
  1051. This control file specifies two transformation stages. In the first stage,
  1052. lowercase ASCII letters are changed to their uppercase equivalents. The
  1053. second stage maps any Q (whether original or a converted "q") into the "~"
  1054. character. If the "f" command were omitted, "q" characters would remain "Q"
  1055. and not be converted to "~".
  1056. EXTENDED COMMANDS
  1057. The "h", "j", "b", "u", and "g" commands are only understood by FIGlet
  1058. version 2.2 or later. They control how a FIGdriver interprets bytes in the
  1059. input. By default, the FIGdriver interprets each byte of input as a distinct
  1060. character. This mode is suitable for most character encodings. All these
  1061. commands are logically acted on before any other control file commands, no
  1062. matter where in the sequence of control files they appear. They are also
  1063. mutually exclusive; if more than one of these commands is found, only the
  1064. last is acted on. Multiple "g" commands are permitted, however.
  1065. The "h" command forces the input to be interpreted in HZ mode, which is used
  1066. for the HZ character encoding of Chinese text. In this mode, the sequence
  1067. "~{" (which is removed from the input) signals that all following characters
  1068. are two bytes long until the sequence "~}" is detected. In addition, the
  1069. sequence "~~" is changed to just "~", and all other two-byte sequences
  1070. beginning with "~" are removed from the input. The character code
  1071. corresponding to a two-byte character is:
  1072. first character * 256 + second character
  1073. The "j" command forces the input to be interpreted in Shift-JIS mode (also
  1074. called "MS-Kanji mode"). Input bytes in the ranges 128-159 and 224-239 are
  1075. read as the high-order byte of a two-byte character; all other bytes are
  1076. interpreted as one-byte characters. The value of a two-byte character is
  1077. determined in the same way as in HZ mode.
  1078. The "b" command forces the input to be interpreted in DBCS mode, which is
  1079. suitable for processing HZ or Shift-GB Chinese text or Korean text. Input
  1080. bytes in the ranges 128-255 are read as the high-order byte of a two-byte
  1081. character; all other bytes are interpreted as one-byte characters. The
  1082. value of a two-byte character is determined in the same way as in HZ mode.
  1083. The "u" command forces the input to be interpreted in UTF-8 mode, which
  1084. causes any input byte in the range 0x80 to 0xFF to be interpreted as the
  1085. first byte of a multi-byte Unicode (ISO 10646) character. UTF-8 characters
  1086. can be from 1 to 6 bytes long. An incorrectly formatted sequence is
  1087. interpreted as the character 128 (normally an unused control character).
  1088. Otherwise, the input is allowed to contain ISO 2022 escape sequences, which
  1089. are decoded to generate appropriate character codes. These character codes
  1090. are *not* a subset of Unicode, but may be more useful in processing East
  1091. Asian text. A brief explanation of ISO 2022 is given here in order to
  1092. clarify how a FIGdriver should interpret it. The "g" command provides
  1093. information for the ISO 2022 interpreter, and is explained below.
  1094. ISO 2022 text is specified using a mixture of registered character sets.
  1095. At any time, up to four character sets may be available. Character sets
  1096. have one of three sizes: single-byte character sets with 94 characters
  1097. (e.g. ASCII), single-byte character sets with 96 characters (e.g. the top
  1098. halves of ISO Latin-1 to Latin-5), or double-byte character sets with
  1099. 94 x 94 characters (e.g. JIS 0208X-1983). Each registered character set has
  1100. a standard designating byte in the range 48 to 125; the bytes are unique withi
  1101. n character set sizes, but may be reused across sizes. For example, byte 66
  1102. designates the 94-character set ASCII, the 96-character set ISO Latin-2 (top
  1103. half), and the 94 x 94 Japanese character set JIS 0208X-1983. In this
  1104. document, the designating byte of a character set will be represented by <D>.
  1105. The four available character sets are labeled G0, G1, G2, and G3. Initially,
  1106. G0 is the 94-character set ASCII, and G1 is the 96-character set ISO Latin-1
  1107. (top half). The other character sets are unassigned. The following escape
  1108. sequences (where ESC = the byte 27) specify changes to the available
  1109. character sets:
  1110. ESC ( <D> Set G0 to the 94-character set <D>
  1111. ESC ) <D> Set G1 to the 94-character set <D>
  1112. ESC * <D> Set G2 to the 94-character set <D>
  1113. ESC + <D> Set G3 to the 94-character set <D>
  1114. ESC - <D> Set G1 to the 96-character set <D>
  1115. ESC . <D> Set G2 to the 96-character set <D>
  1116. ESC / <D> Set G3 to the 96-character set <D>
  1117. ESC $ <D> Set G0 to the 94 x 94 character set <D>
  1118. ESC $ ( <D> Set G0 to the 94 x 94 character set <D>
  1119. ESC $ ) <D> Set G1 to the 94 x 94 character set <D>
  1120. ESC $ * <D> Set G2 to the 94 x 94 character set <D>
  1121. ESC $ + <D> Set G3 to the 94 x 94 character set <D>
  1122. Note that G0 may not be a 96-character set, and that there are two ways to
  1123. specify a 94 x 94 character set in G0, of which the first is deprecated.
  1124. ISO 2022 decoding affects input bytes in the ranges 33 to 126 and 160 to 255,
  1125. known as "the left half" and "the right half" respectively. All other bytes,
  1126. unless they belong to a control sequence shown in this document, remain
  1127. unchanged. Initially, the left half is interpreted as character set G0,
  1128. and the right half as character set G1. This can be changed by the following
  1129. control sequences:
  1130. SI (byte 15) Interpret the left half as G1 characters
  1131. SO (byte 14) Interpret the left half as G0 characters
  1132. ESC n Interpret the left half as G2 characters
  1133. ESC o Interpret the left half as G3 characters
  1134. ESC ~ Interpret the right half as G1 characters
  1135. ESC } Interpret the right half as G2 characters
  1136. ESC | Interpret the right half as G3 characters
  1137. SS2 (byte 142) Interpret next character only as G2
  1138. ESC N Interpret next character only as G2
  1139. SS3 (byte 143) Interpret next character only as G3
  1140. ESC O Interpret next character only as G3
  1141. This rich schema may be used in various ways. In ISO-2022-JP, the Japanese
  1142. flavor of ISO 2022, only the bytes 33-126 and the G0 character set is used,
  1143. and escape sequences are used to switch between ASCII, ISO-646-JP (the
  1144. Japanese national variant of ASCII), and JIS 0208X-1983. In other versions,
  1145. the G1 character set has 94 x 94 size, and so any byte in the range 160-255
  1146. is automatically the first byte of a double-byte character.
  1147. FIGdrivers that support ISO 2022 do so in the following way. Each character i
  1148. is decoded and assigned to a character set <D>.
  1149. If the character belongs to a 94-bit character set,
  1150. then if its value exceeds 128, it is reduced by 128,
  1151. and the value 65536 * <D> is added to it,
  1152. unless <D> is 66 (ASCII).
  1153. If the character belongs to a 96-bit character set,
  1154. then if its value is less than 128, it is increased by 128,
  1155. and the value 65536 * <D> is added to it,
  1156. unless <D> is 65 (ISO Latin-1).
  1157. If the character belongs to a 94 x 94 character set,
  1158. then the value is the sum of:
  1159. the first byte * 256,
  1160. plus the second byte,
  1161. plus the value 65536 * <D>.
  1162. Thus, the character code 65 ("A") in ASCII remains 65, the character code
  1163. 196 in ISO Latin-1 ("A-umlaut") remains 196, the character code 65 (0x41)
  1164. in ISO-646-JP (whose <D> is 74 = 0x4A) becomes 0x4A0041 =4849729, and the
  1165. two-byte sequence 33 33 (0x21 0x21) in JIS 0208X-1983 (whose <D> is
  1166. 65 = 0x41) becomes 0x412121 = 4268321. These codes may be used in compiling
  1167. FIGfonts suitable for use with ISO 2022 encoded text.
  1168. The initial settings of G0 through G3 and their assignments to the left half
  1169. and the right half can be altered in a control file by using "g" commands,
  1170. as follows:
  1171. g {0|1|2|3} {94|96|94x94} [<D>]
  1172. specifies that one of G0-G3 is a 94, 96, or 94x94 character set with
  1173. designating character <D>. If no designating character is specified, then a
  1174. <D> value of zero is assumed.
  1175. For example, the list of control commands:
  1176. g 0 94 B
  1177. g 1 96 A
  1178. sets the G0 character set to ASCII (94-character set "B") and the G1
  1179. character set to the top half of Latin-1 (96-character set "A"). (This is the
  1180. default setting).
  1181. To change the initial assignments of G0 to the left half and G1 to the right
  1182. half, "g" commands of the form
  1183. g {L|R} {0|1|2|3}
  1184. For example, the command:
  1185. g R 2
  1186. causes right-half bytes (in the range 160-255) to be interpreted as G2.
  1187. Whether these bytes are interpreted singly or in pairs depends on the type
  1188. of character set that is currently available as G2.
  1189. Spaces may be freely used or omitted in "g" commands.
  1190. The standard FIGlet distribution contains mapping tables for Latin-2 (ISO 8859-2),
  1191. Latin-3 (ISO 8859-3), Latin-4 (ISO 8859-4), and Latin-5 (ISO 8859-9). They
  1192. can be used with the font "standard.flf", which contains all the characters
  1193. used in these standards.
  1194. STANDARDIZED CAPABILITIES OF CURRENT AND FUTURE FIGDRIVERS
  1195. ============ ============ == ======= === ====== ==========
  1196. We assert the following as the "Law" of our intentions:
  1197. PROFIT
  1198. All future FIGdrivers shall be FREE OF CHARGE to the general public via the
  1199. Internet. Any advertisements of other works by the author must be in
  1200. documentation only, and limited to ONE "screenful", and shall not appear by
  1201. normal program behavior, nor interfere with normal behavior. No FIGdriver
  1202. shall disable itself after a set period of time or request "donations".
  1203. No FIGdriver shall offer any other FIGdriver with improved capability for
  1204. creating FIGures in exchange for money.
  1205. REQUIRED FEATURES OF FUTURE VERSIONS
  1206. Future FIGdrivers must read and process FIGfont files as described in this
  1207. document, but are not necessarily expected to process control files, smush,
  1208. perform fitting or kerning, perform vertical operations, or even produce
  1209. multiple lines in output FIGures.
  1210. FIGDRIVER NAMES
  1211. Future FIGdrivers must be named to include capitalized "FIG" and shall have
  1212. an incremental version number specific to its own platform.
  1213. BACKWARDS COMPATIBILITY OF FUTURE VERSIONS
  1214. Any future FIGdriver created for the same platform as an existing FIGdriver,
  1215. and using the same name as the existing FIGdriver, shall be considered a new
  1216. version of the preceding FIGdriver, and shall contain all historical comments
  1217. of updates to past versions on the same platform, and shall have full
  1218. capability of the preceding versions. If the source code is not provided to
  1219. the general public, it shall be at least provided to any potential developers
  1220. of later versions, and such comments relating to past versions shall be
  1221. accessible to any user by other means or documentation. If a new program is
  1222. created on a platform that already has an existing FIGdriver, it must be
  1223. given a new and distinct name. This allows multiple FIGdrivers to exist for
  1224. the same platform with different capabilities.
  1225. The format of FIGfonts may not be modified to be non-backwards compatible
  1226. UNLESS:
  1227. 1) The new format is easily editable as an ASCII text file,
  1228. beginning with the characters "flf" followed by a sequential
  1229. number.
  1230. 2) At least all of the same information can be derived from the
  1231. new format as the prior format (currently "flf2"). This
  1232. includes the main comments which give credit to the FIGfont
  1233. designer.
  1234. 3) Individuals are found who are willing and have the ability to
  1235. either port or develop versions for at least UNIX, DOS,
  1236. Windows, and Amiga which will read both the new formats AND the
  1237. prior format (currently "flf2"), and retain the capability of
  1238. past versions. It is intended that this will be expanded to
  1239. include Macintosh if a GUI version exists. This list of
  1240. required operating systems may be reduced if an operating
  1241. system falls out of popularity or increased if a new operating
  1242. system for which there is a FIGdriver comes into greater
  1243. popularity, according to the consensus of opinions of past
  1244. developers for the most popular operating systems.
  1245. 4) A C, Java, or other version must always exist which can
  1246. receive input and instructions either from a command line, a
  1247. file, or directly over the internet so that FIGures can be
  1248. obtained from internet-based services without the need to
  1249. download any FIGdriver.
  1250. 5) All existing FIGfonts available from the "official" point of
  1251. distribution (http://st-www.cs.uiuc.edu/users/chai/figlet.html),
  1252. must be converted to the new format, and offered for download
  1253. alongsidethe new versions.
  1254. THE FUNCTION OF WORD WRAPPING
  1255. All future FIGdrivers should duplicate these behaviors, unless a version is
  1256. only capable of outputting one-line FIGures, which is acceptable as long no
  1257. preceding versions exist for its platform which can output multiple-line
  1258. FIGures.
  1259. FIGdrivers which perform word wrapping do so by watching for blanks (spaces)
  1260. in input text, making sure that the FIGure is no more wide than the maximum
  1261. width allowed.
  1262. Input text may also include linebreaks, so that a user may specify where
  1263. lines begin or end instead of relying on the word wrapping of the FIGdriver.
  1264. (Linebreaks are represented by different bytes on different platforms, so
  1265. each FIGdriver must watch for the appropriate linebreaks for its particular
  1266. platform.)
  1267. When a FIGdriver word wraps and there are several consecutive blanks in input
  1268. text where the wrapping occurred, the FIGdriver will disregard all blanks
  1269. until the next non-blank input character is encountered. However, if blanks
  1270. in input text immediately follow a linebreak, or if blanks are the first
  1271. characters in the input text, the blanks will be "printed", moving any
  1272. visible FIGcharacters which follow on the same output line to the right.
  1273. Similarly, if an image is right-aligned, and blanks immediately precede
  1274. linebreaks or the end of input text, a FIGdriver will move an entire line of
  1275. output FIGcharacters to the left to make room for the blank FIGcharacters
  1276. until the left margin is encountered. (If the print direction is
  1277. right-to-left, everything stated in this paragraph is reversed.)
  1278. Word processing programs or text editors usually behave similarly in all
  1279. regards to word wrapping.
  1280. GENERAL INTENT FOR CROSS-PLATFORM PORTABILITY
  1281. Currently, all versions of FIGlet are compiled from C code, while FIGWin 1.0
  1282. is written in Visual Basic. Over time it is intended that a later version of
  1283. FIGWin will be created using a GUI C programming language, and that the
  1284. FIGlet C code shall continue to be written to be easily "plugged in" to a
  1285. GUI shell. It is preferable for developers of FIGdrivers for new platforms
  1286. to use C or a GUI version of C, so that when the core rendering engine of
  1287. FIGlet is updated, it will be portable to other platforms.
  1288. CONTROL FILE COMMANDS
  1289. New control file commands may be added to later versions of this standard.
  1290. However, the commands "c", "d", and "s" are permanently reserved and may
  1291. never be given a meaning.
  1292. FILE COMPRESSION
  1293. FIGfonts (and control files) are often quite long, especially if many
  1294. FIGcharacters are included, or if the FIGcharacters are large. Therefore,
  1295. some FIGdrivers (at present, only FIGlet version 2.2 or later) allow
  1296. compressed FIGfonts and control files.
  1297. The standard for FIG compression is to place the FIGfont or control file into
  1298. a ZIP archive. ZIP archives can be created by the proprietary program PKZIP
  1299. on DOS and Windows platforms, or by the free program Info-ZIP ZIP on almost
  1300. all platforms. More information on ZIP can be obtained at
  1301. http://www.cdrom.com/pub/infozip/Info-Zip.html .
  1302. The ZIP archive must contain only a single file. Any files in the archive
  1303. after the first are ignored by FIGdrivers. In addition, the standard
  1304. extension ".zip" of the archive must be changed to ".flf" or ".flc" as
  1305. appropriate. It does not matter what the name of the file within the
  1306. archive is.
  1307. CHART OF CAPABILITIES OF FIGLET 2.2 AND FIGWIN 1.0
  1308. ===== == ============ == ====== === === ====== ===
  1309. The following chart lists all capabilities which are either new with the
  1310. release of both FIGdrivers, or is not a common capability among both.
  1311. FIGlet 2.2 FIGWIN 1.0
  1312. Interpreting the Full_Layout parameter: Yes Yes
  1313. Universal smushing: Yes Yes
  1314. Supporting multi-byte input text formats: Yes No
  1315. Processing control files: Yes No
  1316. Changing default smushing rules: Yes No
  1317. Bundled with a GUI editor of FIGfonts: No Yes
  1318. Vertical fitting and smushing: No Yes
  1319. ___________ __ _
  1320. \_ _____/ ____ |__| ____ ___ __ | |
  1321. | __)_ / \ | |/ _ < | || |
  1322. | \ | \ | ( <_> )___ | \|
  1323. /_______ /___| /\__| |\____// ____| __
  1324. \/ \/\______| \/ \/