adobe-photoshop / generator-assets

Generator Plug-in for Adobe Photoshop CC that helps users export image assets
MIT License
496 stars 86 forks source link

Can't Generate from Arabic, Hebrew, Farsi, or other Right-to-Left languages #3609777 #114

Closed itoda closed 11 years ago

itoda commented 11 years ago

Behalf of David Mohr (Fix by 15.0) Problem: Can't Generate from Arabic, Hebrew, or other Right-to-Left languages

METHOD: 1) launch PS 2) create a document with English, Russian, or Japanese type 3) add .jpg to the end of the layer name 4) click Generate NOTE: everything is great and the file looks cool and works correctly. Crowd goes wild. 5) repeat with Arabic, Hebrew, Farsi, or other right-to-left language in the type layer

RESULT: nothing at all. Cannot generate. Due to the layout algorithm for text, the ".jpg" is appended to the FRONT of the layer name. We're actually doing the correct thing; according to the Unicode R2L algorithm, the dot is a weak character and follows the flow-pattern of what preceded it. Arguably, this is an issue with how layer names are defined, but outside the context of Generator, it's a non-issue. We do handle Arabic JPGs and PSDs just fine (see attached files), so the problem is with appending the extension to the layer name. While English users might not use Arabic for web-related content, this is NOT true in the Middle East: http://www.theguardian.com/technology/2010/may/06/arabic-web-addresses-internet and http://stackoverflow.com/questions/8341735/arabic-characters-in-url

EXPECT: for all languages to have this functionality, not just left-to-right ones. This is bad bug but I would NOT, however, hold up the first release of this feature for this problem.

WORKAROUND: if a user manually deletes the entire contents of the layer and adds a new English name, then it will work. But then the contents of the layer are lost and there's a large amount of non-expected user intervention required.

SUGGESTION: there are actually a couple of potential solutions. The one which is most compatible with the current design would be to allow ".jpg" and ".png" to ALSO be appended to the front of the layer name as well as the end. Looking at latest Microsoft's implementation of R2L algorithm in the latest Excel, this would not solve completely the problem, but it would make it a little easier to parse, allowing for something like "jpg.". See screenshots.

ytakahas commented 11 years ago

It looks like this is PS input problem rather than Generator (node) per Joel's investigation so closing Github issues 114 for now. If it turns out that this is node side issue, please re-open.