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

using special characters in XML ID for font design #7

Open
risacher opened this issue Aug 3, 2022 · 7 comments
Open

using special characters in XML ID for font design #7

risacher opened this issue Aug 3, 2022 · 7 comments

Comments

@risacher
Copy link

risacher commented Aug 3, 2022

While trying to design a new font, I can't change the XML ID to ":" because Inkscape 1.2 considers this an Invalid ID. (Oddly, If I edit an existing font, it seems to have no problem.).

How is this supposed to work? This seems to be true for other special characters as well.

@risacher
Copy link
Author

risacher commented Aug 3, 2022

So... I was editing the XML ID with the Object Properties dialog, which disallows special characters, but the XML editor allows them.

@risacher
Copy link
Author

risacher commented Aug 3, 2022

I'm closing this since I found the "workaround" to my problem.

@risacher risacher closed this as completed Aug 3, 2022
@Shriinivas
Copy link
Owner

Sorry for the delayed reply.
I tried creating a font with : as one of the characters. I was able to assign : as xml ID and also successfully generate font data with Inkscape 1.2. Could you let me know your OS? Which other special characters had problem? Also, great to know you found a workaround, what exactly did you do to make it work? This information will help others facing similar issue.

@Shriinivas Shriinivas reopened this Aug 19, 2022
@risacher
Copy link
Author

risacher commented Aug 27, 2022

I'm using MacOS 12.5.1. (Although I might have been using Ubuntu when I first reported the issue.)

If I create a path in my font template, right-click on it and select "object properties", I get a dialog in which if I assign a character that is invalid in an XML id (such as ":") it will change the label of the ID input box to "Id invalid!" and it will not change the ID attribute, and I therefore cannot seem to make a glyph in my font for such a character.

However, if I open the XML Editor (from the Edit menu) and select the path for my glyph, I can edit the 'id' attribute of the svg:path object in the XML Editor pane and set it to be whatever, including ':' or '"'. Afterwards, if I then open the "object properties" dialog for the same path, it will show the ID attribute as the same character that it forbid me to set earlier.

I have not tested extensively what characters cause a problem, but at the minimum it includes ':', '\'' and '"'

@risacher
Copy link
Author

I think this is confusing to explain in text, so I made a quick video to show what I meant: https://youtu.be/TXolpG_CChw

@Shriinivas
Copy link
Owner

Sorry for not getting back to you earlier. Are you still facing the issue?

@risacher
Copy link
Author

risacher commented Sep 21, 2023

I just tested this in Inkscape 1.3, and yeah, it still happens, but the workaround I proposed still works okay too.

Fundamentally, I think there's a bit of a conceptual issue in that the inkscape stroke font extension assumes that the id of the path for the glyph will be the character that it represents, and certain characters are generally not allowed in XML ids. But they sorta work anyway, although Inkscape isn't consistent in how it handles them. Specifically, ':' is okay in the XML editor, but not in the object property editor. I suggest that you document the issue and the workaround in the video tutorials, and move on with your life. I made a comment on Tutorial 1 trying to explain the issue and linking to my own video.

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

2 participants