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

How does one add Text? #47

Closed
russelldb opened this issue Apr 19, 2021 · 3 comments
Closed

How does one add Text? #47

russelldb opened this issue Apr 19, 2021 · 3 comments

Comments

@russelldb
Copy link

Sorry this isn't really an issue (or it's a documentation issue?) but I can't figure out how to use the Text Node to actually add text to a document. Can you help, please?

@russelldb
Copy link
Author

I figured it out.

There are element::Text and node::Text and the latter is the text that is the value for the former.

@lukepighetti
Copy link

Can you please provide a code sample? I'm trying to figure this out and I'm not fully understanding your closing comment.

@casperlamboo
Copy link

For future reference if someone has the same question as @lukepighetti, here is a small example.

let mut node = svg::node::element::Text::new();
node.assign("x", 100.0);
node.assign("y", 100.0);
node.append(svg::node::Text::new("hello world"));

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

No branches or pull requests

3 participants