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

textLength XML code in SVG output makes text editing in Inkscape a problem #118

Closed
svenyos opened this issue Jul 10, 2020 · 4 comments
Closed

Comments

@svenyos
Copy link

svenyos commented Jul 10, 2020

A need for an alternative to textLength? SVG output generating by svglite (e.g. ggplot graphs) with fixed textLength entries in their XML code result in corresponding text labels in the file to have fixed lengths. If letters of the text are deleted from these text boxes, the remaining text stretches to fill the space. The reverse is true for entering extra text. Removing the textLength entries in the XML code fixes the problem

@hyokangs
Copy link

May be a related issue: when I import svg files to MS Word, text widths (or spaces between them) does not show correctly. Web browsers show them correctly, though.
image

@thomasp85
Copy link
Member

@hyokangs yeah, word is horrible at rendering svgs - I don't think there is anything we can do about that

@svenyos I understand the issue but since we cannot predict how wide a text string is in different renders and the graphic engine uses the string width to position text we need a way to fix the width... I have a few ideas to fix this for standard alignment but I'm not sure it can be fixed generally

@svenyos
Copy link
Author

svenyos commented Aug 4, 2020

Fair enough. For anyone encountering this issue, one work around is replacing the term "textLength" to something unintelligible so that inkscape ignores it (by opening the SVG file in a text or XML editor and editing XML code directly). This removes the length constraint on text when rendered in inkscape. Not elegant but effective.

@thomasp85
Copy link
Member

I added a switch in the commit that closed this

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

3 participants