use of com.xenoage.zong.musicxml.types.attributes.MxlFont in project Zong by Xenoage.
the class MxlDefaults method read.
@MaybeNull
public static MxlDefaults read(XmlReader reader) {
MxlScaling scaling = null;
MxlLayout layout = new MxlLayout();
MxlFont wordFont = null;
MxlLyricFont lyricFont = null;
while (reader.openNextChildElement()) {
String n = reader.getElementName();
if (n.equals(MxlScaling.elemName))
scaling = MxlScaling.read(reader);
else if (n.equals("word-font"))
wordFont = MxlFont.read(reader);
else if (// read only first
n.equals(MxlLyricFont.elemName) && lyricFont == null)
lyricFont = MxlLyricFont.read(reader);
else
layout.readElement(reader);
reader.closeElement();
}
if (false == layout.isUsed())
layout = null;
if (scaling != null || layout != null || wordFont != null || lyricFont != null)
return new MxlDefaults(scaling, layout, wordFont, lyricFont);
else
return null;
}
use of com.xenoage.zong.musicxml.types.attributes.MxlFont in project Zong by Xenoage.
the class MxlLyricFont method read.
@MaybeNull
public static MxlLyricFont read(XmlReader reader) {
String number = reader.getAttribute("number");
String name = reader.getAttribute("name");
MxlFont font = MxlFont.read(reader);
if (number != null || name != null || font != null)
return new MxlLyricFont(number, name, font);
else
return null;
}
use of com.xenoage.zong.musicxml.types.attributes.MxlFont in project Zong by Xenoage.
the class FontInfoReader method read.
/**
* Reads the font from the given element, if it is a {@link MxlPrintStyleContent} element
* and contains font information. The returned font is based on the given default font.
*/
@MaybeNull
public static FontInfo read(Object printStyleElement, FontInfo defaultFont) {
if (false == printStyleElement instanceof MxlPrintStyleContent)
return null;
MxlPrintStyle mxlPrintStyle = ((MxlPrintStyleContent) printStyleElement).getPrintStyle();
MxlFont mxlFont = mxlPrintStyle.getFont();
return new FontInfoReader(mxlFont, defaultFont).read();
}
Aggregations