2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS 7 で日本語対応の mscgen をビルドしてシーケンス図を書く

Posted at

Mscgen: A Message Sequence Chart Renderer

ダウンロードしてビルドしてインストール。

wget http://www.mcternan.me.uk/mscgen/software/mscgen-src-0.20.tar.gz
tar zxf mscgen-src-0.20.tar.gz
cd mscgen-0.20
./configure --prefix=$HOME --with-freetype
make
make install

日本語フォントを検索。

$ sudo yum search japanese font

(snip)

ipa-gothic-fonts.noarch : Japanese Gothic-typeface OpenType font by IPA
ipa-mincho-fonts.noarch : Japanese Mincho-typeface OpenType font by IPA
ipa-pgothic-fonts.noarch : Japanese Proportional Gothic-typeface OpenType font by IPA
ipa-pmincho-fonts.noarch : Japanese Proportional Mincho-typeface OpenType font by IPA
vlgothic-fonts.noarch : Japanese TrueType font
vlgothic-p-fonts.noarch : Proportional Japanese TrueType font

(snip)

日本語フォントをインストール。

$ sudo yum install vlgothic-fonts
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

(snip)

Installed:
  vlgothic-fonts.noarch 0:20130607-2.el7

Complete!

インストールされたフォントを確認。

$ fc-list vlgothic
/usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf: VL Gothic,VL ゴシック:style=regular

シーケンス図の dot を作成。

msc.txt

msc {
    arcgradient = 5, width = 500;

    ore [label="俺"],
    are [label="あれ"],
    sore [label="それ"];

    ore => are  [label="ほげ"];
    are => sore [label="ふが"];
    ore <= sore [label="はげ"];
    ore =x sore [label="なんだと"];
}

mscgen コマンドでシーケンス図を PNG で出力。

mscgen -F "VL Gothic" -T png -i msc.txt -o msc.png

作成された画像を開く。

open msc.png

msc.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?