import {JRBaseFactory} from "./JRBaseFactory"; import {JRFont} from "../../jasper/JRFont"; import {SchemaConstants} from "../SchemaConstants"; export abstract class JRFontFactory extends JRBaseFactory { getFont():JRFont { return null; } createObject(atts:{}):any { const font = this.getFont(); const fontName = atts[SchemaConstants.ATTRIBUTE_fontName]; if (fontName) { font.setFontName(fontName); } const fontSize = atts[SchemaConstants.ATTRIBUTE_size]; if (fontSize) { font.setFontSize(fontSize); } const isBold = atts[SchemaConstants.ATTRIBUTE_isBold]; if (isBold) { font.setBold(isBold === true); } const isItalic = atts[SchemaConstants.ATTRIBUTE_isItalic]; if (isItalic) { font.setItalic(isItalic === true); } const isUnderline = atts[SchemaConstants.ATTRIBUTE_isUnderline]; if (isUnderline) { font.setUnderline(isUnderline === true); } const isStrikeThrough = atts[SchemaConstants.ATTRIBUTE_isStrikeThrough]; if (isStrikeThrough) { font.setStrikeThrough(isStrikeThrough === true); } return font; } }