shell.lib 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  1. #
  2. # Shell library - for building devutf tables.
  3. #
  4. RESOLUTION=720
  5. UNITWIDTH=10
  6. OCTALESCAPES=${OCTALESCAPES:-160} # <= code means add \0ddd names
  7. DOWNLOADVECTOR=FALSE # TRUE can mean incomplete tables
  8. #
  9. # BuiltinTables returns command lines that generate PostScript programs
  10. # for building a typesetter description file and font width tables for
  11. # a relatively standard collection of fonts. Use awk to select a command
  12. # line or modify an existing command to build a width table for a new
  13. # font.
  14. #
  15. BuiltinTables() {
  16. cat <<-'//End of BuiltinTables'
  17. Proportional R Times-Roman
  18. Proportional I Times-Italic
  19. Proportional B Times-Bold
  20. Proportional BI Times-BoldItalic
  21. Proportional AB AvantGarde-Demi
  22. Proportional AI AvantGarde-BookOblique
  23. Proportional AR AvantGarde-Book
  24. Proportional AX AvantGarde-DemiOblique
  25. Proportional H Helvetica
  26. Proportional HB Helvetica-Bold
  27. Proportional HI Helvetica-Oblique
  28. Proportional HX Helvetica-BoldOblique
  29. Proportional Hb Helvetica-Narrow-Bold
  30. Proportional Hi Helvetica-Narrow-Oblique
  31. Proportional Hr Helvetica-Narrow
  32. Proportional Hx Helvetica-Narrow-BoldOblique
  33. Proportional KB Bookman-Demi
  34. Proportional KI Bookman-LightItalic
  35. Proportional KR Bookman-Light
  36. Proportional KX Bookman-DemiItalic
  37. Proportional NB NewCenturySchlbk-Bold
  38. Proportional NI NewCenturySchlbk-Italic
  39. Proportional NR NewCenturySchlbk-Roman
  40. Proportional NX NewCenturySchlbk-BoldItalic
  41. Proportional PA Palatino-Roman
  42. Proportional PB Palatino-Bold
  43. Proportional PI Palatino-Italic
  44. Proportional PX Palatino-BoldItalic
  45. Proportional ZI ZapfChancery-MediumItalic
  46. FixedWidth C Courier
  47. FixedWidth CB Courier-Bold
  48. FixedWidth CI Courier-Oblique
  49. FixedWidth CO Courier
  50. FixedWidth CW Courier
  51. FixedWidth CX Courier-BoldOblique
  52. Dingbats ZD ZapfDingbats
  53. Greek GR Symbol
  54. Symbol S Symbol
  55. Special S1 Times-Roman
  56. Description DESC ---
  57. //End of BuiltinTables
  58. }
  59. #
  60. # AllTables prints the complete list of builtin font names.
  61. #
  62. AllTables() {
  63. BuiltinTables | awk '{print $2}'
  64. }
  65. #
  66. # Charset functions generate keyword/value pairs (as PostScript objects)
  67. # that describe the character set available in a font. The keyword is a
  68. # PostScript string that represents troff's name for the character. The
  69. # value is usually the literal name (i.e. begins with a /) assigned to
  70. # the character in the PostScript font. The value can also be an integer
  71. # or a PostScript string. An integer value is used as an index in the
  72. # current font's Encoding array. A string value is returned to the host
  73. # unchanged when the entry for the character is constructed. Entries that
  74. # have (") as their value are synonyms for the preceeding character.
  75. #
  76. # The 18 characters missing from ROM resident fonts on older printers are
  77. # flagged with the PostScript comment "% missing".
  78. #
  79. StandardCharset() {
  80. cat <<-'//End of StandardCharset'
  81. (!) /exclam
  82. (") /quotedbl
  83. (dq) (") % synonym
  84. (#) /numbersign
  85. ($) /dollar
  86. (%) /percent
  87. (&) /ampersand
  88. (') /quoteright
  89. (\() /parenleft
  90. (\)) /parenright
  91. (*) /asterisk
  92. (+) /plus
  93. (,) /comma
  94. (-) /hyphen % changed from minus by request
  95. (.) /period
  96. (/) /slash
  97. (0) /zero
  98. (1) /one
  99. (2) /two
  100. (3) /three
  101. (4) /four
  102. (5) /five
  103. (6) /six
  104. (7) /seven
  105. (8) /eight
  106. (9) /nine
  107. (:) /colon
  108. (;) /semicolon
  109. (<) /less
  110. (=) /equal
  111. (>) /greater
  112. (?) /question
  113. (@) /at
  114. (A) /A
  115. (B) /B
  116. (C) /C
  117. (D) /D
  118. (E) /E
  119. (F) /F
  120. (G) /G
  121. (H) /H
  122. (I) /I
  123. (J) /J
  124. (K) /K
  125. (L) /L
  126. (M) /M
  127. (N) /N
  128. (O) /O
  129. (P) /P
  130. (Q) /Q
  131. (R) /R
  132. (S) /S
  133. (T) /T
  134. (U) /U
  135. (V) /V
  136. (W) /W
  137. (X) /X
  138. (Y) /Y
  139. (Z) /Z
  140. ([) /bracketleft
  141. (\\) /backslash
  142. (bs) (") % synonym
  143. (]) /bracketright
  144. (^) /asciicircum
  145. (_) /underscore
  146. (`) /quoteleft
  147. (a) /a
  148. (b) /b
  149. (c) /c
  150. (d) /d
  151. (e) /e
  152. (f) /f
  153. (g) /g
  154. (h) /h
  155. (i) /i
  156. (j) /j
  157. (k) /k
  158. (l) /l
  159. (m) /m
  160. (n) /n
  161. (o) /o
  162. (p) /p
  163. (q) /q
  164. (r) /r
  165. (s) /s
  166. (t) /t
  167. (u) /u
  168. (v) /v
  169. (w) /w
  170. (x) /x
  171. (y) /y
  172. (z) /z
  173. ({) /braceleft
  174. (|) /bar
  175. (}) /braceright
  176. (~) /asciitilde
  177. (\\`) /grave % devpost character
  178. (ga) (") % synonym
  179. (!!) /exclamdown
  180. (c|) /cent
  181. (ct) (") % devpost synonym
  182. (L-) /sterling
  183. (ps) (") % devpost synonym
  184. (xo) /currency
  185. (cr) (") % devpost synonym
  186. (Y-) /yen
  187. (yn) (") % devpost synonym
  188. (||) /brokenbar % missing
  189. (so) /section
  190. (sc) (") % devpost synonym
  191. ("") /dieresis
  192. (:a) (") % devpost synonym
  193. (co) /copyright
  194. (a_) /ordfeminine
  195. (<<) /guillemotleft
  196. (-,) /logicalnot
  197. (hy) /hyphen
  198. (--) /minus
  199. (ro) /registered
  200. (rg) (") % devpost synonym
  201. (-^) /macron
  202. (-a) (") % devpost synonym
  203. (0^) /degree % missing
  204. (+-) /plusminus % missing
  205. (2^) /twosuperior % missing
  206. (3^) /threesuperior % missing
  207. (\\') /acute
  208. (aa) (") % devpost synonym
  209. (/u) /mu % missing
  210. (P!) /paragraph
  211. (pg) (") % devpost synonym
  212. (.^) /periodcentered
  213. (,,) /cedilla
  214. (,a) (") % devpost synonym
  215. (1^) /onesuperior % missing
  216. (o_) /ordmasculine
  217. (>>) /guillemotright
  218. (14) /onequarter % missing
  219. (12) /onehalf % missing
  220. (34) /threequarters % missing
  221. (??) /questiondown
  222. (A`) /Agrave
  223. (A') /Aacute
  224. (A^) /Acircumflex
  225. (A~) /Atilde
  226. (A") /Adieresis
  227. (A*) /Aring
  228. (AE) /AE
  229. (C,) /Ccedilla
  230. (E`) /Egrave
  231. (E') /Eacute
  232. (E^) /Ecircumflex
  233. (E") /Edieresis
  234. (I`) /Igrave
  235. (I') /Iacute
  236. (I^) /Icircumflex
  237. (I") /Idieresis
  238. (D-) /Eth % missing
  239. (N~) /Ntilde
  240. (O`) /Ograve
  241. (O') /Oacute
  242. (O^) /Ocircumflex
  243. (O~) /Otilde
  244. (O") /Odieresis
  245. (xx) /multiply % missing
  246. (O/) /Oslash
  247. (U`) /Ugrave
  248. (U') /Uacute
  249. (U^) /Ucircumflex
  250. (U") /Udieresis
  251. (Y') /Yacute % missing
  252. (TH) /Thorn % missing
  253. (ss) /germandbls
  254. (a`) /agrave
  255. (a') /aacute
  256. (a^) /acircumflex
  257. (a~) /atilde
  258. (a") /adieresis
  259. (a*) /aring
  260. (ae) /ae
  261. (c,) /ccedilla
  262. (e`) /egrave
  263. (e') /eacute
  264. (e^) /ecircumflex
  265. (e") /edieresis
  266. (i`) /igrave
  267. (i') /iacute
  268. (i^) /icircumflex
  269. (i") /idieresis
  270. (d-) /eth % missing
  271. (n~) /ntilde
  272. (o`) /ograve
  273. (o') /oacute
  274. (o^) /ocircumflex
  275. (o~) /otilde
  276. (o") /odieresis
  277. (-:) /divide % missing
  278. (o/) /oslash
  279. (u`) /ugrave
  280. (u') /uacute
  281. (u^) /ucircumflex
  282. (u") /udieresis
  283. (y') /yacute % missing
  284. (th) /thorn % missing
  285. (y") /ydieresis
  286. (^a) /circumflex % devpost accent
  287. (~a) /tilde % devpost accent
  288. (Ua) /breve % devpost accent
  289. (.a) /dotaccent % devpost accent
  290. (oa) /ring % devpost accent
  291. ("a) /hungarumlaut % devpost accent
  292. (Ca) /ogonek % devpost accent
  293. (va) /caron % devpost accent
  294. //End of StandardCharset
  295. }
  296. #
  297. # DingbatsCharset guarantees changes in StandardCharset don't show up in ZD.
  298. #
  299. DingbatsCharset() {
  300. cat <<-'//End of DingbatsCharset'
  301. (!) /exclam
  302. (") /quotedbl
  303. (#) /numbersign
  304. ($) /dollar
  305. (%) /percent
  306. (&) /ampersand
  307. (') /quoteright
  308. (\() /parenleft
  309. (\)) /parenright
  310. (*) /asterisk
  311. (+) /plus
  312. (,) /comma
  313. (-) /minus % also hyphen in devpost
  314. (.) /period
  315. (/) /slash
  316. (0) /zero
  317. (1) /one
  318. (2) /two
  319. (3) /three
  320. (4) /four
  321. (5) /five
  322. (6) /six
  323. (7) /seven
  324. (8) /eight
  325. (9) /nine
  326. (:) /colon
  327. (;) /semicolon
  328. (<) /less
  329. (=) /equal
  330. (>) /greater
  331. (?) /question
  332. (@) /at
  333. (A) /A
  334. (B) /B
  335. (C) /C
  336. (D) /D
  337. (E) /E
  338. (F) /F
  339. (G) /G
  340. (H) /H
  341. (I) /I
  342. (J) /J
  343. (K) /K
  344. (L) /L
  345. (M) /M
  346. (N) /N
  347. (O) /O
  348. (P) /P
  349. (Q) /Q
  350. (R) /R
  351. (S) /S
  352. (T) /T
  353. (U) /U
  354. (V) /V
  355. (W) /W
  356. (X) /X
  357. (Y) /Y
  358. (Z) /Z
  359. ([) /bracketleft
  360. (\\) /backslash
  361. (]) /bracketright
  362. (^) /asciicircum
  363. (_) /underscore
  364. (`) /quoteleft
  365. (a) /a
  366. (b) /b
  367. (c) /c
  368. (d) /d
  369. (e) /e
  370. (f) /f
  371. (g) /g
  372. (h) /h
  373. (i) /i
  374. (j) /j
  375. (k) /k
  376. (l) /l
  377. (m) /m
  378. (n) /n
  379. (o) /o
  380. (p) /p
  381. (q) /q
  382. (r) /r
  383. (s) /s
  384. (t) /t
  385. (u) /u
  386. (v) /v
  387. (w) /w
  388. (x) /x
  389. (y) /y
  390. (z) /z
  391. ({) /braceleft
  392. (|) /bar
  393. (}) /braceright
  394. (~) /asciitilde
  395. (\\`) /grave % devpost character
  396. (!!) /exclamdown
  397. (c|) /cent
  398. (L-) /sterling
  399. (xo) /currency
  400. (Y-) /yen
  401. (||) /brokenbar % missing
  402. (so) /section
  403. ("") /dieresis
  404. (co) /copyright
  405. (a_) /ordfeminine
  406. (<<) /guillemotleft
  407. (-,) /logicalnot
  408. (hy) /hyphen
  409. (ro) /registered
  410. (-^) /macron
  411. (0^) /degree % missing
  412. (+-) /plusminus % missing
  413. (2^) /twosuperior % missing
  414. (3^) /threesuperior % missing
  415. (\\') /acute
  416. (/u) /mu % missing
  417. (P!) /paragraph
  418. (.^) /periodcentered
  419. (,,) /cedilla
  420. (1^) /onesuperior % missing
  421. (o_) /ordmasculine
  422. (>>) /guillemotright
  423. (14) /onequarter % missing
  424. (12) /onehalf % missing
  425. (34) /threequarters % missing
  426. (??) /questiondown
  427. (A`) /Agrave
  428. (A') /Aacute
  429. (A^) /Acircumflex
  430. (A~) /Atilde
  431. (A") /Adieresis
  432. (A*) /Aring
  433. (AE) /AE
  434. (C,) /Ccedilla
  435. (E`) /Egrave
  436. (E') /Eacute
  437. (E^) /Ecircumflex
  438. (E") /Edieresis
  439. (I`) /Igrave
  440. (I') /Iacute
  441. (I^) /Icircumflex
  442. (I") /Idieresis
  443. (D-) /Eth % missing
  444. (N~) /Ntilde
  445. (O`) /Ograve
  446. (O') /Oacute
  447. (O^) /Ocircumflex
  448. (O~) /Otilde
  449. (O") /Odieresis
  450. (xx) /multiply % missing
  451. (O/) /Oslash
  452. (U`) /Ugrave
  453. (U') /Uacute
  454. (U^) /Ucircumflex
  455. (U") /Udieresis
  456. (Y') /Yacute % missing
  457. (TH) /Thorn % missing
  458. (ss) /germandbls
  459. (a`) /agrave
  460. (a') /aacute
  461. (a^) /acircumflex
  462. (a~) /atilde
  463. (a") /adieresis
  464. (a*) /aring
  465. (ae) /ae
  466. (c,) /ccedilla
  467. (e`) /egrave
  468. (e') /eacute
  469. (e^) /ecircumflex
  470. (e") /edieresis
  471. (i`) /igrave
  472. (i') /iacute
  473. (i^) /icircumflex
  474. (i") /idieresis
  475. (d-) /eth % missing
  476. (n~) /ntilde
  477. (o`) /ograve
  478. (o') /oacute
  479. (o^) /ocircumflex
  480. (o~) /otilde
  481. (o") /odieresis
  482. (-:) /divide % missing
  483. (o/) /oslash
  484. (u`) /ugrave
  485. (u') /uacute
  486. (u^) /ucircumflex
  487. (u") /udieresis
  488. (y') /yacute % missing
  489. (th) /thorn % missing
  490. (y") /ydieresis
  491. //End of DingbatsCharset
  492. }
  493. SymbolCharset() {
  494. cat <<-'//End of SymbolCharset'
  495. (---) /exclam
  496. (fa) /universal
  497. (---) /numbersign
  498. (te) /existential
  499. (---) /percent
  500. (---) /ampersand
  501. (st) /suchthat
  502. (---) /parenleft
  503. (---) /parenright
  504. (**) /asteriskmath
  505. (pl) /plus
  506. (---) /comma
  507. (mi) /minus
  508. (---) /period
  509. (sl) /slash
  510. (---) /zero
  511. (---) /one
  512. (---) /two
  513. (---) /three
  514. (---) /four
  515. (---) /five
  516. (---) /six
  517. (---) /seven
  518. (---) /eight
  519. (---) /nine
  520. (---) /colon
  521. (---) /semicolon
  522. (<) /less
  523. (eq) /equal
  524. (>) /greater
  525. (---) /question
  526. (cg) /congruent
  527. (*A) /Alpha
  528. (\244x) (")
  529. (*B) /Beta
  530. (\244y) (")
  531. (*X) /Chi
  532. (\244\257) (")
  533. (*D) /Delta
  534. (\244{) (")
  535. (*E) /Epsilon
  536. (\244|) (")
  537. (*F) /Phi
  538. (\244\256) (")
  539. (*G) /Gamma
  540. (\244z) (")
  541. (*Y) /Eta
  542. (\244~) (")
  543. (*I) /Iota
  544. (\244\241) (")
  545. (---) /theta1
  546. (\244\331) (")
  547. (*K) /Kappa
  548. (\244\242) (")
  549. (*L) /Lambda
  550. (\244\243) (")
  551. (*M) /Mu
  552. (\244\244) (")
  553. (*N) /Nu
  554. (\244\245) (")
  555. (*O) /Omicron
  556. (\244\247) (")
  557. (*P) /Pi
  558. (\244\250) (")
  559. (*H) /Theta
  560. (\244\240) (")
  561. (*R) /Rho
  562. (\244\251) (")
  563. (*S) /Sigma
  564. (\244\253) (")
  565. (*T) /Tau
  566. (\244\254) (")
  567. (*U) /Upsilon
  568. (\244\255) (")
  569. (ts) /sigma1
  570. (\244\312) (")
  571. (*W) /Omega
  572. (\244\261) (")
  573. (*C) /Xi
  574. (\244\246) (")
  575. (*Q) /Psi
  576. (\244\260) (")
  577. (*Z) /Zeta
  578. (\244}) (")
  579. (---) /bracketleft
  580. (tf) /therefore
  581. (---) /bracketright
  582. (pp) /perpendicular
  583. (ul) /underscore
  584. (_) (") % synonym
  585. (rn) /radicalex
  586. (*a) /alpha
  587. (\244\271) (")
  588. (*b) /beta
  589. (\244\272) (")
  590. (*x) /chi
  591. (\244\317) (")
  592. (*d) /delta
  593. (\244\274) (")
  594. (*e) /epsilon
  595. (\244\275) (")
  596. (*f) /phi
  597. (\244\316) (")
  598. (*g) /gamma
  599. (\244\273) (")
  600. (*y) /eta
  601. (\244\277) (")
  602. (*i) /iota
  603. (\244\301) (")
  604. (---) /phi1
  605. (\244\335) (")
  606. (*k) /kappa
  607. (\244\302) (")
  608. (*l) /lambda
  609. (\244\303) (")
  610. (*m) /mu
  611. (\244\304) (")
  612. (*n) /nu
  613. (\244\305) (")
  614. (*o) /omicron
  615. (\244\307) (")
  616. (*p) /pi
  617. (\244\310) (")
  618. (*h) /theta
  619. (\244\300) (")
  620. (*r) /rho
  621. (\244\311) (")
  622. (*s) /sigma
  623. (\244\313) (")
  624. (*t) /tau
  625. (\244\314) (")
  626. (*u) /upsilon
  627. (\244\315) (")
  628. (---) /omega1
  629. (\244\336) (")
  630. (*w) /omega
  631. (\244\321) (")
  632. (*c) /xi
  633. (\244\306) (")
  634. (*q) /psi
  635. (\244\320) (")
  636. (*z) /zeta
  637. (\244\276) (")
  638. (---) /braceleft
  639. (or) /bar
  640. (---) /braceright
  641. (ap) /similar
  642. (---) /Upsilon1
  643. (fm) /minute
  644. (<=) /lessequal
  645. (fr) /fraction % devpost character
  646. (if) /infinity
  647. (fn) /florin % devpost character
  648. (---) /club
  649. (---) /diamond
  650. (---) /heart
  651. (---) /spade
  652. (ab) /arrowboth
  653. (<-) /arrowleft
  654. (ua) /arrowup
  655. (->) /arrowright
  656. (da) /arrowdown
  657. (de) /degree
  658. (+-) /plusminus
  659. (---) /second
  660. (>=) /greaterequal
  661. (mu) /multiply
  662. (pt) /proportional
  663. (pd) /partialdiff
  664. (bu) /bullet
  665. (di) /divide
  666. (!=) /notequal
  667. (==) /equivalence
  668. (~~) /approxequal
  669. (el) /ellipsis
  670. (av) /arrowvertex
  671. (ah) /arrowhorizex
  672. (CR) /carriagereturn
  673. (af) /aleph
  674. (If) /Ifraktur
  675. (Rf) /Rfraktur
  676. (ws) /weierstrass
  677. (Ox) /circlemultiply
  678. (O+) /circleplus
  679. (es) /emptyset
  680. (ca) /intersection
  681. (cu) /union
  682. (sp) /propersuperset
  683. (ip) /reflexsuperset
  684. (!b) /notsubset
  685. (sb) /propersubset
  686. (ib) /reflexsubset
  687. (mo) /element
  688. (!m) /notelement
  689. (an) /angle
  690. (gr) /gradient
  691. (rg) /registerserif
  692. (co) /copyrightserif
  693. (tm) /trademarkserif
  694. (---) /product
  695. (sr) /radical
  696. (c.) /dotmath
  697. (no) /logicalnot
  698. (l&) /logicaland
  699. (l|) /logicalor
  700. (---) /arrowdblboth
  701. (---) /arrowdblleft
  702. (---) /arrowdblup
  703. (---) /arrowdblright
  704. (---) /arrowdbldown
  705. (lz) /lozenge
  706. (b<) /angleleft
  707. (RG) /registersans
  708. (CO) /copyrightsans
  709. (TM) /trademarksans
  710. (---) /summation
  711. (LT) /parenlefttp
  712. (br) /parenleftex
  713. (LX) (") % synonym
  714. (LB) /parenleftbt
  715. (lc) /bracketlefttp
  716. (lx) /bracketleftex
  717. (lf) /bracketleftbt
  718. (lt) /bracelefttp
  719. (lk) /braceleftmid
  720. (lb) /braceleftbt
  721. (bv) /braceex
  722. (|) (") % synonym
  723. (b>) /angleright
  724. (is) /integral
  725. (---) /integraltp
  726. (---) /integralex
  727. (---) /integralbt
  728. (RT) /parenrighttp
  729. (RX) /parenrightex
  730. (RB) /parenrightbt
  731. (rc) /bracketrighttp
  732. (rx) /bracketrightex
  733. (rf) /bracketrightbt
  734. (rt) /bracerighttp
  735. (rk) /bracerightmid
  736. (rb) /bracerightbt
  737. (~=) (55 0 1) % charlib
  738. //End of SymbolCharset
  739. }
  740. SpecialCharset() {
  741. cat <<-'//End of SpecialCharset'
  742. (ru) /underscore
  743. ('') /quotedblright % devpost character
  744. (``) /quotedblleft % devpost character
  745. (dg) /dagger % devpost character
  746. (dd) /daggerdbl % devpost character
  747. (en) /endash % devpost character
  748. (\\-) (") % synonym
  749. (em) /emdash
  750. % (ff) (60 2 1) % charlib
  751. % (Fi) (84 2 1) % charlib
  752. % (Fl) (84 2 1) % charlib
  753. (14) (75 2 1) % charlib
  754. (12) (75 2 1) % charlib
  755. (34) (75 2 1) % charlib
  756. (bx) (50 2 1) % charlib
  757. (ob) (38 2 1) % charlib
  758. (ci) (75 0 1) % charlib
  759. (sq) (50 2 1) % charlib
  760. (Sl) (50 2 1) % charlib
  761. (L1) (110 1 1) % charlib
  762. (LA) (110 1 1) % charlib
  763. (LV) (110 3 1) % charlib
  764. (LH) (210 1 1) % charlib
  765. (lh) (100 0 1) % charlib
  766. (rh) (100 0 1) % charlib
  767. (lH) (100 0 1) % charlib
  768. (rH) (100 0 1) % charlib
  769. (PC) (220 2 1) % charlib
  770. (DG) (185 2 1) % charlib
  771. //End of SpecialCharset
  772. }
  773. #
  774. # Latin1 ensures a font uses the ISOLatin1Encoding vector, although only
  775. # text fonts should be re-encoded. Downloading the Encoding vector doesn't
  776. # often make sense. No ISOLatin1Encoding array likely means ROM based fonts
  777. # on your printer are incomplete. Type 1 fonts with a full Latin1 character
  778. # set appeared sometime after Version 50.0.
  779. #
  780. Latin1() {
  781. if [ "$DOWNLOADVECTOR" = TRUE ]; then
  782. cat <<-'//End of ISOLatin1Encoding'
  783. /ISOLatin1Encoding [
  784. /.notdef
  785. /.notdef
  786. /.notdef
  787. /.notdef
  788. /.notdef
  789. /.notdef
  790. /.notdef
  791. /.notdef
  792. /.notdef
  793. /.notdef
  794. /.notdef
  795. /.notdef
  796. /.notdef
  797. /.notdef
  798. /.notdef
  799. /.notdef
  800. /.notdef
  801. /.notdef
  802. /.notdef
  803. /.notdef
  804. /.notdef
  805. /.notdef
  806. /.notdef
  807. /.notdef
  808. /.notdef
  809. /.notdef
  810. /.notdef
  811. /.notdef
  812. /.notdef
  813. /.notdef
  814. /.notdef
  815. /.notdef
  816. /space
  817. /exclam
  818. /quotedbl
  819. /numbersign
  820. /dollar
  821. /percent
  822. /ampersand
  823. /quoteright
  824. /parenleft
  825. /parenright
  826. /asterisk
  827. /plus
  828. /comma
  829. /minus
  830. /period
  831. /slash
  832. /zero
  833. /one
  834. /two
  835. /three
  836. /four
  837. /five
  838. /six
  839. /seven
  840. /eight
  841. /nine
  842. /colon
  843. /semicolon
  844. /less
  845. /equal
  846. /greater
  847. /question
  848. /at
  849. /A
  850. /B
  851. /C
  852. /D
  853. /E
  854. /F
  855. /G
  856. /H
  857. /I
  858. /J
  859. /K
  860. /L
  861. /M
  862. /N
  863. /O
  864. /P
  865. /Q
  866. /R
  867. /S
  868. /T
  869. /U
  870. /V
  871. /W
  872. /X
  873. /Y
  874. /Z
  875. /bracketleft
  876. /backslash
  877. /bracketright
  878. /asciicircum
  879. /underscore
  880. /quoteleft
  881. /a
  882. /b
  883. /c
  884. /d
  885. /e
  886. /f
  887. /g
  888. /h
  889. /i
  890. /j
  891. /k
  892. /l
  893. /m
  894. /n
  895. /o
  896. /p
  897. /q
  898. /r
  899. /s
  900. /t
  901. /u
  902. /v
  903. /w
  904. /x
  905. /y
  906. /z
  907. /braceleft
  908. /bar
  909. /braceright
  910. /asciitilde
  911. /.notdef
  912. /.notdef
  913. /.notdef
  914. /.notdef
  915. /.notdef
  916. /.notdef
  917. /.notdef
  918. /.notdef
  919. /.notdef
  920. /.notdef
  921. /.notdef
  922. /.notdef
  923. /.notdef
  924. /.notdef
  925. /.notdef
  926. /.notdef
  927. /.notdef
  928. /dotlessi
  929. /grave
  930. /acute
  931. /circumflex
  932. /tilde
  933. /macron
  934. /breve
  935. /dotaccent
  936. /dieresis
  937. /.notdef
  938. /ring
  939. /cedilla
  940. /.notdef
  941. /hungarumlaut
  942. /ogonek
  943. /caron
  944. /space
  945. /exclamdown
  946. /cent
  947. /sterling
  948. /currency
  949. /yen
  950. /brokenbar
  951. /section
  952. /dieresis
  953. /copyright
  954. /ordfeminine
  955. /guillemotleft
  956. /logicalnot
  957. /hyphen
  958. /registered
  959. /macron
  960. /degree
  961. /plusminus
  962. /twosuperior
  963. /threesuperior
  964. /acute
  965. /mu
  966. /paragraph
  967. /periodcentered
  968. /cedilla
  969. /onesuperior
  970. /ordmasculine
  971. /guillemotright
  972. /onequarter
  973. /onehalf
  974. /threequarters
  975. /questiondown
  976. /Agrave
  977. /Aacute
  978. /Acircumflex
  979. /Atilde
  980. /Adieresis
  981. /Aring
  982. /AE
  983. /Ccedilla
  984. /Egrave
  985. /Eacute
  986. /Ecircumflex
  987. /Edieresis
  988. /Igrave
  989. /Iacute
  990. /Icircumflex
  991. /Idieresis
  992. /Eth
  993. /Ntilde
  994. /Ograve
  995. /Oacute
  996. /Ocircumflex
  997. /Otilde
  998. /Odieresis
  999. /multiply
  1000. /Oslash
  1001. /Ugrave
  1002. /Uacute
  1003. /Ucircumflex
  1004. /Udieresis
  1005. /Yacute
  1006. /Thorn
  1007. /germandbls
  1008. /agrave
  1009. /aacute
  1010. /acircumflex
  1011. /atilde
  1012. /adieresis
  1013. /aring
  1014. /ae
  1015. /ccedilla
  1016. /egrave
  1017. /eacute
  1018. /ecircumflex
  1019. /edieresis
  1020. /igrave
  1021. /iacute
  1022. /icircumflex
  1023. /idieresis
  1024. /eth
  1025. /ntilde
  1026. /ograve
  1027. /oacute
  1028. /ocircumflex
  1029. /otilde
  1030. /odieresis
  1031. /divide
  1032. /oslash
  1033. /ugrave
  1034. /uacute
  1035. /ucircumflex
  1036. /udieresis
  1037. /yacute
  1038. /thorn
  1039. /ydieresis
  1040. ] def
  1041. //End of ISOLatin1Encoding
  1042. fi
  1043. echo "ISOLatin1Encoding /$1 ReEncode"
  1044. }
  1045. #
  1046. # Generating functions output PostScript programs that build font width
  1047. # tables or a typesetter description file. Send the program to a printer
  1048. # and the complete table will come back on the serial port. All write on
  1049. # stdout and assume the prologue and other required PostScript files are
  1050. # all available.
  1051. #
  1052. Proportional() {
  1053. echo "/unitwidth $UNITWIDTH def"
  1054. echo "/resolution $RESOLUTION def"
  1055. echo "/octalescapes $OCTALESCAPES def"
  1056. echo "/charset ["
  1057. # Get <>_ and | from S. Use accents for ascii ^ and ~.
  1058. StandardCharset | awk '
  1059. $1 == "(<)" && $2 == "/less" {$1 = "(---)"}
  1060. $1 == "(>)" && $2 == "/greater" {$1 = "(---)"}
  1061. $1 == "(_)" && $2 == "/underscore" {$1 = "(---)"}
  1062. $1 == "(|)" && $2 == "/bar" {$1 = "(---)"}
  1063. $1 == "(^)" && $2 == "/asciicircum" {
  1064. printf "(^)\t/circumflex\n"
  1065. $1 = "(---)"
  1066. }
  1067. $1 == "(~)" && $2 == "/asciitilde" {
  1068. printf "(~)\t/tilde\n"
  1069. $1 = "(---)"
  1070. }
  1071. {printf "%s\t%s\n", $1, $2}
  1072. '
  1073. echo "] def"
  1074. Latin1 $2
  1075. echo "/$2 SelectFont"
  1076. echo "(opO) SetAscender"
  1077. echo "(name $1\\\\n) Print"
  1078. echo "(fontname $2\\\\n) Print"
  1079. echo "/$1 NamedInPrologue"
  1080. echo "(spacewidth ) Print 32 GetWidth Print (\n) Print"
  1081. echo "(charset\\\\n) Print"
  1082. echo "BuildFontCharset"
  1083. }
  1084. FixedWidth() {
  1085. echo "/unitwidth $UNITWIDTH def"
  1086. echo "/resolution $RESOLUTION def"
  1087. echo "/octalescapes $OCTALESCAPES def"
  1088. echo "/charset ["
  1089. StandardCharset
  1090. echo "] def"
  1091. Latin1 $2
  1092. echo "/$2 SelectFont"
  1093. echo "(opO) SetAscender"
  1094. echo "(name $1\\\\n) Print"
  1095. echo "(fontname $2\\\\n) Print"
  1096. echo "/$1 NamedInPrologue"
  1097. echo "(spacewidth ) Print 32 GetWidth Print (\n) Print"
  1098. echo "(charset\\\\n) Print"
  1099. echo "BuildFontCharset"
  1100. }
  1101. Dingbats() {
  1102. echo "/unitwidth $UNITWIDTH def"
  1103. echo "/resolution $RESOLUTION def"
  1104. echo "/octalescapes $OCTALESCAPES def"
  1105. echo "/charset ["
  1106. DingbatsCharset | awk '$1 != "(---)" && $2 ~ /^\/[a-zA-Z]/ {
  1107. printf "%s\tISOLatin1Encoding %s GetCode\n", $1, $2
  1108. }'
  1109. echo "] def"
  1110. echo "/$2 SelectFont"
  1111. echo "( ) SetAscender"
  1112. echo "(name $1\\\\n) Print"
  1113. echo "(fontname $2\\\\n) Print"
  1114. echo "/$1 NamedInPrologue"
  1115. echo "(charset\\\\n) Print"
  1116. echo "BuildFontCharset"
  1117. }
  1118. Greek() {
  1119. echo "/unitwidth $UNITWIDTH def"
  1120. echo "/resolution $RESOLUTION def"
  1121. echo "/charset ["
  1122. SymbolCharset | awk '
  1123. BEGIN {hit = -1}
  1124. $1 ~ /\(\*[a-zA-Z]\)/ {print; hit = NR}
  1125. $2 == "(\")" && hit == NR-1 {print; hit = NR}
  1126. '
  1127. echo "] def"
  1128. echo "/$2 SelectFont"
  1129. echo "(orO) SetAscender"
  1130. echo "(name $1\\\\n) Print"
  1131. echo "(fontname $2\\\\n) Print"
  1132. echo "/$1 NamedInPrologue"
  1133. echo "(spacewidth ) Print 32 GetWidth Print (\n) Print"
  1134. echo "(charset\\\\n) Print"
  1135. echo "BuildFontCharset"
  1136. }
  1137. Symbol() {
  1138. echo "/unitwidth $UNITWIDTH def"
  1139. echo "/resolution $RESOLUTION def"
  1140. echo "/charset ["
  1141. SymbolCharset
  1142. echo "] def"
  1143. echo "ChangeMetrics"
  1144. echo "/S SelectFont"
  1145. echo "(orO) SetAscender"
  1146. echo "(name $1\\\\n) Print"
  1147. echo "(fontname $2\\\\n) Print"
  1148. echo "/$1 NamedInPrologue"
  1149. echo "(special\\\\n) Print"
  1150. echo "(charset\\\\n) Print"
  1151. echo "BuildFontCharset"
  1152. }
  1153. Special() {
  1154. echo "/unitwidth $UNITWIDTH def"
  1155. echo "/resolution $RESOLUTION def"
  1156. echo "/charset ["
  1157. SpecialCharset
  1158. echo "] def"
  1159. echo "ChangeMetrics"
  1160. echo "/S1 SelectFont"
  1161. echo "(# Times-Roman special font\\\\n) Print"
  1162. echo "(name $1\\\\n) Print"
  1163. echo "(fontname $2\\\\n) Print"
  1164. echo "/$1 NamedInPrologue"
  1165. echo "(special\\\\n) Print"
  1166. echo "(charset\\\\n) Print"
  1167. echo "BuildFontCharset"
  1168. }
  1169. #
  1170. # The DESC file doesn't have to be built on a printer. It's only here for
  1171. # consistency.
  1172. #
  1173. Description() {
  1174. echo "/charset [" # awk - so the stack doesn't overflow
  1175. StandardCharset | awk '$1 !~ /\(\\[0-9]/ {print $1}'
  1176. SymbolCharset | awk '$1 !~ /\(\\[0-9]/ {print $1}'
  1177. SpecialCharset | awk '$1 !~ /\(\\[0-9]/ {print $1}'
  1178. echo "] def"
  1179. cat <<-//DESC
  1180. (#Device Description - utf character set
  1181. PDL PostScript
  1182. Encoding Latin1
  1183. fonts 10 R I B BI CW H HI HB S1 S
  1184. sizes 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
  1185. 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 40 42 44 46
  1186. 48 50 52 54 56 58 60 64 68 72 78 84 90 96 100 105 110 115
  1187. 120 125 130 135 140 145 150 155 160 0
  1188. res $RESOLUTION
  1189. hor 1
  1190. vert 1
  1191. unitwidth $UNITWIDTH
  1192. ) Print
  1193. //DESC
  1194. echo "(charset\\\\n) Print"
  1195. echo "BuildDescCharset"
  1196. echo "(\\\\n) Print"
  1197. }