マクロツイーター

はてダから移行した記事の表示が崩れてますが、そのうちに直せればいいのに(えっ)

TeX 以外(例えば Postscript)でナベアツする件について

munepi さんのブログの記事「\NabeAzz を作ってみた」より。

つぎは、Postscript で NabeAzz を(おぃ

ふむ。

%!PS-Adobe-3.0
/norm-font /Palatino-Roman findfont 10 scalefont def
/funny-font /ZapfChancery-MediumItalic findfont 20 scalefont def
/leading 18 def
/space-width 5 def
/line-item-count 10 def
/put-space {
  space-width 0 rmoveto
} def
/form-line {
  gsave exec grestore
  0 leading neg rmoveto
} def
/requires-funny {
  dup 3 mod 0 eq
  exch mark exch
  10 string cvs (3) search
  { cleartomark pop true } { cleartomark } ifelse
} def
/NabeAzz { 4 dict begin
  /limit exch def
  /c 0 def
  /line-count limit line-item-count div ceiling cvi def
  /one-line {
    {
      line-item-count {
        /c c 1 add def
        c requires-funny
        { funny-font } { norm-font } ifelse
        setfont
        c 10 string cvs show put-space
      } repeat
    } form-line
  } def
  gsave
  0 leading line-count 1 sub mul rmoveto
  line-count { one-line } repeat
  grestore
  end
} def
0 setgray 60 60 moveto
40 NabeAzz
showpage

(フォントは Base35 なものに置き換えました。)

よし。「私は Postscript ができる」ということに決定。

(Postscript のプログラムを全部自分で書いたのは初めてです…。)