Diffusion Krita fa5040611b84

Rewrite common style handling algorithm for the rich-text editor

Authored by dkazakov on Jan 12 2018, 6:21 PM.

Description

Rewrite common style handling algorithm for the rich-text editor

  1. The previous implementation just took the most popular char format, event though it could contain some properties that are not present in some other formats. And given that we have no access to the default values of the formats, the difference algorithm could not calculate the real difference (which should have been "negative" in this case)
  1. Now we calculate the "greatest common denominator" of all the available formats in the text and put it into the root style
  1. Also apply this method to the block format. The previous implementation just took the first format as a base, which was, obviously, wrong. If, say, the first block has text-anchor:start property, but the second block doesn't have this property, then our global property will apply to the second block as well, although we didn't want it.

Still known bugs:

  1. svg-to-document algorithm still has some troubles with applying the alignment property to the blocks. I don't know why it happens though.
  1. The alignment itself works wrongly. Svg's text-anchor:start|end|middle is not the same this as align:left|center|right. The alignment should be somehow calculated using the offsets.

Details

Committed
dkazakovJan 12 2018, 6:21 PM
Parents
R37:46ccfddc9976: One more fix for the offset text shape outlines
Branches
Unknown
Tags
Unknown