UKTeX V90 #12 Friday 20 April 1990 Re: Feynman diagrams query on previewers colour printing in SLiTeX New E-cm virtual fonts for TeX 3.0 Missing PostScript ligatures / PSPRINT DOSTEX web2c-5_0a - problems TEX Laser printer driver for an Atari MSDOS dvi to PostScript, with virtual fonts Producing Latin-1 Extended Computer Modern VPL files Editor Peter Abbott Latest TeXhax in the Archive is #39 Latest TeXmag in the Archive is V3N4 (in 2 parts) ------------------------- Via: UK.AC.ASTON.VAXA; Fri, 6 Apr 90 17:33 BST Date: Fri, 6 APR 90 17:33:45 BST Subject: Re: Feynman diagrams Originally-sent:Fri, 6 APR 90 17:27:24 GMT Originally-To: INFOTEX@UK.AC.ASTON Original-Ident: <204002E7_0016D788.00934CEB9E5A25C0$62_1@UK.AC.RHBNC.VAX> Originally-from:Philip Taylor (RHBNC) >>> I am interested in producing Feynman diagrams in TeX or LaTeX documents. >>> I really need one of the following, therefore: >>> 1. some METAFONT definitions together with, perhaps, some macros >>> to allow them to be used reasonably easily; >>> 2. some kind of a Feynman diagram compiler which takes a specification >>> of some sort and produces Postscript as its output; >>> 3. failing either of these, some raw Postscript procedures which >>> draw useful things. >>> If anyone has anything along these lines that they'd be willing >>> to share, I'd be most grateful as I don't have time to write >>> any of these at the moment. Nick --- See A. G. W. Cameron's article ``Wiggly lines'' in TUGboat, Volume~6 (1985), No.~3, p.~155. Philip Taylor Royal Holloway and Bedford New College. ------------------------ Via: UK.AC.ASTON.VAXA; Sat, 7 Apr 90 13:08 BST Date: Sat, 7 APR 90 13:08:58 BST Subject: query on previewers Originally-sent:Sat, 7 Apr 90 13:02:43 gmt Originally-To: QS101@uk.ac.cam.phx Original-Ident: <2490.9004071302@manutius.ecs.soton.ac.uk> Originally-from:Sebastian Rahtz > Could you guide me towards DOS dvi previewers & DVI to PostScript > converters? I'm sorry to bother you, but our ftp system is > decidedly slow & unfriendly, and browsing is not at all easy! you should acquire dvitops for your printer, and dvivga for your previewer; the latter is not ideal, but the former should satisfy all you desires and more. You will need a C compiler, or use the executable at Aston which is in .boo format. [tex-archive.drivers.dvi2ps.dvitops] [tex-archive.drivers.dvivga] Sebastian Rahtz ------------------------ Via: UK.AC.ASTON.VAXA; Sat, 7 Apr 90 13:17 BST Date: Sat, 7 APR 90 13:18:01 BST Subject: colour printing in SLiTeX Originally-sent:Sat, 7 Apr 90 13:10:57 gmt Originally-To: ARCHIVEGROUP@uk.ac.aston.kirk Original-Ident: <2496.9004071310@manutius.ecs.soton.ac.uk> Originally-from:Sebastian Rahtz > I'm contacting you. Have you a colour previewer, so you can make > videos or photos off the screen? That'd be real luxury. hahahhahahhaha. nice idea. wish I did. got access to a colour inkjet, tho. try \begin{colour}{0 1 0} xxxx \end{colour} still working on this directly in Slitex. dvitops is a problem in its idea of `regions' 0 1 0 means: 0 red, 1 green, 0 blue; values can be anything between 0 and 1. - ---- \newsavebox{\prettybox} \newcounter{colored} \setcounter{colored}{1} \newenvironment{rgbcolour}[1]{\def\colourvalue{#1}% \savebox{\prettybox}\bgroup}{\egroup% \special{dvitops: begin colour\the\value{colored}}% \special{dvitops: origin colour\the\value{colored}}% \usebox{\prettybox}\special{dvitops: end}% \special{dvitops: rgbcolor colour\the\value{colored} \colourvalue} \addtocounter{colored}{1}} \newenvironment{hsbcolour}[1]{\def\colourvalue{#1}% \savebox{\prettybox}\bgroup}{\egroup% \special{dvitops: begin colour\the\value{colored}}% \special{dvitops: origin colour\the\value{colored}}% \usebox{\prettybox}\special{dvitops: end}% \special{dvitops: rgbcolor colour\the\value{colored} \colourvalue} \addtocounter{colored}{1}} \newenvironment{colour}[1]{\begin{rgbcolour}{#1}}{\end{rgbcolour}} ------------------------ Via: UK.AC.ASTON.MAIL; Tue, 10 Apr 90 6:27 BST Via: UK.AC.NSFNET-RELAY; Tue, 10 Apr 90 6:21 BST Received: from vax.nsfnet-relay.ac.uk by sun.NSFnet-Relay.AC.UK Via Ethernet with SMTP id aa00221; 10 Apr 90 5:48 GMT Received: from math.ams.com by vax.NSFnet-Relay.AC.UK via NSFnet with SMTP id aa08848; 10 Apr 90 6:16 BST Received: from CUNYVM.CUNY.EDU by MATH.AMS.COM via SMTP with TCP; Tue, 10 Apr 90 01:19:58-EDT Received: from IRLEARN.UCD.IE by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 6794; Tue, 10 Apr 90 01:16:23 EDT Received: by IRLEARN (Mailer R2.03B) id 7519; Mon, 09 Apr 90 17:25:51 GMT Date: Mon, 09 Apr 90 17:21:59 GMT From: "Wayne G. Sullivan" Subject: New E-cm virtual fonts for TeX 3.0 Sender: WSULIVAN%bitnet.irlearn%edu.cuny.cunyvm@com.ams.math Though many people now have TeX 3.0, its new capabilities are practiaclly useless for languages with accented characters until new fonts are to hand. This note is about making such fonts available in the very near future by means of virtual fonts. IN SEARCH OF VIRTUAL E-CM FONTS AND HOW TO PRINT THEM For correct hyphenation in TeX 3.0 one needs fonts which include accented characters as individual font characters, rather than cm based composites previously used with TeX 2+ for European languages. In time new fonts will be created, but in the interim virtual fonts based on the cm fonts can fill the vacancy. To use virtual fonts for this purpose they must first be created, then new software is necessary so that output using virtual fonts may be viewed and printed. A difficult problem is character assignment to the positions 128-255. Having overcome that problem, the creation of E-cm fonts should be straightforward. TeX will tell you exactly how to make the virtual character corresponding to an accented character. See VFtoVP.WEB and VPtoVF.WEB for details on the nature of virtual fonts: basically one just uses strings of dvi commands to create the composite character. To get a VF description of \'h in the cmwhat10 font one can run the file \font\what=cmwhat10 \def\vr{\vrule width 10pt height10 pt\relax} \what \setbox0=\hbox{h\vr\'h\vr} \shipout\box0 \end through TeX with "what" replaced by the desired font. Then one can grab the DVI bytes between the two rules for the corresponding value of the virtual character. Instead, one can use DVITYPE on the output to give a plain description of what is needed. DVIvfDVI TRANSLATOR Once such fonts are created there still remains the problem of how to view and print them. Eventually DVI drivers will include this facility but for the moment there is a shortcut. If one had a DVIvfDVI program which would take a DVI file including references to virtual fonts and replace them with references to real fonts, then current DVI drivers could be used. Indeed, it seems that such a DVIvfDVI program should be a standard WEBware program. A quick glance through VFtoVP.WEB and VPtoVF.WEB may make it seem as though it would be trivial to write such a program, since the virtual characters are made from DVI commands. However, there are some aspects of virtual fonts as specified in the above named WEB files which cause unnecessary problems for DVIvfDVI. CRITIQUE OF THE VF WEB FILES Though I have not done a detailed study of the web files there are several points which make a DVIvfDVI more complicated than need be. 1. Inconsistent font specification. From VFtoVP.WEB: Each subroutine begins with :w=x=y=z=0:, and with current font~:f: the number of the first-defined in the preamble (undefined if there's no such font). From VPtoVF.WEB: (If no other font is selected, font number~0 is the default. If no \.{MAP} attribute is given, the default map is a character of the same number in the default font.) 2. Floating point arithmetic should be replaced with fixed point where possible (with the alternative floating equivalent given which may be used for DVI drivers, but should not be used for creating virtual fonts). The make-accent procedure of TeX also uses floating point, where fixed point could be used. Though the position differences in actual printout may be invisible, people using TeX and VPtoVF to create 'exactly' the same virtual font may get minor differences in positioning which will give different check sum values. I think that fixed point algorithms existing in other WEBware could remove this blemish. 3. The presumption that each virtual character is implicitly enclosed in a push-pop pair could possible save 512 bytes, but it makes a DVIvfDVI translator considerably more cumbersome. If the convention were that if the character did not start with a push, then the DVI code of the character (except for font fixups) would be embedded vervatim in the output dvi, this would simplify the DVIvfDVI translator and device drivers. It would be the virtual font's responsibility to ensure that spacing corresponds to what TeX expects. Most of the characters in the E-cm fonts would be simply their cm counterparts. Without such a convention the DVIvfDVI translator will have to check that the width of each character in the virtual font is the same as the width in the cm font each time it handles the character, or at least each time it loads the virtual font. There is also the problem about spacing after the virtual character. If one follows the presumed push-pop, then after setting the virtual character one must make a horizontal movement equal to the character width. This will come up against the spacing routines of DVI drivers, where rounding of pixels is included in "large" movements. A hack to fool the spacing routine in the DVI driver is for the DVIvfDVI program to set a rule of zero height and depth, rather than make a horizontal movement. The removal of the push-pop presumption would allow designers of virtual fonts a great deal more freedom. In any case one needs some clarification on what sort of movement is expected after setting the virtual character. If one is really worried about the 512 push-pop bytes, then one could include the convention that the final pop in a virtual character may be omitted, which will save half of the the additional bytes. Wayne Sullivan ------------------------ Via: UK.AC.ASTON.VAXA; Wed, 11 Apr 90 17:19 BST Date: Wed, 11 APR 90 17:25:42 BST Subject: Missing PostScript ligatures / PSPRINT Reply-To: Stephen Miller , Aston TeX Archivists Originally-sent:Wed, 11 Apr 90 17:21 GMT Originally-To: ARCHIVEGROUP@UK.AC.ASTON.VAX.KIRK Originally-from:Stephen Miller Here at Oxford we're having problems with using PostScript fonts with LaTeX/TeX -- we cannot obtain the fi and fl ligatures. (Also, the open and closing angle brackets are present in Helvetica but not in Courier: I have to admit I haven't done full font proofs to see if anything else is missing or not quite there.) We're using PSPRINT and the LPS40 laser- printer. Is anyone able to tell what is the problem and how we can solve it? Thanks Stephen Miller Oxford University Computing Service ------------------------ Via: UK.AC.ASTON.MAIL; Wed, 18 Apr 90 18:24 BST Via: [00007239000701.FTP.MAIL]; Wed, 18 Apr 90 18:24 BST Date: Wed, 18 Apr 90 18:27:13 BST From: C.CHOW@UK.AC.ABERDEEN Reply-To: 'C.CHOW'@UK.AC.ABERDEEN Acknowledge-To: 'C.CHOW'@UK.AC.ABERDEEN Subject: DOSTEX Message-ID: <900418.18281965.037273@ABERDEEN.CP6> I have encounted some problem with the "DOSTEX" package dwon loaded from the Aston archive. I am not sure what I have done wrong. If you have any suggestions, please contact me. (1) I have a small test program consisting of the following \font\twelveex=cmex10 scaled 1200 \textfont3=\twelveex \nopagenumbers $\sum $ \bye However, it does not work for the Hercules previewer, but \font\twelveex=cmex10 scaled 1200 \textfont3=\twelveex \nopagenumbers $$\sum $$ \bye does. Nevertheless both of the programs work for DVIEPS. $$\sun $$, and $\sun $, use the CMEX10.288 PK font. Both failed to work for Hercules previewer if scaled 1200 is removed. All CMEX10 pk fonts cannot be remade on the PC using the MF84. It always fails when processing "BIGOP.MF". Shipping it in from ASTON ARCHIVE or reporducing it on SUN work station and then shipping it across to the PC makes no difference. (2) I tried to use the screen resolution option of the Hercules previewer (i.e. to produce CMEX10.120 pk). The above test program works but I fail to generate all the tfm and pk files that I required, not even all required CMRs. Most case failed with message "Strange path (turning number is zero)". I uses "pixels_per_inch:=120, o_correction:=.2 and aspect_ratio:=9/14" for my local mode_def. (3) Any body knows any other Hercules previewer which I can try. Ching Chow ------------------------ Via: UK.AC.ASTON.VAXA; Thu, 19 Apr 90 10:49 BST Date: Thu, 19 APR 90 10:56:08 BST From: ARCHIVEGROUP@UK.AC.ASTON.VAXA Subject: web2c-5_0a - problems Reply-To: CS1CWM @ UK.AC.SHEFFIELD.PRIMEA, Aston TeX Archivists Originally-sent:Thu, 19 Apr 90 10:49:37 Originally-To: infotex @ UK.AC.ASTON Originally-from:CS1CWM @ UK.AC.SHEFFIELD.PRIMEA Peter: Seeing Sebastian's note, I downloaded web-5_0a and web2c-5_0a to our Sun 3/60. I have had some problems getting it going and it has just given up while trying to compile Metafont (INIMF). The problems are these: 1) tangle: there doesn't appear to be a tangle.h in the distribution, I eventually downloaded one from the old distribution (??) 2) TeX: in compiling itex.c it gave the warning "statement not reached" for lines 705 733 2102 and 2805. In compiling tex0.c it gave the same warning at line 653. 3) Metafont: in compiling imf.c it gave the error "syntax error at or near symbol ;" at line 273 and the "statement not reached" warning at line 420. The code it complains of is dumpint ( strstart [ k ] ) ; while ( k++ < for_end) ; } (this is hand-transcribed and may not be absolutely accurate). The alterations to the top-level makefile are CC=cc and choosing sunlib instead of X11 I know a little about C and it looks as though the syntax error is spurious. Chris Martin Via: UK.AC.ASTON.VAXA; Thu, 19 Apr 90 12:39 BST Date: Thu, 19 APR 90 12:45:36 BST From: ARCHIVEGROUP@UK.AC.ASTON.VAXA Originally-sent:Thu, 19 Apr 90 12:34:26 BST Originally-To: CS1CWM@uk.ac.sheffield.primea, Original-Ident: <15859.640524866@clan> Originally-from:d.osborne@uk.ac.nott.clan Chris, in your message of Thu, 19 Apr 90 10:54:31 -0000, you said: > The problems are these: > > 1) tangle: there doesn't appear to be a tangle.h in the distribution, I > eventually downloaded one from the old distribution (??) I agree; I had a tangle.h from an earlier web2c release, which I used. > 2) TeX: in compiling itex.c it gave the warning "statement not reached" for > lines 705 733 2102 and 2805. In compiling tex0.c it gave the same warni > ng > at line 653. This is machine-generated C, remember. A couple of these lines are preceded by #ifdef'd sections which end in a goto and a return, so the warnings will only show up if the #ifdef'd code is included. I must admit I don't see why you get warnings for the end of a while loop preceding a return, which is what the other line numbers are. The most important thing is that it passes the trip test when you've built it. > 3) Metafont: in compiling imf.c it gave the error "syntax error at or near > symbol ;" at line 273 and the "statement not reached" warning at line 420. [...] > I know a little about C and it looks as though the syntax error is spurious. I think so. I have had no problems on a Mips M/2000 and RC2030 under RISC/os and an Acorn R140 under RISCix. Try using the GNU C compiler if you have it. Watch out for hyphenation problems in the LaTeX format. since the sources don't (yet) support the new hyphenation. Using \lefthyphenmin=2 \righthyphenmin=3 \input lplain should fix it. dave ------------------------ Via: UK.AC.ASTON.MAIL; Thu, 19 Apr 90 15:27 BST Via: UK.AC.EARN-RELAY; Thu, 19 Apr 90 15:26 BST Date: Thu, 19 Apr 90 15:26:34 BST From: Douglas Ross Subject: TEX Laser printer driver for an Atari I have a version of TEX for my Atari 1040ST and I am trying to find a driver for a laser-jet printer. I notice that in the archived directory there is a file called LASERJET.DIR. I am a bit confused. Are these programs written in a transportable language so that they can be compiled and run on any machine ordo I need a version especially for the Atari. Also if I manage to get hold of a Laser printer driver could you tell me what the command line would be. For my Epson driver it is -epath for FONTS -z dvi filename Would this be the same for a laser printer driver. I would be grateful if you could advise me. Thanking you in advance. Yours sincerely Douglas ross (physics Department - Southampton University) ------------------------ Via: UK.AC.ASTON.MAIL; Fri, 20 Apr 90 10:51 BST Via: UK.AC.SOUTHAMPTON.MATHEMATICS; Fri, 20 Apr 90 10:50 BST Received: from manutius.ecs.soton.ac.uk by hilliard.ecs.soton.ac.uk; Fri, 20 Apr 90 10:57:05 BST From: Sebastian Rahtz Date: Fri, 20 Apr 90 10:55:14 gmt Message-Id: <13570.9004201055@manutius.ecs.soton.ac.uk> Subject: MSDOS dvi to PostScript, with virtual fonts When Knuth revamped TeX late last year, he `canonized' an idea that had been floating around in some TeX implementations, that of virtual fonts. This is of long-term interest to those using non-English alphabets, of course, but in the short-term it is very useful for remapping PostScript fonts so that they look like TeX ones. Indeed, Knuth contributed changes to Rokicki's afm to tfm program to generate fonts automatically, and to his dvips to make it understand virtual fonts; the sources for all this are available for Unix people. For the benefit of those without the law, who must use PCs, and don't want to compile things, I have recently ported the relevant programs to MSDOS, and put them in the Aston TeX archive FOR THE EXPERIMENTALLY MINDED. THIS IS NOT A POLISHED DISTRIBUTION!! In [tex-archive.drivers.dvi2ps.dvips502.msdos] I have put four .boo files; each of these, after `deboo'ing, is a ZIP archive, whose contents are explained below: dvips.zip: Tom Rokicki's dvips program, a good, fast and feature-laden dvi to PostScript driver. This archive comprises the sources altered to compile with Microsoft C, and executables dvips.exe and afm2tfm.exe. See dvips.1 for documentation, unfortunately currently only in Unix `man' format! The copies of Knuth's vftovp and vptovf programs are automatic C versions WHICH DONT WORK. DO NOT USE THEM YET. afm.zip A set of Adobe .afm files for common PostScript fonts, and a `makefile' to create the relevant tfm and virtual fonts. Please don't use this unless you understand what you are doing. pstfms.zip A set of tfm files for PostScript fonts and the virtual fonts vf.zip A set of virtual fonts for PostScript fonts Procedure: Unpack dvips.zip and install dvips.exe wherever you put such things; unpack pstfms.zip and put the files in your TFM directory; unpack vf.zip and make a new directory for them (mine is d:\tex\vf - see below). Make a new directory for dvips configuration files (mine is d:\tex\psery - see below) and copy psfonts.map, config.ps and *.pro into it from the dvips source directory. Write a .tex file contained references to fonts **by the names given in the VF directory**, eg p-rom for Palatino-Roman. When you process the .dvi file with dvips, dvips will sort out all the relationships and mappings, and generate you PostScript output with the characters in the right place. Hopefully! HEALTH WARNING: THIS SETUP ASSUMES THE FOLLOWING PATHS FOR FILES TFM: d:\tex\fonttfms VF: d:\tex\vf INPUTS d:\tex\inputs Configuration: d:\tex\psery PK files d:\tex\pk300 THIS IS A DEMONSTRATION SETUP. To really make this work for you, look at config.h in the sources and recompile the program. I realize that the above explanation begs many questions, and is probably very obscure to those who have never changed their PC TeX setup before. So I will happily answer questions on the process. Please remember that the UK TeX User's Group will very happily organize meetings or publications about troublesome TeX matters. A meeting is planned to expound TeX version 3 and virtual fonts, and suggestions for the context are welcomed. Sebastian Rahtz ------------------------ Via: UK.AC.ASTON.MAIL; Fri, 20 Apr 90 12:55 BST Via: UK.AC.SOUTHAMPTON.MATHEMATICS; Fri, 20 Apr 90 12:54 BST Received: from manutius.ecs.soton.ac.uk by hilliard.ecs.soton.ac.uk; Fri, 20 Apr 90 13:00:54 BST From: Sebastian Rahtz Date: Fri, 20 Apr 90 12:59:03 gmt Message-Id: <13987.9004201259@manutius.ecs.soton.ac.uk> Subject: Producing Latin-1 Extended Computer Modern VPL files [ reposted from Usenet news, for the benefit of UK TeXers interested in virtual fonts sebastian rahtz ] From: tml@hemuli.tik.vtt.fi (Tor Lillqvist) With TeX 3.0 you have the possibility to use so called virtual fonts. I wrote this GNU Emacs Lisp code to automatically make VPL (Virtual font Property List) files with the ISO Latin-1 accented letters from Computer Modern PL files. Why GNU Emacs Lisp? Well, PL and VPL files look a bit like Lisp, so I thought that it would be easy to hack together the necessary code in Lisp. I considered doing it in Scheme at first, but ran into trouble because Scheme does case conversion. On the other hand, Elisp doesn't have floating-point numbers, so I had to represent them using (integer-part . fraction-part) Lisp dotted pairs. I don't have any other Lisps available. I hope this is useful to those wanting to try the new TeX 3.0 features. Is there any group working on a standard way to extend Computer Modern fonts? ISO Latin-1 covers only a part of the necessary letters. (See the article by Yannis Haralambous in TUGboat 10:3, pp 342--344.) Has anybody written MF code for the Icelandic thorn and eth letters? You typically would do something like: mkdir /tmp/latin1 cd /tmp/latin1 F=/usr/local/lib/tex/fonts for file in $F/cm*.tfm; do tftopl $file `basename $file'.pl done start Emacs, and do M-x extend-directory-of-cm-fonts /tmp/latin1 for file in *.vpl; do bn=`basename $file .vpl` vptovf $file $F/$bn.vf $F/$bn.tfm done Now if only more DVI drivers would support VF files... Thanks to Tom Rokicki and Don Knuth for virtual font support in dvips 5.01. Enough said, here is the code: Use as you please. If you do anything useful with it, or make enhancements, please tell me. ;; accentify.el -- extend a Computer Modern font with accented letters ;; Tor Lillqvist (defvar interesting-pl-properties '(CHARACTER CHECKSUM DESIGNSIZE FONTDIMEN KRN LABEL LIGTABLE SKIP)) (defvar accented-versions '((?A ?\300 ?\301 ?\302 ?\303 ?\304 ?\305) (?C ?\307) (?E ?\310 ?\311 ?\312 ?\313) (?I ?\314 ?\315 ?\316 ?\317) ;; (?D ?\320) (?N ?\321) (?O ?\322 ?\323 ?\324 ?\325 ?\326) (?U ?\331 ?\332 ?\333 ?\334) (?Y ?\335) (?a ?\340 ?\341 ?\342 ?\343 ?\344 ?\345) (?c ?\347) (?e ?\350 ?\351 ?\352 ?\353) (?i ?\354 ?\355 ?\356 ?\357) (?n ?\361) (?o ?\362 ?\363 ?\364 ?\365 ?\366) (?u ?\371 ?\372 ?\373 ?\374) (?y ?\375 ?\377)) "A list containing ASCII characters and the corresponding accented ISO Latin-1 characters' codes.") (defvar cm-text-fonts "^cm\\(r\\|bx\\|tt\\|sltt\\|vtt\\|tex\\|ss\\|ssi\\|ssdc\\|ssbx\\|ssqi\\|dunh\\|bxsl\\|b\\|ti\\|bxti\\|csc\\|tcsc\\)\\([0-9]+\\)\\(\\.pl\\)$") (defun extend-directory-of-cm-fonts (directory) "For all Computer Modern PL files in a direcory create the corresponding Extended Computer Modern VP file." (interactive "DExtend fonts in directory: ") (mapcar 'extend-pl-file (directory-files directory nil cm-text-fonts))) (defun extend-pl-file (filename) "Create a Extended Computer Modern VP (Virtual font Property list) file from the PL (font Property List) file FILENAME." (interactive) (set-buffer (get-buffer-create "*extend-pl-file-temp*")) (insert-file-contents filename t) (message "Working on %s" (file-name-nondirectory filename)) (set-buffer (extend-cm-font-in-buffer)) (write-file (buffer-file-name (current-buffer)))) (defun extend-cm-font-in-buffer () "Convert a Computer Modern PL file to the corresponding Latin-1 Extended Computer Modern VP file." (interactive) (let (font-name font-basename font-size tempbuffer vp-file) (setq font-name (file-name-nondirectory (buffer-file-name (current-buffer)))) (if (not (string-match cm-text-fonts font-name)) (error "Cannot handle this font.") (setq font-name (substring font-name 0 (match-beginning 3))) (setq font-basename (substring font-name 0 (match-beginning 2))) (setq font-size (substring font-name (match-beginning 2) (match-beginning 3)))) (setq tempbuffer (get-buffer-create "*temp*")) (copy-to-buffer tempbuffer (point-min) (point-max)) (set-buffer tempbuffer) (goto-char (point-min)) ;; First convert C values to decimal (clean-char-values) (goto-char (point-min)) ;; Convert R values to dotted pairs (dotted-floatify-buffer) (goto-char (point-min)) ;; (read) will read from the temp buffer (setq standard-input (current-buffer)) ;; We produce a VP file, with l1 prefixed to the original font name (set-buffer (get-buffer-create "*new-vp-file*")) (set-visited-file-name (concat "l1" font-name ".vpl")) (erase-buffer) (setq standard-output (current-buffer)) (setq char-metrics (make-vector 256 nil)) (princ (format "(MAPFONT D 0 (FONTNAME %s))\n" font-name)) ;; Parse the PL file, inserting ligtable labels and kerns ;; for the accented letters on the fly (condition-case nil (while t (convert-expr (read))) (end-of-file nil)) ;; Output the character descriptions for the accented characters (output-additions) ;; (kill-buffer temp-buffer) (current-buffer) )) (defun dotted-floatify-buffer () "Replaces floating-point values in the current buffer with lists of the form (!fix! integer-part fraction-part). The fraction part is multiplied by 1000000." (interactive) (while (re-search-forward "\\(-?\\)\\([0-9]+\\)\\.\\([0-9]+\\)" nil t) (replace-match (make-float-string (string-to-int (buffer-substring (match-beginning 2) (match-end 2))) (buffer-substring (match-beginning 3) (match-end 3)) (< (match-beginning 1) (match-end 1)))))) (defun clean-char-values () "Replace C (character) values of non-alphanumeric characters with the corresponding D (decimal) value." (while (re-search-forward " [Cc] \\([^A-Za-z]\\) " nil t) (replace-match (format " d %d " (aref (buffer-substring (match-beginning 1) (1+ (match-end 1))) 0))))) (defun myprint (e) (cond ((atom e) (prin1 e)) ((and (integerp (car e)) (integerp (cdr e))) (myprint-dottedfloat (car e) (cdr e))) ((eq (car e) 'COMMENT) nil) (t (terpri) (insert "(") (myprint (car e)) (myprint-rest (cdr e))))) (defun abs (e) (if (< e 0) (- 0 e) e)) (defun myprint-dottedfloat (int fract) (if (or (< int 0) (< fract 0)) (princ "-")) (prin1 (abs int)) (princ ".") (princ (format "%06d" (abs fract)))) (defun myprint-rest (e) (cond ((null e) (insert ")")) (t (insert " ") (myprint (car e)) (myprint-rest (cdr e))))) (defun depth (e) (cond ((atom e) 0) (t (max (1+ (depth (car e))) (depth (cdr e)))))) (defun convert-expr (e) (cond ((listp e) (let ((handler(get (car e) 'prop-handler))) (if handler (apply handler e nil) (myprint e)))) (t (error "Invalid property list")))) (defun put-handler (prop) (put prop 'prop-handler (intern (concat (downcase (symbol-name prop)) "-handler")))) (mapcar 'put-handler interesting-pl-properties) (defun comment-handler (prop) nil) (defun checksum-handler (prop) nil) (defun designsize-handler (prop) (setq designsize (car (cdr (cdr prop)))) (myprint prop)) (defun fontdimen-handler (prop) (myprint prop) (setq fontdimens (cdr prop)) (setq font-xheight (car (cdr (cdr (assq 'XHEIGHT fontdimens))))) (setq font-slant (car (cdr (cdr (assq 'SLANT fontdimens)))))) (defun ligtable-handler (prop) (princ "\n(LIGTABLE\n") (mapcar 'ligstep-handler (cdr prop)) (princ ")\n")) (defun ligstep-handler (step) (myprint step) (let ((handler (get (car step) 'prop-handler))) (if handler (apply handler step nil)))) (defun label-handler (step) (label-accented (assq (int-value (cdr step)) accented-versions))) (defun label-accented (list) (while (and list (setq list (cdr list))) (princ " ") (prin1 (list 'LABEL 'D (car list))))) (defun krn-handler (step) (krn-accented (car (cdr (cdr (cdr (cdr step))))) (assq (int-value (cdr step)) accented-versions))) (defun krn-accented (kern list) (while (and list (setq list (cdr list))) (princ " ") (princ "(KRN D ") (prin1 (car list)) (princ " R ") (myprint kern) (princ ")"))) (defun skip-handler (step) (error "Cannot handle SKIPs (yet).")) (defun character-handler (prop) (myprint prop) (aset char-metrics (int-value (cdr prop)) (cdr (cdr (cdr prop))))) (defun checksum-handler (prop) nil) ;; The combinations list contains for each accented letter a sublist ;; with its code, the code of the unaccented letter, and the ;; code of the accent (setq combinations '((?\300 ?A ?\022) ; Agrave (?\301 ?A ?\023) ; Aacute (?\302 ?A ?\136) ; Acircumflex (?\303 ?A ?\176) ; Atilde (?\304 ?A ?\177) ; Adiaeresis (?\305 ?A ?\027) ; Aring (?\307 ?C ?\030) ; Ccedilla (?\310 ?E ?\022) ; Egrave (?\311 ?E ?\023) ; Eacute (?\312 ?E ?\136) ; Ecircumflex (?\313 ?E ?\177) ; Ediaeresis (?\314 ?I ?\022) ; Igrave (?\315 ?I ?\023) ; Iacute (?\316 ?I ?\136) ; Icircumflex (?\317 ?I ?\177) ; Idiaeresis (?\321 ?N ?\176) ; Ntilde (?\322 ?O ?\022) ; Ograve (?\323 ?O ?\023) ; Oacute (?\324 ?O ?\136) ; Ocircumflex (?\325 ?O ?\176) ; Otilde (?\326 ?O ?\177) ; Odiaeresis (?\331 ?U ?\022) ; Ugrave (?\332 ?U ?\023) ; Uacute (?\333 ?U ?\136) ; Ucircumflex (?\334 ?U ?\177) ; Udiaeresis (?\335 ?Y ?\023) ; Yacute (?\340 ?a ?\022) ; agrave (?\341 ?a ?\023) ; aacute (?\342 ?a ?\136) ; acircumflex (?\343 ?a ?\176) ; atilde (?\344 ?a ?\177) ; adiaeresis (?\345 ?a ?\027) ; aring (?\347 ?c ?\030) ; ccedilla (?\350 ?e ?\022) ; egrave (?\351 ?e ?\023) ; eacute (?\352 ?e ?\136) ; ecircumflex (?\353 ?e ?\177) ; ediaeresis (?\354 ?\020 ?\022) ; igrave (?\355 ?\020 ?\023) ; iacute (?\356 ?\020 ?\136) ; icircumflex (?\357 ?\020 ?\177) ; idiaeresis (?\361 ?n ?\176) ; ntilde (?\362 ?o ?\022) ; ograve (?\363 ?o ?\023) ; oacute (?\364 ?o ?\136) ; ocircumflex (?\365 ?o ?\176) ; otilde (?\366 ?o ?\177) ; odiaeresis (?\371 ?u ?\022) ; ugrave (?\372 ?u ?\023) ; uacute (?\373 ?u ?\136) ; ucircumflex (?\374 ?u ?\177) ; udiaeresis (?\375 ?y ?\023) ; yacute (?\377 ?y ?\177) ; ydiaeresis )) (defun output-additions () (mapcar 'output-combination combinations)) (defun output-combination (recipe) (let* ((basechar (car (cdr recipe))) (accent (car (cdr (cdr recipe)))) (basechar-metrics (aref char-metrics basechar)) (accent-metrics (aref char-metrics accent)) (aw (car (cdr (cdr (assq 'CHARWD accent-metrics))))) (cw (car (cdr (cdr (assq 'CHARWD basechar-metrics))))) (ch (or (car (cdr (cdr (assq 'CHARHT basechar-metrics)))) '(0 . 0))) (ah (or (car (cdr (cdr (assq 'CHARHT accent-metrics)))) '(0 . 0))) (cd (or (car (cdr (cdr (assq 'CHARDP basechar-metrics)))) '(0 . 0))) (ad (or (car (cdr (cdr (assq 'CHARDP accent-metrics)))) '(0 . 0))) (ci (or (car (cdr (cdr (assq 'CHARIC basechar-metrics)))) '(0 . 0))) (downkern (float- font-xheight ch))) (myprint (append (list 'CHARACTER 'D (car recipe)) (list (list 'CHARWD 'R cw)) (list (list 'CHARHT 'R (floatmax (float- ah downkern) ch))) (if (not (equal (floatmax cd ad) '(0 . 0))) (list (list 'CHARDP 'R (floatmax cd ad)))) (if (not (equal ci '(0 . 0))) (list (list 'CHARIC 'R ci))) (list (append (list 'MAP '(PUSH)) (if (not (equal font-xheight ch)) (if (equal ah '(0 . 0)) ; Cedilla? nil (list (list 'MOVEDOWN 'R downkern)))) ;; Ignore slants for now (let ((rightkern (float/ (float- cw aw) 2))) (if (not (equal rightkern '(0 . 0))) (list (list 'MOVERIGHT 'R rightkern)))) (list (list 'SETCHAR 'D accent)) (list '(POP)) (list (list 'SETCHAR 'D basechar)))))) (terpri))) ;; Auxiliary functions (defun make-float-string (int fract neg) "Returns a string containing the special dotted-pair representation of a floating-point number. INT is the integer part (a number) and FRACT is the fractional part (as a string!)." (let ((x (make-float int fract (if neg -1 1)))) (format "(%d . %d)" (car x) (cdr x)))) (defun make-float (int fract neg) "Converts a floating point number to a dotted-pair fixed-point representation. INT is the integer part, FRACT is the fractional part as a string, and NEG is 1 or -1. The result is a dotted pair the car of which is the integer part and the cdr is the fractional part multiplied by 1000000." (interactive) (cons int (* neg (let ((l (length fract)) (f (string-to-int fract))) (cond ((= l 7) (/ (+ f 5) 10)) ((= l 6) f) ((= l 5) (* f 10)) ((= l 4) (* f 100)) ((= l 3) (* f 1000)) ((= l 2) (* f 10000)) ((= l 1) (* f 100000)) (t (error "Too long fractional part: %s" fract))))))) (defun float+ (a b) "Add two dottedfloats." (let (i f) (setq i (+ (car a) (car b))) (setq f (+ (cdr a) (cdr b))) (cond ((>= f 1000000) (setq i (1+ i)) (setq f (- f 1000000))) ((<= f -1000000) (setq i (1- i)) (setq f (+ f 1000000)))) (cond ((and (< i 0) (> f 0)) (setq i (1+ i)) (setq f (- f 1000000))) ((and (> i 0) (< f 0)) (setq i (1- i)) (setq f (+ 1000000 f)))) (cons i f))) (defun float- (a &rest b) "Negate a dottedfloat or subtract two dottedfloats." (if b (float+ a (float- (car b))) (cons (- (car a)) (- (cdr a))))) (defun float/ (a i) "Divide a dottedfloat by an integer." (cons (/ (car a) i) (/ (cdr a) i))) (defun floatmax (a b) (if (or (> (car a) (car b)) (and (= (car a) (car b)) (> (cdr a) (cdr b)))) a b)) (defun octal-to-int (value) (if (zerop value) 0 (+ (* 8 (octal-to-int (/ value 10))) (% value 10)))) (defun int-value (list) (let ((type (car list)) (value (car (cdr list)))) (cond ((eq type 'C) (cond ((symbolp value) (aref (symbol-name value) 0)) ((integerp value) (+ value ?0)) (t (error "Invalid C type value.")))) ((eq type 'D) value) ((eq type 'O) (octal-to-int value)) (t (error "Unknown value type."))))) ------------------------ !! !! Files of interest !! [tex-archive]000aston.readme [tex-archive]000directory.list !! [tex-archive]000directory_dates.list [tex-archive]000directory.size !! [tex-archive]000last30days.files !! !! Editor - I have a tape labelled TeX 2.99 LaTeX 2.09 Metafont 1.7 !! Unix 4.2/3BSD & System V. Tar 1600 bpi blocked 20 1 file dated !! 25 July 1989 (from washington.edu). !! !! FTP access site uk.ac.aston.tex !! username public !! password public !! !! I have the facility to copy this tape for anyone who sends the following !! 1 2400 tape with return labels AND RETURN postage. (2.50 pounds sterling !! for UK users, payable to `Aston University') Outside UK please ask me. !! UK users send 4.25 for two tapes or 6.60 for three tapes. !! Send to !! !! P Abbott !! Computing Service !! Aston University !! Aston Triangle !! Birmingham B4 7ET !! !! A VMS backup of the archive requires 2 (two ) 2400' tapes at 6250bpi. !! Remaining details as above. !! !! A VMS backup of TeX 2.991 plus PSprint is available one tape is needed. !! !! Exabyte tape drive with Video 8 cassettes. !! !! Same formats available as 1/2in tapes. We use the following tapes !! SONY Video 8 cassette P5 90MP, MAXCELL Video 8 cassette P5-90 !! TDK Video 8 cassette P5-90MPB !! Postage 35p UK (stamp please), 1 pound sterling Europe, other areas 2 pounds !! !! OzTeX - Send 10 UNFORMATTED (800k) disks with return postage. !! !! Replies/submissions to info-tex@uk.ac.aston please !! distribution changes to info-tex-request@uk.ac.aston please !! !! end of issue