Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joebowden opened this issue Sep 11, 2014 · 10 comments
Open

Comments

@joebowden
Copy link

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).

@jhatwich
Copy link
Contributor

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.

@dirkschulze
Copy link
Contributor

  • 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
Copy link
Contributor

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
Copy link
Contributor

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.

@jhatwich
Copy link
Contributor

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
Copy link
Contributor

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.

@dirkschulze
Copy link
Contributor

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.

@joebowden
Copy link
Author

@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
Copy link
Author

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 joebowden removed the testing label Sep 21, 2014
@joebowden
Copy link
Author

@joebowden joebowden changed the title Layer FX: Text gets offset/clipped if there are layer fx added. [3841453] Layer FX: Text gets offset/clipped if there are layer fx added. Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants