newsdev / ai2html

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

Make it easier to add your own fonts #6

Closed archietse closed 6 years ago

archietse commented 9 years ago

Possible solution: ai2html-fonts text block. Will need to determine easiest way to enter all the elements of the hash that are needed.

kevinschaul commented 9 years ago

Any way custom fonts could be defined in a separate file that ai2html loads? It would be slightly annoying to have to include the same fonts text box in all illustrator files.

rjmoggach commented 8 years ago

how about putting css attributes in the object's attributes?

font-family: 'My Great Font', weight: 'bold', style:''

It would still require additonal editing in the HTML to define correct family names, fallbacks, and numeric weights but would avoid having to edit the main script.

Alternatively a sidecar json file that matches the base fonts list like...

var extra_fonts = [
    {"aifont":"Lato-Light","family":"'Lato','Avant Garde','Helvetica Neue',helvetica,arial,sans-serif","weight":"200","style":""},
    {"aifont":"Lato-LightItalic","family":"'Lato','Avant Garde','Helvetica Neue',helvetica,arial,sans-serif","weight":"200","style":"italic"},
    {"aifont":"Lato-Italic","family":"'Lato','Avant Garde','Helvetica Neue',helvetica,arial,sans-serif","weight":"300","style":"italic"},
    {"aifont":"Lato-BlackItalic","family":"'Lato','Avant Garde','Helvetica Neue',helvetica,arial,sans-serif","weight":"900","style":"italic"},
    {"aifont":"Lato-Regular","family":"'Lato','Avant Garde','Helvetica Neue',helvetica,arial,sans-serif","weight":"400","style":""},
];

If there's a two step process that requires the font names script then maybe the font name script can output this template json file optionally as well.

mbloch commented 7 years ago

I like @kevinschaul's suggestion of using a separate config file for additional font definitions. The file might also contain settings to override the default settings.

mbloch commented 6 years ago

Font configuration is covered in issue #86, so I'm closing this issue.