Size: 4810
Comment: converted to 1.6 markup
|
← Revision 11 as of 2010-04-08 04:02:05 ⇥
Size: 4848
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
* 可恨不支持中文! * 支持中文的,不过要在dot文件中输入utf-8编码的汉字,生成图片时也要指定字体名称。比如: {{{ dot -Nfontname=simsun -Tpng sample.dot -o sample.png |
* 可恨不支持中文?! * ZoomQuiet: 支持中文的,不过要在dot文件中输入utf-8编码的汉字,生成图片时也要指定字体名称。比如:{{{ > dot -Nfontname=simsun -Tpng sample.dot -o sample.png |
Line 8: | Line 7: |
* win2003(win2k)下指定字体扩展名(当然也可以用别的字体): {{{ dot -Nfontname=simsun.ttc -Tpng sample.dot -o sample.png |
* win2003(win2k)下指定字体扩展名(当然也可以用别的字体):{{{ > dot -Nfontname=simsun.ttc -Tpng sample.dot -o sample.png |
Line 12: | Line 10: |
* 原来如比!!不过,只能在命令行处指定,在脚本中使用类似: {{{ |
* 原来如比!!不过,只能在命令行处指定,在脚本中使用类似:{{{ |
Line 15: | Line 12: |
}}}来限定时,不能!!!这样一来,不同部分使用不同字体就是问题了………… * 提供C的源代码,可是…………想起C就烦! |
}}} * --(来限定时,不能!!!这样一来,不同部分使用不同字体就是问题了…………)-- * --(提供C的源代码,可是…………想起C就烦!)-- |
Line 21: | Line 17: |
{{{/*sample.dot*/ | {{{ /*sample.dot*/ |
Line 34: | Line 31: |
Line 48: | Line 46: |
Line 75: | Line 74: |
比如说{{{# ln -s /home/zoomq/.fonts/simsun.ttf /usr/X11R6/lib/X11/fonts/TrueType/simsun.ttf | * 比如说{{{ # ln -s /home/zoomq/.fonts/simsun.ttf /usr/X11R6/lib/X11/fonts/TrueType/simsun.ttf |
Line 83: | Line 83: |
Line 126: | Line 127: |
'''[[http|//wiki.woodpecker.org.cn/moin/Otter%e6%a8%a1%e6%9d%bf%e6%b5%8b%e8%af%95%e8%ae%b0%e5%bd%95?highlight=%28otter%29#head-b184da7e45372e1ca064fbd6dfb82e49a5fd2929:模板关系图]]''' | '''[[http://wiki.woodpecker.org.cn/moin/Otter%e6%a8%a1%e6%9d%bf%e6%b5%8b%e8%af%95%e8%ae%b0%e5%bd%95?highlight=%28otter%29#head-b184da7e45372e1ca064fbd6dfb82e49a5fd2929|模板关系图]]''' |
中文输出
- 可恨不支持中文?!
ZoomQuiet: 支持中文的,不过要在dot文件中输入utf-8编码的汉字,生成图片时也要指定字体名称。比如:
> dot -Nfontname=simsun -Tpng sample.dot -o sample.png
win2003(win2k)下指定字体扩展名(当然也可以用别的字体):
> dot -Nfontname=simsun.ttc -Tpng sample.dot -o sample.png
原来如比!!不过,只能在命令行处指定,在脚本中使用类似:
node [fontsize=8, fontname=simhei,shape = plaintext]
来限定时,不能!!!这样一来,不同部分使用不同字体就是问题了…………
提供C的源代码,可是…………想起C就烦!
sample.dot
/*sample.dot*/ digraph G { PY->ZO->Zope2->CMF->Plone; ZO->Zope3; ZO->Zs; Zs[label="ZODB,ZPT(等)\n...."]; PY->XML; PY->"4Suite"->XML;PY->Elements->XML; PY[label="Python语言",shape=box]; ZO[label="Zope",shape=egg]; }
FreeBSD 中
不同与Linux中,中文支持只需字体!其它的 graphviz 自身安装好了!
# cd /usr/ports/ (FreeBSD6.0以后使用portsnap 快捷升级产品树) # portsnap update # cd /usr/ports/graphics/graphviz # make install clean (然后安装字体) # cd /usr/ports/chinese/fireflyttf # make install clean # cd /usr/ports/chinese/arphicttf # make install clean
即可输出中文在图片中! 注意先后安装顺序! TureType 字体的使用需要一些库的支持,graphviz有自动安装的
- 不过 windows 中死活不行!BS的都没力气了…………
自由字体不多:Debian组织的中文字体
其它TTF的D用
FreeBSD 中 dot 找不到字体的信息如下:
Error: Could not find/open font : simkai in /usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/ truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/True Type:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/T rueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/common/share/fonts/ttf
实际的目录内容是:
#ll /usr/X11R6/lib/X11/fonts/TrueType/ lrwxr-xr-x 1 root wheel 44 Feb 13 18:48 bkai00mp.ttf@ -> /usr/local/share/fonts/TrueType/bkai00mp.ttf lrwxr-xr-x 1 root wheel 44 Feb 13 18:48 bsmi00lp.ttf@ -> /usr/local/share/fonts/TrueType/bsmi00lp.ttf lrwxr-xr-x 1 root wheel 47 Feb 13 18:17 fireflysung.ttf@ -> /usr/local/share/fonts/TrueType/fireflysung.ttf -rw-r--r-- 1 root wheel 789508 Feb 13 18:48 fonts.alias -rw-r--r-- 1 root wheel 21858 Feb 13 18:48 fonts.cache-1 -rw-r--r-- 1 root wheel 467 Feb 13 18:48 fonts.dir -rw-r--r-- 1 root wheel 467 Feb 13 18:48 fonts.scale lrwxr-xr-x 1 root wheel 44 Feb 13 18:48 gbsn00lp.ttf@ -> /usr/local/share/fonts/TrueType/gbsn00lp.ttf lrwxr-xr-x 1 root wheel 44 Feb 13 18:48 gkai00mp.ttf@ -> /usr/local/share/fonts/TrueType/gkai00mp.ttf
所以,可以直接链接M$ 中的字体到系统目录中:
比如说
# ln -s /home/zoomq/.fonts/simsun.ttf /usr/X11R6/lib/X11/fonts/TrueType/simsun.ttf
就可以使用 simsun 来输出了!
当然的,不提倡!
M$中的另种解决
digraph G { graph [ ratio="auto" label="hello ,我的测试" labelloc=t fontname="simyou.ttf" ]; node [ shape="box", style="dotted", fontname="simyou.ttf", fontsize="10" ]; edge [ fontname="simyou.ttf"]; "张三" [ peripheries=2, style=filled, label="市民张三" color="#eecc80" ]; "李四"[ style=filled, label="农民李四" color="#eecc80" ]; "王五"[ style=filled, label="农民王五" color="#eecc80" ]; "张三"->"李四"[label="亲戚"]; "张三"->"王五"[label="朋友"]; "李四"->"王五"[label="不认识"]; }