首次发帖,用 graphviz-dot-mode 选了 svg 预览,但是中文全是问号。
或者有没有其他对中文 svg 显示友好的 mode 呢?(eaf-open也不能直接打开识别svg @王勇我的没有中文乱码的问题,按照 Ubuntu 14.04 64bit上玩转graphviz绘图工具 - 雪峰流云 - CSDN博客: Ubuntu 14.04 64bit上玩转graphviz绘图工具_雪峰流云的博客-CSDN博客_ubuntu绘图仪 第一次使用"graphviz":
1 个赞
默认是按 png 格式输出的确没问题,你改成svg格式的再试试看。
参照
里中文乱码的处理方式:
- 找到当前系统里的合适字体,没有的话就安装
- linux 查看字体 - zero.q - 博客园: https://www.cnblogs.com/liuq1991/p/7919944.html
- linux安装中文字体_百度经验: linux安装中文字体-百度经验
- https://github.com/l04m33/dot-files/raw/master/.stumpwm.d/fonts/WenQuanYiZenHeiMono.ttf
- 修改源码
digraph G { node [fontname="WenQuanYi Zen Hei Mono"]; main->parse->execute; main->init; main->cleanup; execute->make_string; execute->printf; init->maie_string; main->printf; hello->printf; printf->hello; "爱情 "->" 婚姻 "; "少女"->"我"; execute->compare; }
- (可选)我安装的0.3.10版本的"graphviz-dot-mode"不能生成svg图片,需要修改一下
(setf graphviz-dot-preview-extension "svg") (graphviz-turn-on-live-preview) (defun graphviz-compile-command (f-name) (when f-name (setq compile-command (concat graphviz-dot-dot-program " -T" graphviz-dot-preview-extension " " (shell-quote-argument f-name) " > " (shell-quote-argument (graphviz-output-file-name f-name))))))
- 得到的svg结果
1 个赞
应该不涉及逻辑关系,我只是从题主那里复制的。
感谢,加上这一句就可以了。
并没有关系,只是粘贴了官网 dot 的 guide 然后随便加的。
因为原来的不用修改文本,生成的svg直接在Firefox里可以看见汉字,所以没有查dot的语法(