Show Chinese in dot

Source: Internet
Author: User

Dot is a good image generation tool, especially suitable for generating simple images with various automatic la S.

Because the dot source file is a text file, it is relatively simple in version management, and it is very convenient to generate a large number of similar images.

However, by default, images generated by dot do not support Chinese characters.

 

To display the dot image in a simple way, you can convert the source file to the UTF-8 format and specify the font in the dot file as a Chinese font. Generally, simsun. tcc is used as a Chinese font.

As follows:

/** <Br/> * @ file config. dotf <br/> * @ brief configuration task flowchart <br/> * @ author zkk <br/> * @ date 2009-05-08 <br/> * $ Id: config. dotf, v 1.1 2009/05/10 04:58:53 Kaikuo Exp $ <br/> */<br/> digraph g_main {<br/> ranksep = 0.2 <br/> node [shape = box, style = filled, fillcolor = lightblue, fontname = "simsun. ttc ", fontsize = 14]; <br/> edge [fontname =" simsun. ttc ", fontsize = 12]; <br/> check_input [shape = diamond, label =" whether Is there new/n configuration data? "]; <Br/> check_valid [shape = diamond, label =" is the configuration data/n legal? "]; <Br/> config_prcs [label =" "]; <br/> config_burn [label =" "]; <br/> end [label = "loop end"]; </p> <p> check_input-> check_valid [label = "Y"]; <br/> check_input-> end [weight = 3, label = "N"]; <br/> check_valid-> end [weight = 3, label = "N"]; <br/> check_valid-> config_prcs-> config_burn-> end; <br/> {rank = same; check_input; check_valid; config_prcs} <br/>}< br/>

 

The effect is as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.