Search in sources :

Example 1 with MxlPrintStyleContent

use of com.xenoage.zong.musicxml.types.util.MxlPrintStyleContent 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();
}
Also used : MxlPrintStyleContent(com.xenoage.zong.musicxml.types.util.MxlPrintStyleContent) MxlFont(com.xenoage.zong.musicxml.types.attributes.MxlFont) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 MxlFont (com.xenoage.zong.musicxml.types.attributes.MxlFont)1 MxlPrintStyle (com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle)1 MxlPrintStyleContent (com.xenoage.zong.musicxml.types.util.MxlPrintStyleContent)1