tmac.bits 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .ds Bf b \" default format; use i for icons and faces
  2. .ds Bn /tmp/btroff\n($$ \" temporary file, reused on each macro call
  3. .ds Bp /usr/lib/btroff \" bitmap filter
  4. .de BM
  5. .if \\n(.$=1 .ds Bf \\$1
  6. .if \\n(.$=2 \{. \" copy request, perhaps diverted
  7. .ie '\\n(.z'' .Bm \\$1 \\$2
  8. .el \!.BM \\$1 \\$2\}
  9. .if \\n(.$=4 \{. \" size request, numerator only
  10. .nr Bz \\$2
  11. .sy \\*(Bp -s -\\*(Bf -d\\n(Bz \\$1 | awk '{\
  12. print ".nr \\$3 " $1; \
  13. print ".nr \\$4 " $2; \
  14. exit }' >\\*(Bn
  15. .so \\*(Bn
  16. .sy /bin/rm -f \\*(Bn \}
  17. .if \\n(.$=5 \{. \" size request, numerator and denominator
  18. .nr Bz \\$2
  19. .sy \\*(Bp -s -\\*(Bf -d\\n(Bz \\$1 | awk '{\
  20. print ".nr \\$4 " $1 "/\\$3"; \
  21. print ".nr \\$5 " $2 "/\\$3"; \
  22. exit }' >\\*(Bn
  23. .so \\*(Bn
  24. .sy /bin/rm -f \\*(Bn \}
  25. ..
  26. .de Bm \" copy request, for real
  27. .if \\n(.P>0 \{. \" maybe
  28. .fl
  29. .ie '\\$2'0' \{. \" ask driver to read the bits
  30. .br
  31. \\X'Bitmap \\$1'
  32. .sp -1 \}
  33. .el \{. \" use the Bitmap font
  34. .sy \\*(Bp -\\*(Bf -d\\$2 \\$1 >\\*(Bn
  35. .fp 9 BM Bitmap
  36. .ft 9
  37. .ps \\$2
  38. .cf \\*(Bn \" next line is for pm to consume
  39. \!n0 1
  40. .ft
  41. .ps
  42. .sy /bin/rm -f \\*(Bn \}
  43. .fl \}
  44. ..