Skip to main content

layout_xml

Function layout_xml 

Source
pub fn layout_xml(layout: &Layout) -> Option<String>
Available on crate feature musicxml only.
Expand description

The element music21 writes a page, system or staff layout as: <page-layout>, <system-layout> or <staff-layout>, as pageLayoutToXmlPageLayout and its neighbours write them. None for a score layout, which is written as the parts of <defaults>.

use music21::layout::{Layout, StaffLayout};
use music21::musicxml::layout_xml;

let written = layout_xml(&Layout::Staff(StaffLayout::default()));
assert_eq!(written.as_deref(), Some("<staff-layout />"));