A continuation of T1004
In Krita 4.0, we released a text tool that can...
- Handle richtext styling like fonts, bold, italic.
- Handle Unicode goodness such as Middle-eastern and Asian scripts, as well as Emoji's (When you have an emoji font installed), and weird freaky unicode stuff like Zalgo: https://eeemo.net/
- Left to Right and Right to Left are automatically recongised!
- Copy-paste/find/replace/syntax highlighting, and more editor functions.
Original Requirements:
- paragraphs (but not pages)
- Multi language support:
- right-to-left
- left-to-right
- top-to-bottom script layout
- support for western scripts, semitic scripts and chinese/japanese. (Unicode support)
- Mongolian, probably not so much. (Top to bottom, left to right, as opposed to CJK top to bottom, right to left)
- fill irregular shapes (balloons and boxes)
- styles: bold, italic, fonts
- compatible with inkscape (svg)
- can be put on a path
- easily translatable using scripts that work on .kra files (Wolthera made a POT extractor for the comics manager in python, so this is easily possible.)
- can be baked/rendered from a .kra file -- What does this mean?
What SVG features are still open:
SVG 1.1
- Rotation attribute
- Handling multiple inputs into dx/dy/x/y properly.
- Text on path (this basically takes the previous two to be fixed and then have an arbitrary path used as input for this.
- Text on path, stretched. This is a different beast from above as it requires deforming the path itself, instead of just rotating and positioning things.
- XML white-space handling (Check svg2 too)
- TextLength and lengthAdjust
- Font stretch
- Small caps (Font-variant, Check svg2 too)
- Dominant baseline (Check svg2 too)
- Alignment baseline (Check svg2 too)
- Writing mode and glyph orientation. (Check svg2 too)
SVG 2
- CSS whitespace: Pre/Preline/Normal/Prewrap/Nowrap.
- Text-decoration line/text decoration-style/text-decoration-fill/text-decoration-stroke
- Font-variant for all sorts of open type features. (This will require modifying QT itself to get access to Harfbuzz)
- CSS writing mode values instead of svg 1.1 writing mode values.
- Dominant baseline: Reset size/use-script/no change
- Alignment baseline: 'auto', 'before-edge', and 'after-edge' removed.
- Baseline-shift: 'baseline' property should be converted to '0' or just not defined at all.
- Letterspacing: "SVG 2 removes percentage values from the letter-spacing property. "
- Wordspacing: " In SVG 1.1, percentages define additional spacing as a percentage of the SVG viewport size. In SVG 2, following CSS Text Level 3, percentages define additional spacing as a percentage of the affected character's width. "
- Kerning: "This property is replaced in SVG 2 by the CSS font-kerning property which solely controls turning on/off the use of the font kerning tables. "
Wrapping text:
- Inline size: A given width(or height in case of vertical text) at which text wraps around.
- Shape inside/shape subtract/shape padding/shape margin/shape image threshold: A crazy christmas tree way of defining text-layout areas. Will require...
- A layout algorithm that can take several arbitrary shapes and lay out the text accross that. And handle justfied/center/right/left align
- A way to define several arbitrary shapes.
- See how we would want to use shape subtract.
- An algorithm that can take arbitrary shapes and add/remove padding/margin to them.
- A moment of wonderin whether we want to support shape image threshold at all... (And if so, how!)
- Text-align: Left, Right, Justify, Center
- Text-align last: The alignment of the last bit of text.
- Line-break
- Word-break
- Hyphens
- Word-wrap
- Overflow wrap.
- Text-overflow
- Line-height
GUI
- Wordspacing/LetterSpacing/Kerning all work and the gui for it should be merged to master.
Other:
- There's still a weird thing where QT doesn't report the size of fonts properly. This is super-evident with things like Zalgo, but less so with things like italics on text. There's a hack for the latter in the code, so we need to be mindful of that.
- We will need to sit down for things regarding Asian specific styling methods, like emphasis marks and ruby. SVG has nothing about this in its specs.
- Think about text-styling and css stylesheets and when we want to use these.




