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

textAlign set to "middle" returns empty array #14

Open
swampthang opened this issue Mar 29, 2019 · 2 comments
Open

textAlign set to "middle" returns empty array #14

swampthang opened this issue Mar 29, 2019 · 2 comments

Comments

@swampthang
Copy link

When using the following code I get a proper array...

let polygons = vectorizeText("Testing<br>one<br>two", {
    polygons: true,
    font: "Amatic-Bold",
    size: 80,
    orientation: 'ccw',
    textAlign: "start",
    styletags: {breaklines: true},
    width: 320,
    height: 80,
    textBaseline: "hanging"
  });

But if I set the textAlign value to "middle" I get an empty array. Is this a known issue? Don't see anything on this.

@swampthang
Copy link
Author

Ahhh, should this be "center"?

@swampthang
Copy link
Author

swampthang commented Mar 29, 2019

Ok, center no longer breaks it but the resulting SVG doesn't center the text. If 'right/end' is used the paths are all positioned relative to the right-most path and the right-most point is set to x: 0, iow, everything is scooted to the left of the stage. If center is used, the right edge is positioned in the center of the svg and everything else is positioned relative to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant