Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PostScriptでプログラミングをしよう

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

 PostScriptでプログラミングをしよう

Avatar for 綿糸てせ

綿糸てせ

June 20, 2026

More Decks by 綿糸てせ

Other Decks in Programming

Transcript

  1. 0. ⾃⼰紹介 ‧UEC25 てせ / ctes091x ‧所属: MMA‧⼯研‧VLL ‧Arch Linuxはいいぞ

    ‧中古ノートPCにProxmoxを⼊れて⾃宅に置いています ‧AtCoder茶 ‧SF研究会創設‧代表
  2. 3. PostScriptの構⽂ 値をスタックに積む 命令が来たら処理をする %!PS-Adobe-2.0 %%BoundingBox: 0 0 400 300

    newpath 100 100 moveto 100 200 lineto 200 200 lineto 200 100 lineto 100 100 lineto closepath fill showpage
  3. 3. PostScriptの構⽂ 「トークン」に値を割り当て 変数として使える %!PS-Adobe-2.0 %%BoundingBox: 0 0 400 300

    /x1 100 def /y1 100 def /y1 200 def /y2 200 def newpath x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto x1 x1 lineto closepath fill showpage
  4. 処理もスタックに積める 制御構⽂に渡される 単純な回数指定ループの例→ %!PS-Adobe-2.0 %%BoundingBox: 0 0 400 300 3

    { newpath 100 100 moveto 100 200 lineto 200 200 lineto 200 100 lineto 100 100 lineto 30 -15 translate closepath fill } repeat showpage 3. PostScriptの構⽂
  5. サブルーチンも定義できる %!PS-Adobe-2.0 %%BoundingBox: 0 0 400 300 /fillrect { /y2

    exch def /x2 exch def /y1 exch def /x1 exch def newpath x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto x1 x1 lineto closepath fill } def 100 100 200 200 fillrect showpage 3. PostScriptの構⽂