File: mkbijfm.scm

package info (click to toggle)
vflib3 3.6.14.dfsg-3+nmu3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 11,536 kB
  • ctags: 3,710
  • sloc: ansic: 35,811; sh: 10,357; asm: 3,290; makefile: 962; lisp: 123; perl: 109; awk: 43
file content (42 lines) | stat: -rwxr-xr-x 1,171 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/local/bin/scm 

(require 'format)

(define (mk-builtin-jfm ifile ofile)
  (with-output-to-file  ofile
    (lambda () (with-input-from-file ifile mk-builtin-jfm-2))))

(define (mk-builtin-jfm-2)
  (let ((s (read)))
    (if (not (eof-object? s))
	(begin
	  (if (eq? (car s) 'charsintype)
	      (let ((base (cadr s))
		    (ct (if (>= (caddr s) 10)
			    (- (caddr s) 2) 
			    (caddr s)))
		    (chars (cdddr s)))
		(for-each (lambda (ch) 
			    (display (format "  {0x~X, ~2D},\n"
					     (symbol->integer ch) ct)))
			  chars)))
	  (mk-builtin-jfm-2)))))
(define (symbol->integer sym)
  (+ (* 256 (- (char->integer
		(string-ref (symbol->string sym) 0)) 128))
     (- (char->integer (string-ref (symbol->string sym) 1)) 128)))

(if #f
    (begin
      (system "tftopl-j `kpsewhich min10.tfm` foo.pl 2>&1 >/dev/null" )
      (mk-builtin-jfm "foo.pl" "__chartypes")
      (system "sort __chartypes")
      (system "rm -f foo.pl __chartypes"))
    (begin
      (system "tftopl-j `kpsewhich tmin10.tfm` foo.pl 2>&1 >/dev/null" )
      (mk-builtin-jfm "foo.pl" "__chartypes")
      (system "sort __chartypes")
      (system "rm -f foo.pl __chartypes")))


(quit)