-
Notifications
You must be signed in to change notification settings - Fork 93
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
is there a way to create manually svg text with php-svg without official method #52
Comments
I'm not quite sure what you're asking about exactly, so I'll try to outline different ways. Setting arbitrary attributes: Setting text content: Example: $image = SVGImage::fromString('<svg><title></title></svg>');
$title = $image->getDocument()->getChild(0);
$title->setValue('hello world');
echo $image; Modifies the title tag to be Custom node types: Path data: Example: $image = new SVGImage('100%', '100%');
$doc = $image->getDocument();
$doc->addChild(
(new SVGPath())
->setDescription('M 100,100 L 200,200 h -100 Z')
); Did any of this answer your question? If not, please try to state your question more clearly, perhaps by giving an example of what you're trying to do. Thanks! |
Some of the features mentioned were added quite recently and did not make it into any release yet. Therefore, I pushed a new release (v0.8.0) just now. |
Hi Meyfa, I need to include dynamic text into my svg "picture". Text from database or other PHP class which is include in my svg and transform the format for display position, color or others. All of "hello" label in this picture is controlled by your svg library (position, color, text label, .....) Ok for settings text content and attribute. It not directly response of my issue but I think that could be interesting. Perhaps use JS obliquely for format this as I like. Custom nodes is very interesting but I need lot of work for create dynamic svg depends on a dynamic variables PHP. Perhaps create lot of link between SVGPath and string php with const like that :
What do you think ? Thank you for your new release. |
This project is very useful !
But no integration for text svg in this library is very annoying.
is there a alternate way to integrate text into SVG generate with this library ? perhaps
Thank for your partnership.
The text was updated successfully, but these errors were encountered: