Macでepsを見る手段がない。いろいろ調べたが、一番楽なのはX立ち上げてevinceで見ることか?
brew install evince
だめだ。Macのevinceはepsが表示できない。「ファイルタイプ text(text/*)はサポートしていません」になってしまう。
Inkscapeとかで見る方法も無いことはないが、多分Docker上のUbuntuでX飛ばしてevinceで見た方が楽だわ。もしくは研究室サーバでX飛ばすか。
事前にXQuartzの設定で「セキュリティ」の「接続を認証」及び「ネットワーク・クライアントからの接続を許可」しておく必要がある。
その上でX11の情報を共有してUbuntuを起動。
docker run -it -e DISPLAY=$(hostname):0 -v ~/.Xauthority:/root/.Xauthority ubuntu
その後Xをインストール。
apt-get update
apt-get -y install xserver-xorg x11-apps
xeyes
起動できた。
apt-get -y install evince poppler-data
なんかepsを作ってみるか。
$ apt-get install -y gnuplot
$ gnuplot
gnuplot> set term eps
gnuplot> set out "test.eps"
gnuplot> p sin(x)
gnuplot> exit
$ evince test.eps
なんの問題もなく表示できる。これでローカルをディレクトリをマウントして表示するのが一番楽なんじゃ・・・。
ついでにghostscriptも動かしてみる。
$ apt-get install -y gv
$ ghostscript
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GS>0 0 moveto
GS>100 100 lineto
GS>stroke
GS>
問題なく表示できる。
いつか、Ghostscript上で「PostScriptを触ってみる」の記事を書きたい。もう失われた技術だから……
普通に間違えて2月の日記を1月に書いてた。まだ1月であって欲しいという願望の現れか。