Hi, allow me to chime in here 
[quote=“dismine, post:9, topic:587, full:true”]
Do you know any program that supports custom types?[/quote]
Yes, you don’t need to look far: LibreOffice
Here you see an example where I am adding a style type called “new semantic meaning”.
Note how the LibreOffice people implemented this: you add your custom style element as a child to one of the many predefined style types (semantic meanings). In this example, I created a custom type that is a sort of “Emphasis”.
I think you can copy this approach directly: Introduce a list of semantic meanings, specific to pattern making. This will probably be something like: fold, cut, seam, helper, …
That way, computers and other software will be able to understand the meaning of each of those.
If a user decides to create sub-types for those, eg different kinds of folds they want to use, to somehow put emphasis on certain folds, they can.
Then they can modify any style properties related to that semantic meaning.
Yes, I would save styles separately from patterns. A pattern can be loaded in every configuration of Valentina. If you don’t have the same style selected, the file will simply render differently on your screen.
This is actually a feature, not a bug. I can imagine myself getting used to one color coding for reading patterns, I’m not interested in the color coding someone else is using, I’m just interested in understanding the pattern. The same goes for a piece of software or a machine that tries to open the Valentina file.
I think a legend is just a patch-up hiding the real problem.
If you do consider some kind of legend, ask yourself this question: will another piece of software easily be able to interpret the legend, or is it a visual queue for humans only?
Without having any specific knowledge of Valentina’s file format, imagine that it’s XML, I can see a definition of a line looking like this:
<pattern name="pattern1" style="myStyle" author="me"> <line type="cut" custom_type="new semantic" >line data</line> <line type="fold" custom_type="important fold" >line data</line> <line type="fold" custom_type="regular fold" >line data</line>
As you can see, each line has a semantic type: either a cut or a fold. These are selected from a set of predefined types, and you cannot add new ones.
In fact, when the user wants to connect a line between two points, he should select the type immediately: whether it’s a fold, a cut, or some other type of line. They should not select a visual style, but a meaning instead.
The user can select a style set in the options, which gives folds and cuts a specific color and thickness, depending on the selected style. This is up to user preference.
To allow the user some more visual configuration, you can allow them to add custom style types as a child of a semantic type. In this example, the user chose one of his fold lines to have the “important fold” look. Here “important fold” is part of a user style, and it is added as a type of fold.
Of course, not everyone will have a style with an “important fold” definition. But that’s not very important, because you have a fallback: if “important fold” is not available, you just draw the line with the style for “fold”, as defined by the currently selected style set.
If you really want, you can choose to also embed the style set used into the pattern. But it should be up to the user to decide whether they want to load the style set that comes with the pattern, or just use the style set that they have configured on their local computer.
This is also important if for example someone has a visual impairment. If for example, I would have daltorism, I would not use the colors green and red to differentiate between fold and cut lines.
So I might define my own style set, with good line styles that I can clearly differentiate.
Now if I download someone else’s pattern, and that someone was particularly fond of red and green, I would have a problem… Unless I could just choose to keep using my own style set.
Because the pattern file clearly says what is a cut and what is a fold line, I will have no problem understanding it, and rendering it the way I want.
I would not go to great lengths at trying to prevent users from doing something. If the users want to shoot themselves in the foot, then let them. Don’t underestimate them, they will see what the impact is of their style changes and eventually come up with styles that work well.