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

Local transformation and internal SVG element access - Text object attributes #165

Open
rossanoparis opened this issue Apr 12, 2024 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@rossanoparis
Copy link

Data

This issue refers to: issue 98
Library version: v2.3.9 (master)
Testing SVG file: groups.svg.zip (InkScape)

Document Details
image IDs text2, text3
image

Scope

For a "text object" I'd like to get the following attributes: text value (array of strings), text position (array of float) and text angle
Because they are useful to draw texts using other functions from other libraries ( for instance, wxWidgets )
It is up to the user select an appropriate font to draw them.

Testing code

// Load document
auto document = Document::loadFromFile(filesvg);
Box dbox(0, 0, document->width(), document->height());

// Retrieve the SVG element - text2
auto text2 = document->getElementById("text2");

Results

The pointer returned by the function auto text2 = document->getElementById("text2"); returns a NULL pointer.

Remarks

It is known that LunaSVG doesn't handle texts; they can't be rendered.
Any way, it could handle them as internal objects with the scope of being useful for a user who needs to get their attributes.
Perhaps LunaSVG should own functions able to operate on text objects only, in order to get something like below

ID text2
Text value[0] = TEXT2
Text position X[0] = 12.732866
Text position Y[0] = 141.75731
Text angle = -40.234662

ID text3
Text value[0] = TEXT3.1
Text value[1] = TEXT3.2
Text position X[0] = 73.865891
Text position Y[0] = 103.12551
Text position X[1] = 73.865891
Text position Y[2] = 108.12551
Text angle = 0

@sammycage sammycage added enhancement New feature or request question Further information is requested labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants