newsdev / ai2html

A script for Adobe Illustrator that converts your Illustrator artwork into an html page.
http://ai2html.org
Other
897 stars 145 forks source link

How to use Chinese fonts #103

Closed DD-A-YAN closed 5 years ago

DD-A-YAN commented 6 years ago

I don't how to use Chinese fonts in ai2html, can you tell me?

mbloch commented 5 years ago

Hi, You'll have to set up rules for converting each of the fonts that you're using in Illustrator to HTML/CSS equivalents.

Here's how you can do it:

Here is an example of the data you need to put in the config file:

{   
    "fonts": [{"aifont":"AdobeSongStd-Light","family":"SimSun,STSong,宋体,华文宋体,serif","weight":"","style":""}]
}

If you are not sure of the name to use for "aifont", ai2html should list the AI names of all the fonts that don't have rules, in the message that pops up after you run the script.

If you are not sure of the HTML font names, this article might help: http://www.kendraschaefer.com/2012/06/chinese-standard-web-fonts-the-ultimate-guide-to-css-font-family-declarations-for-web-design-in-simplified-chinese/

DD-A-YAN commented 5 years ago

Thanks! I have solved the problem through your answer.