newsdev / ai2html

A script for Adobe Illustrator that converts your Illustrator artwork into an html page.

Home Page:http://ai2html.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use Chinese fonts

DD-A-YAN opened this issue · comments

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

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:

  • Make sure you have version 0.77.0 or newer of the the ai2html script (I just published version 0.77.0).
  • Add rules for all your fonts to a config file, named ai2html-config.json.
  • The config file can be in the same directory as the ai2html.js script, or in the same directory as your .ai document.

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/

Thanks! I have solved the problem through your answer.