use of com.xenoage.zong.musicxml.types.enums.MxlFontStyle in project Zong by Xenoage.
the class MxlFont method read.
public static MxlFont read(XmlReader reader) {
List<String> fontFamily = alist();
String fontFamilies = reader.getAttribute("font-family");
if (fontFamilies != null) {
for (String s : fontFamilies.split(",")) {
fontFamily.add(s.trim());
}
}
MxlFontStyle fontStyle = MxlFontStyle.read(reader);
MxlFontSize fontSize = MxlFontSize.read(reader);
MxlFontWeight fontWeight = MxlFontWeight.read(reader);
if (fontFamily.size() > 0 || fontStyle != MxlFontStyle.Unknown || fontSize != MxlFontSize.noFontSize || fontWeight != MxlFontWeight.Unknown)
return new MxlFont(fontFamily, fontStyle, fontSize, fontWeight);
else
return noFont;
}
use of com.xenoage.zong.musicxml.types.enums.MxlFontStyle in project Zong by Xenoage.
the class FontInfoReader method readStyle.
private FontStyle readStyle() {
FontStyle style = defaultFont.getStyleOrNull();
// font style
MxlFontStyle mxlStyle = mxlFont.getFontStyle();
if (mxlStyle != MxlFontStyle.Unknown) {
boolean isItalic = mxlStyle == MxlFontStyle.Italic;
style = style.with(FontStyle.Italic, isItalic);
}
// font weight
MxlFontWeight mxlWeight = mxlFont.getFontWeight();
if (mxlWeight != null) {
boolean isBold = mxlWeight == MxlFontWeight.Bold;
style = style.with(FontStyle.Bold, isBold);
}
return style;
}
Aggregations