UNPKG

svg-engine

Version:
44 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Font = void 0; const SVGInstance_js_1 = require("../../../node/instance/SVGInstance.js"); class Font extends SVGInstance_js_1.SVGInstance { fontFamily(fontFamily) { if (typeof fontFamily === "undefined") { const fontFamily = this.attr("font-family"); return typeof fontFamily === "string" ? fontFamily : null; } else if (typeof fontFamily === "string") { this.attr("font-family", fontFamily); return this; } return null; } fontSize(fontSize) { if (typeof fontSize === "string" || typeof fontSize === "number") { this.attr("font-size", fontSize); return this; } return this.attr("font-size"); } fontStyle(fontStyle) { if (typeof fontStyle === "undefined") { const fontStyle = this.attr("font-style"); return typeof fontStyle === "string" ? fontStyle : null; } else if (typeof fontStyle === "string") { this.attr("font-style", fontStyle); return this; } return null; } fontWeight(fontWeight) { if (typeof fontWeight === "string" || typeof fontWeight === "number") { this.attr("font-weight", fontWeight); return this; } return this.attr("font-weight"); } } exports.Font = Font; //# sourceMappingURL=font.js.map