Renaming pattern labels

Discuss SVG code, accessible via the XML Editor.
msandersen
Posts: 11
Joined: Fri Dec 21, 2007 1:59 pm

Renaming pattern labels

Postby msandersen » Fri Feb 08, 2008 11:56 pm

Does anyone know the XML property to add to have a custom pattern appear with a more human-readable label with spaces, ie not just renaming the ID?

User avatar
shawnhcorey
Posts: 149
Joined: Mon Jan 07, 2008 12:17 pm

Re: Renaming pattern labels

Postby shawnhcorey » Sat Feb 09, 2008 12:49 am

I'm not sure what you mean by XML property; do you mean an XML attribute?

If so, Inkscape has one (but sadly only one). Select an object then from the menu: Object->Object Properties

The property Label will accept almost any character and is stored as the XML attribute "inkscape:label"

msandersen
Posts: 11
Joined: Fri Dec 21, 2007 1:59 pm

Re: Renaming pattern labels

Postby msandersen » Sun Feb 10, 2008 3:00 am

Wasn't sure what to call it. I was trying to think what it's called in HTML or CSS. You call Label for a property, too.
I already tried Label, and it didn't work. I had also looked at patterns.svg which comes with 0.46 Dev, and noticed the Attribute inkscape:stockid which is used there to name the Patterns there. But Inkscape crashed as I tried it, so I thought it might only work for System patterns and tried inkscape:label instead, which didn't work.
I just decided to try inkscape:stockid again, and what do you know, it works.
Eg: inkscape:stockid="Stripes 1:1" in the Pattern definition.
This is as mentioned in 0.46Dev.

msandersen
Posts: 11
Joined: Fri Dec 21, 2007 1:59 pm

Re: Renaming pattern labels

Postby msandersen » Sun Feb 10, 2008 4:25 am

Oh, I remember now why I decided it was only for the Default patterns. Whereas inkscape:stockid in a file shows up as a label in the Pattern Fill dialog, it doesn't actually work if you try and change it to another user-defined pattern, only if to a default pattern. It just ignores the request. Not sure if I should file a bug, as it might only be intended for the Default patterns. In which case there must be a working alternative. Which is why I posted in the first place asking for other attributes/properties.

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Renaming pattern labels

Postby Simarilius » Sun Feb 10, 2008 6:22 am

the inkscape:stockid tag is used to recognise that a pattern is a clone of a stock one, so that you shouldnt end up with a bunch of identical ones in your pattern menu.

I dont think theres code to get the pattern list to look at anything except the id tag for what it displays in the menu. shouldnt be too hard to get it to look for the inkscape:label and display that I guess, file a bug/rfe asking for it. :D

msandersen
Posts: 11
Joined: Fri Dec 21, 2007 1:59 pm

Re: Renaming pattern labels

Postby msandersen » Sun Feb 10, 2008 1:22 pm

I will. Just wanted to know if I was missing something. I'm sure they have better things to do than deal with bogus reports. It just seems obvious there should be a way, just as the Default patterns have a label.


Return to “SVG / XML Code”