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

Text on path not working #139

Open
dirkschulze opened this issue Jan 14, 2015 · 9 comments
Open

Text on path not working #139

dirkschulze opened this issue Jan 14, 2015 · 9 comments

Comments

@dirkschulze
Copy link
Contributor

With Generator 1.2.0 text on path is not working anymore. The segment coordinates were stored in number values but changed to objects with the number value as property and a unit as string.

This effects the test text-on-path

jhatwich added a commit that referenced this issue Jan 14, 2015
Fix issue #139 Text on path broken after Generator update
@imaderyc
Copy link

I tried latest master and either I didn't set it up correctly or it's not working.
my testfile https://drive.google.com/a/601t.com/file/d/0B1M3zV5eEym9OVlvdk5nNk1mdTg/edit (change from PNG to SVG when exporting)
this is what I'm getting in SVG file:

watson bug 3833730

@dirkschulze
Copy link
Contributor Author

Looks like you have the commit before the last commit. I did not try with Crema but I get something meaningful:

<path id="text-path-1" d="M640,702c0,0,31.488,123.117,180.175,48.961S1008,802,1008,802"/>
<path id="text-path-2" d="M1019,701a63,63,0,0,0-63,63Z"/>

@dirkschulze dirkschulze reopened this Jan 14, 2015
@imaderyc
Copy link

while testing this, noticed another case of text on path not working correctly which seems different from original issue; I'm getting zero-bytes SVG files when exporting from one file. https://watsonexp.corp.adobe.com/#bug=3921139

@mvujovic
Copy link
Contributor

Irina's test case 1 isn't rendering quite right for me as well:
screen shot 2015-01-15 at 12 00 43 pm
screen shot 2015-01-15 at 12 01 14 pm

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" width="145" height="126" viewBox="0 0 145 126">
  <defs>
    <style>

      .cls-2, .cls-4 {
        font-size: 36px;
      }

      .cls-4 {
        fill: #226b26;
        font-family: "Optima-ExtraBlack";
      }
    </style>

    <path id="text-path-1" d="M1019,701a63,63,0,0,0-63,63Z"/>
  </defs>
  <text class="cls-2"><textPath xlink:href="#text-path-1">
    <tspan class="cls-4">text on a path</tspan>
  </textPath></text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" width="223" height="71" viewBox="0 0 223 71">
  <defs>
    <style>

      .cls-2, .cls-4 {
        font-size: 36px;
      }

      .cls-4 {
        fill: #226b26;
        font-family: "Optima-ExtraBlack";
      }
    </style>

    <path id="text-path-1" d="M640,702c0,0,31.488,123.117,180.175,48.961S1008,802,1008,802"/>
  </defs>
  <text class="cls-2"><textPath xlink:href="#text-path-1">
    <tspan class="cls-4">text on a path</tspan>
  </textPath></text>
</svg>

Seems like the path points are positioned relative to the original doc, not the new asset bounds.

@mvujovic
Copy link
Contributor

Regarding Irina's second test case 2, two of the layers throw some JS errors in the console for me:

[info:crema 12:08:32.596 rendermanager.js:157:30] RenderManager active
[info:crema 12:08:32.612 rendermanager.js:179:26] Rendering: Text on Path.svg (2;1)
[info:crema 12:08:32.896 rendermanager.js:179:26] Rendering: Plain text.svg (1;2)
[info:crema 12:08:32.911 rendermanager.js:179:26] Rendering: more path text.svg (0;3)
Ex: TypeError: Cannot read property 'right' of undefined
TypeError: Cannot read property 'right' of undefined
    at SVGWriterPreprocessor.shiftBounds (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:258:52)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:367:22)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:379:26)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:379:26)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
GET /extractasset/258/3/0/Text%20on%20Path.svg?v=1 200 2ms
GET /extractasset/258/4/1/Plain%20text.svg?v=1 200 1ms
Ex: TypeError: Cannot read property 'right' of undefined
TypeError: Cannot read property 'right' of undefined
    at SVGWriterPreprocessor.shiftBounds (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:258:52)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:367:22)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:379:26)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:379:26)
    at SVGWriterPreprocessor.processSVGNode (/Users/mvujovic/Code/svgObjectModelGenerator/svgWriterPreprocessor.js:381:26)
    at Array.forEach (native)
[info:crema 12:08:34.393 rendermanager.js:191:38] RenderManager idle

@dirkschulze
Copy link
Contributor Author

@mvujovic I can not reproduce it when generating the SVG for the whole document. It passes just fine. Maybe it happens when Crema tries to get the layer data of a specific layer. Then omIn._parentBounds might either not be an object or does not have the property. I'll upload the Generator file in a separate pull request so that we can test it.

@dirkschulze
Copy link
Contributor Author

@imaderyc I and @mvujovic opened new bug reports for all the unrelated issues that were mentioned in this bug. Apparently the path is created properly for @mvujovic with Crema. Could you try to set up Crema again please?

@imaderyc
Copy link

I'm exporting single layer, not entire document.

@imaderyc
Copy link

can't reproduce the issue with 'ZZZZZ' in path anymore (not sure what 'fixed' it because I'm using the same build/same setup)

but text is still not rendered correctly in SVG file; path seems correct (numbers, not 'z' anymore), but when previewing in Crema or Browser, text is not shown (same as screenshot mvujovic posted above)

dirkschulze added a commit that referenced this issue Aug 24, 2015
Remove the requirements for groups and shapes to have a unique id. Fixes...
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