#[cfg(not(feature = "svg"))]
fn main() {
println!("To run this example, invoke cargo with --features \"svg\".");
}
#[cfg(feature = "svg")]
fn main() {
use skia_safe::{
svg::{Dom, Length, LengthUnit},
Color, FontMgr,
};
let data = r#"
"#;
let dom = Dom::from_bytes(data.as_bytes(), FontMgr::default()).unwrap();
let mut root = dom.root();
println!("{:?}", root.intrinsic_size());
root.set_color(Color::RED);
root.set_opacity(0.5);
root.set_width(Length::new(50., LengthUnit::PX));
root.set_height(Length::new(600., LengthUnit::CM));
println!("{:?}", root.intrinsic_size());
let children = root.children_typed();
println!("{children:#?}");
// new lines (and spaces after them) are represented by the parser as TextLiteral
// text literal, , text literal, and text literal
assert_eq!(children.len(), 5);
}