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

Add character styling (ie. intra-paragraph styles) #5

Closed tmaslen closed 7 years ago

tmaslen commented 9 years ago

Hello NYT devs,

Why does this limitation appear in AI2HTML...

The script currently only sets one style per paragraph, so custom styled words or characters within a paragraph are ignored. Each paragraph’s style is determined by the middle character in the paragraph.

Thanks, /t

archietse commented 9 years ago

At the start of this project I was trying to get something working quickly which meant just looping through all the text elements by paragraph with the intention of going back at some point and parsing by character. But paragraph styling ended up meeting 99 percent of our needs, and it was more pressing to add other features. Also the pressure to go back to character styling became less urgent once we realized we could just add html tags (ie. <b>, <i> and <span>'s and such) right into the text blocks to style text within paragraphs as needed (it's not pretty, but it works).

That said, I do want to add intra-paragraph styling at some point. Some of the goals/issues will be:

mbloch commented 7 years ago

ai2html-beta.js includes support for character styling. This feature will be added to ai2html.js for release v0.64.