svgObjectModelGenerator icon indicating copy to clipboard operation
svgObjectModelGenerator copied to clipboard

[3841453] Layer FX: Text gets offset/clipped if there are layer fx added.

Open joebowden opened this issue 10 years ago • 10 comments

Test file: http://adobe.ly/1nP7VtN

  1. Open test file in PSD
  2. Open layers in crema, or generate svg
  3. Examine preview/svg files

Result: Text is offset or clipped when there are layer fx. Bevel & emboss doesn't render at all (for shapes, it renders without the fx).

joebowden avatar Sep 11 '14 23:09 joebowden

The bevel & emboss was an encoding bug that I'm fixing - something is off between the text bounds and the way they relate to bounds with FX. we are relying on EM positioning for Y and it isn't holding up with effects or maybe we are just calculating the font-size wrong? @dirkschulze if you can see maybe fresh eyes will help.

jhatwich avatar Sep 12 '14 04:09 jhatwich

  • bevel & emboss is out of scope for now.
  • The offset thing and text with pt should just be a problem if 1px !== 1pt. This is not the case in the PSD. * All text metrics are in PT and not EM. It is not even possible to change that in PS (just like in Ai).

I am currently sharing my screen at a conference. I try my best to look at some of the things during pauses.

dirkschulze avatar Sep 12 '14 07:09 dirkschulze

Ok, we have the text property which has the bounds property. This usually is far too big. But for fx effects we don't seem to get the right boundaries otherwise. Therefore I suggest using this box.

dirkschulze avatar Sep 12 '14 08:09 dirkschulze

Argh, I totally missed it. So, bonds are not correct for text layers in PS. I don't know why yet. However, that is the reason why we use other bounds. This usually works if you don't apply FX effects. If you have fx effects though, we do not use the computed text bounds but fall back to the fx bounds instead. Which are also wrong:

svgWriterProcessor.js

        if (omIn.boundsWithFX) {
            bndsIn = omIn.boundsWithFX;

        } else {

We probably need to check textBounds and fx bounds and either take the bigger area, or even better take the union of both.

dirkschulze avatar Sep 12 '14 10:09 dirkschulze

I was able to figure out a bounds diffing scheme that seems to fix most of the cases we have... the ones that are not right are not too far off at least. I think there are bugs in the generator bounds, but I have not isolated them. Could be that we just need more info to know where the text is within the bounds they provide.

jhatwich avatar Sep 12 '14 22:09 jhatwich

Setting this to "testing" so that Joe can have a look. Its not going to be fixed/closed but it might not be as high priority now.

jhatwich avatar Sep 12 '14 22:09 jhatwich

The bounds are most definitely wrong. If I have a font size of 48px the bounds can not be 30px height. We have to talk with Generator and PS about that.

dirkschulze avatar Sep 13 '14 06:09 dirkschulze

@jhatwich It's definitely better than it was. It's still off a bit in places, especially with characters with ligatures that run below the baseline. We're not at parity with extract or jsx, but if there's no time to get the rest of it fixed, we can live with it.

Of course if we can get another fix in the time we have, I'll take it. :)

joebowden avatar Sep 14 '14 02:09 joebowden

In the test file, all looks good in Crema preview. But when you generate svg, most layers show clipping on the right side - some just a bit, and a few show quite a bit of clipping. Removing testing label.

joebowden avatar Sep 21 '14 21:09 joebowden

https://watsonexp.corp.adobe.com//#bug=3841453

joebowden avatar Oct 20 '14 20:10 joebowden