blockdiag is a programmatic tool for generating block diagrams. You can easily write something like a screen transition diagram with a program, and you can link with Spyinx. Block diagram generation tool blockdiag
OS:Mac OS X 10.9.5 Python:Ver.2.7.7
Create /usr/local/Library/Formula/freetype2.rb.
require 'formula'
class Freetype2 <Formula
url 'http://sourceforge.net/projects/freetype/files/freetype2/2.4.4/freetype-2.4.4.tar.gz/download'
homepage 'http://freetype.sourceforge.net/index2.html'
md5 '9273efacffb683483e58a9e113efae9f'
version '2.4.4'
# depends_on 'cmake'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
# system "cmake . #{std_cmake_parameters}"
system "make install"
end
end
Install freetype.
$ brew install freetype2
Install PIL.
$ sudo easy_install pil
If successful, the following words will be displayed.
・ ・ ・
Installed /Library/Python/2.7/site-packages/PIL-1.1.7-py2.7-macosx-10.9-intel.egg
Processing dependencies for pil
Finished processing dependencies for pil
Install blockdiag.
$ sudo easy_install blockdiag
Create text.diag.
blockdiag {
Screen 1->Screen 2->Screen 3;
Screen 2->Screen 4->Screen 1;
}
Build test.diag
$ blockdiag test.diag
test.png is created.
$ blockdiag -Tsvg test.diag
test.svg is output
$ blockdiag -Tpdf test.diag
If you get the following error when installing PIL.
・ ・ ・
_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Execute the following command to make a symbolic link.
$ sudo ln -s /usr/local/Cellar/freetype2/2.4.4/include/freetype2/freetype /usr/local/include/freetype
When "The _imagingft C module is not installed" is displayed by the blockdiag command
$ blockdiag test.diag
ERROR: The _imagingft C module is not installed
$ sudo easy_install -m PIL
$ sudo rm -rf /Library/Python/2.7/site-packages/PIL-1.1.7-py2.7-macosx-10.9-intel.egg
Reinstall PIL
$ sudo easy_install pil
$ pip freeze
・ ・ ・
Pillow==2.5.3
・ ・ ・
Uninstall Pillow
% sudo pip uninstall pillow
If you run blockdiag in this state, you will get angry if there is no Pillow
% blockdiag test.diag
Traceback (most recent call last):
File "/usr/local/bin/blockdiag", line 5, in <module>
from pkg_resources import load_entry_point
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 2867, in <module>
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 432, in _build_master
corresponding to the path entry, and they are added. `entry` is
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 728, in require
requirements specified when this environment was created, or False
File "build/bdist.macosx-10.9-intel/egg/pkg_resources.py", line 622, in resolve
shadow_set = self.__class__([])
pkg_resources.DistributionNotFound: Pillow
Install Pillow
% sudo easy_install Pillow
No more errors
$ blockdiag test.diag
$
Recommended Posts