-
Related to this function: https://github.com/rism-digital/verovio/blob/develop/src/svgdevicecontext.cpp#L991-L1003 void SvgDeviceContext::AppendAdditionalAttributes(Object *object)
{
std::pair<std::multimap<ClassId, std::string>::iterator, std::multimap<ClassId, std::string>::iterator> range;
range = m_svgAdditionalAttributes.equal_range(object->GetClassId()); // if correct class name...
for (std::multimap<ClassId, std::string>::iterator it = range.first; it != range.second; ++it) {
ArrayOfStrAttr attributes;
object->GetAttributes(&attributes);
for (ArrayOfStrAttr::iterator iter = attributes.begin(); iter != attributes.end(); ++iter) {
if (it->second == (*iter).first) // ...and attribute exists in class name, add it to SVG element
m_currentNode.append_attribute(("data-" + it->second).c_str()) = (*iter).second.c_str();
}
}
} Is there method for exporting dataset parameters from MEI into SVG? Or is that function related to the previous one in the file (and for internal use only): void SvgDeviceContext::AppendIdAndClass(std::string gId, std::string baseClass, std::string addedClasses, bool primary) https://github.com/rism-digital/verovio/blob/develop/src/svgdevicecontext.cpp#L963-L989 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you want something added to |
Beta Was this translation helpful? Give feedback.
SvgDeviceContext::AppendAdditionalAttributes
is for passing--svg-additional-attribute * <s>
.See in https://book.verovio.org/toolkit-reference/toolkit-options.html?q=attribute#input-and-page-layout-options:
If you want something added to
@class
, then you can use the MEI@type
attribute. As far as I remember, that one is always added to the SVG. TheSvgDeviceContext::AppendIdAndClass
is internal.