Ok, for the PSD text/shapes loading code I’ve gotten to the point I’m quite sure about the transforms and the like, I even managed to load old PSDs that I made in 2006-2010, and even though the font is missing (as PSD doesn’t embed these), the positioning is scarily accurate. However, my past self never really made use of any advanced features, so I need some help finding how these features are stored.
Now, PSD is an ancient format, so it has a gazillion different ways to store something. Most data is stored in binary, with some of it stored in action script language (ASL) dictionaries. However, most of the text formatting data is stored in carousel object structure (COS) dictionaries, and these are saved to PSD as plain text. What that means is that you can literally open up a PSD in a code text editor to read the markup (Just do a search for “/Editor” to find the main text string, the markup is underneath that). So if you’re adventurous you can try to find some of the info I need in this way, but I’m happy with test-files too
That said, what I am looking for…
-
A test file with text-on-path and text-in-shape. I know how to load point-texts (preformatted) and paragraph-texts (simple wrapped shapes), and I know where to find the associated path of a shape, but I don’t know how PSD differentiates between text-on-path and text-in-shape. (EDIT: Rakurri shared some)
-
A test file with vertical text. I think I know where this is stored in the ASL, but I’d like to confirm I’m correct. (EDIT: Rakurri shared some)
-
A test file with RTL enabled on the paragraph, I have no clue how this is stored.
-
I don’t need warps, because I know the values, though I kinda have no clue how to support them. As in, I’m just simply not good enough with bezier curves or transforms to know how to warp them… (EDIT: Rakurri shared some)
-
Open Type Features, I have found the key for ligatures and alternate/discretionary ligatures (/Ligature and /DLigature respectively) as well as the toggle for small-caps (/FontCaps), but I can’t find the keys for the others.They are in the second text dict. -
Language specific features, these I am having a hard time finding because they’re pretty hidden in PS (so it is rare to find PSDs using them). I am looking for the keys for…
kinsoku (I know which value is hard and soft, but not the key when applied)“Standard Vertical Roman Alignment”I think I know the key for Mojisoroe (/StyleRunAlignment), but I am unsure which number matches to which baseline optiona test file with tate-chu-yokovertical underline position (/YUnderline, but which number is left and which is right?)I’m trying to figure out leading-type.I’m also open to the middle-eastern features, though my understanding is that most of them don’t have a CSS equivelant and some of them are just plain useless.- EDIT: I’m going to parse the second text-dict first.
-
(Hyphenation) language, this is stored as a number, of which en-US is 14. I think I may know what the other values are, but I need at the least a few more samples to be sure.
-
Colors, all of the test files I’ve found have the colors in RGB, which is internally written as a dict with type 1 and a list of values in ARGB order. This is odd, because in all other cases PSD stores the color model RGB as type ‘0’, (1 being ‘HSB’). So my question is, can PSD at all store things like LAB or CMYK colors on text, and if so, what type is it stored as?
-
if you’d like me to implement load/save for live path data for vector shapes, I need a test file with all the possible live path shapes (that is, a rectangle, polygon, etc, not every possible combo). I only have a sample file with ellipses right now.