newsdev / ai2html

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

Add ability to set top, bottom, left and right margin offsets using left and right paragraph margins and baseline shift. #18

Open archietse opened 8 years ago

archietse commented 8 years ago

This needs to be done in absolute pixels.

archietse commented 8 years ago
            var kind, htmlX, htmlY, htmlT, htmlB, htmlTM, htmlH, htmlL, htmlR, htmlW, htmlLM, alignment, extraWidthPct, htmlRM, htmlBM;
            var centerBuffer = 30; // additional width on left and right sides for center aligned point text in percent of ai width

            htmlTM = 0;
            htmlBM = 0;
            htmlRM = 0;
            htmlLM = 0;

                if (htmlTM!=0) {html[6] += "margin-top:"    + htmlTM + "px;";};
                if (htmlBM!=0) {html[6] += "margin-bottom:" + htmlBM + "px;";};
                if (htmlRM!=0) {html[6] += "margin-right:"  + htmlRM + "px;";};
                if (htmlLM!=0) {html[6] += "margin-left:"   + htmlLM + "px;";};