Some extra information about the text document.
Hi, I've been doing parsing for PSD text for Krita, and it turns out it stores virtually the same text dict inside its txt2 field, so I was able to reuse your research! In turn, here's my contributions based on what I've found:
Simple typos:
- in https://gitlab.com/inkscape/extras/extension-ai/-/blob/4f14072256ead84c258c49c7e867ecf9763e7c9d/inkai/parser/text/definitions.py#L73-76 , Ruby and StyleRunAlignment are confused. It's 34: Ruby, 37: StyleRunAlignment.
- Similarly: https://gitlab.com/inkscape/extras/extension-ai/-/blob/4f14072256ead84c258c49c7e867ecf9763e7c9d/inkai/parser/text/definitions.py#L236-237 it's 26: KurikaeshiMojiShori and 27: Kinsoku.
- Tracking is not in percentages, but 1/1000th of an em (so 0.1% of em-size).
Amendments: color:
For the color object: https://gitlab.com/inkscape/extras/extension-ai/-/blob/4f14072256ead84c258c49c7e867ecf9763e7c9d/inkai/parser/text/definitions.py#L12-22
Type is the color model, though the color is usually in the image color space:
Type 0: Gray, values is [1.0 gray]
Type 1: RGB, values is [1.0 red green blue]
Type 2: CMYK, values is [1.0 cyan, magenta, yellow, key]
Type 3: LAB, values is [1.0 Lightness a b]
Gray, RGB and CMYK values are normalized channel values, LAB is in its typical 0-100, -128-+128 -128-+128 format, which can be more or less filled into a css-color-4 lab(l%, a, b) definition.
Amendments: east-asian features:
In Adobe products you need to manually set whether you want to see the east-asian or middle-eastern options. Here is a rundown of the east-asian ones:
Character Styles:
-
UnderlinePosition-- 1 istext-decoration-position: auto left, 2 is 1 istext-decoration-position: auto righton top of activating the underline. -
Italicsisfont-feature-setting: 'ital' 1. These are italics glyph variants that only show up in CJK fonts. -
StyleRunAlignmentis for Opentype Baseline alignment (css alignment-baseline). 0 = em box bottom/left ('ideographic'), 1 = icf bottom/left ('text-bottom'), 2 = em box center ('center'), 3 = roman ('alphabetic'), 4 = icf-top/right ('text-top'), 5 = em box top/right. -
ProportionalMetrics-- true isfont-feature-setting: 'palt' 1. -
Kana-- true isfont-feature-setting: 'hkna' 1. -
Ruby-- true isfont-variation-east-asian: ruby. InDesign has actual ruby, PS and Illustrator don't. This is just the Ruby alternate glyphs. -
JapaneseAlternateFeature-- 1 isfont-variation-east-asian: traditional, 2 is Expert forms:font-feature-setting: 'expt' 1, 3 isfont-variation-east-asian: jis78. -
BaselineDirection-- 1 istext-orientation:upright, 2 istext-orientation:mixed, and 3 is tate-chu-yoko, ortext-combine-upright: all. -
Tsume,LeftAki,RightAki-- Tsume is space-reduction on both sides, Aki is space expansion. This is in the context of east-asian layouts having particular places where you'd allowed to introduce space (see also the mojikumi tables). These don't really have a CSS/SVG equivalent beyond manually moving dx/dy. -
JiDoriseems to be related to justification, but I'm not sure what exactly it is. -
WariChuis what JLReq calls an 'inline cutting note', no CSS equivalent right now. -
TCYUpDownAdjustment,TCYLeftRightAdjustmentare for adjusting the x/y position of tate-chu-yoko/text combine upright. No explicit CSS/SVG equivelant.
There seem to be more east-asian opentype features, but I don't know their keys, a cursory glance at the manual suggest we're missing:
- hojo kanji - 'hojo'
- nlc kanji - 'nlck'
- alternate notation - nalt
- proportional kana - 'pkna'
- vertical kana - 'vkna'
- vert alt+rot - vrt2, or vert + vrtr
- jis83, jis90, jis04, simplified.
- proportional width.
- qwid, twid, hwid.
Paragraph styles:
-
AutoTCY, auto tate-chu-yoko, number is amount of digits that can be considered, equivalent to CSS-writing-modes-4text-combine-upright: digits <integer> -
BurasagariType, this is CSS-Text-3 hanging-punctuation, 0 is no hanging punctuation, 1 isallow-end, 2 isforce-end. Because of confusing reasons, CSS hanging punctuation doesn't have a Roman - equivalent (basically the discussions get stuck on the difference between Latin hanging punctuation and the very similar optical bounds). -
Kinsoku, when not/nil, this is a number referring to the Kinsoku stuff in the document resources. This is CSS-Text-3 line break strictness. -
KinsokuOrderKinsoku order relates to what to do when dealing with a glyph that doesn't allow breaking. There's no CSS equivalent. -
KurikaeshiMojiShori, this is about itteration marks, no CSS equivalent. -
MojiKumiTable, when not/nil, this is a number reffering to the MojiKumiTable in the document resources. The CSS equivalent is the still experimentaltext-spacingoptions in CSS-Text-4.
Amendments: Language ENUM:
This is incomplete, but here's the list of languages and their xml:lang tags.
0. "en-US" -- US English
1. "fi" -- Finnish
2. "fr" -- French
3. "fr-CA" -- Canadian French
4. "de" -- German
5. "de-1901" -- German before spelling reform ("old german" in the UI, which is probably a good way to make a linguist laugh.)
6. "gsw" -- Swiss German
7. "it" -- Italian
8. "nb" -- Norwegian
9. "nn" -- Norsk (nynorsk)
10. "pt" -- Portuguese
11. "pt-BR" -- Brazilian Portuguese
12. "es" -- Spansh
13. "sv" -- Swedish
14. "en-UK" -- British English
15. "nl" -- Dutch
16. "da" -- Danish
18. "ru" -- Russian
22. "cs" -- Czech
23. "pl" -- Polish
25. "el" -- Greek
26. "tr" -- Turkish
28. "hu" -- Hungarian
I hope this is helpful!