@@ -691,12 +691,6 @@ std::string MusicXmlInput::GetWordsOrDynamicsText(const pugi::xml_node node) con
691691 }
692692 return dynamStr;
693693 }
694- if (IsElement (node, " coda" )) {
695- return " \xF0\x9D\x84\x8C " ;
696- }
697- if (IsElement (node, " segno" )) {
698- return " \xF0\x9D\x84\x8B " ;
699- }
700694 return std::string ();
701695}
702696
@@ -708,12 +702,29 @@ void MusicXmlInput::TextRendition(const pugi::xpath_node_set words, ControlEleme
708702 std::string textStr = GetWordsOrDynamicsText (textNode);
709703 std::string textColor = textNode.attribute (" color" ).as_string ();
710704 Object *textParent = element;
711- if (textNode.attribute (" xml:lang" ) || textNode.attribute (" xml:space" ) || textNode.attribute (" color" )
705+ if (!std::strncmp (textNode.name (), " symbol" , 6 )) {
706+ Symbol *symbol = new Symbol ();
707+ symbol->SetGlyphAuth (" smufl" );
708+ symbol->SetColor (textColor);
709+ symbol->SetGlyphName (textNode.text ().as_string ());
710+ element->AddChild (symbol);
711+ continue ;
712+ }
713+ else if (!std::strncmp (textNode.name (), " coda" , 4 ) || !std::strncmp (textNode.name (), " segno" , 5 )) {
714+ // for cases we have coda/segno and text in one direction
715+ Symbol *symbol = new Symbol ();
716+ symbol->SetGlyphAuth (" smufl" );
717+ symbol->SetColor (textColor);
718+ symbol->SetGlyphName (textNode.name ());
719+ element->AddChild (symbol);
720+ continue ;
721+ }
722+ else if (textNode.attribute (" xml:lang" ) || textNode.attribute (" xml:space" ) || textNode.attribute (" color" )
712723 || textNode.attribute (" halign" ) || textNode.attribute (" font-family" ) || textNode.attribute (" font-style" )
713724 || textNode.attribute (" font-weight" ) || textNode.attribute (" enclosure" )) {
714725 Rend *rend = new Rend ();
715726 rend->SetLang (textNode.attribute (" xml:lang" ).as_string ());
716- rend->SetColor (textNode. attribute ( " color " ). as_string () );
727+ rend->SetColor (textColor );
717728 rend->SetHalign (
718729 rend->AttHorizontalAlign ::StrToHorizontalalignment (textNode.attribute (" halign" ).as_string ()));
719730 rend->SetSpace (textNode.attribute (" xml:space" ).as_string ());
@@ -2362,7 +2373,8 @@ void MusicXmlInput::ReadMusicXmlDirection(
23622373 // Directive
23632374 int defaultY = 0 ; // y position attribute, only for directives and dynamics
23642375 if (containsWords && !containsTempo && !containsDynamics) {
2365- pugi::xpath_node_set words = node.select_nodes (" direction-type/*[self::words or self::coda or self::segno]" );
2376+ pugi::xpath_node_set words
2377+ = node.select_nodes (" direction-type/*[self::words or self::symbol or self::coda or self::segno]" );
23662378 defaultY = words.first ().node ().attribute (" default-y" ).as_int ();
23672379 defaultY = (defaultY * 10 ) + words.first ().node ().attribute (" relative-y" ).as_int ();
23682380 std::string wordStr = words.first ().node ().text ().as_string ();
0 commit comments