Files
docx-js/ts/styles/defaults/run-properties.ts
Jacob Wright 190208d5df Making it easier to work with default styles
Adds the likely common styles, font and size, to be defined in defaults.
2017-09-16 08:24:15 -06:00

25 lines
736 B
TypeScript

import { RunProperties } from "../../docx/run/properties";
import { XmlComponent } from "../../docx/xml-components";
import { RunFonts } from "../../docx/run/run-fonts";
import { Size } from "../../docx/run/formatting";
export class RunPropertiesDefaults extends XmlComponent {
private properties: RunProperties;
constructor() {
super("w:rPrDefault");
this.properties = new RunProperties();
this.root.push(this.properties);
}
public size(size: number): RunPropertiesDefaults {
this.properties.push(new Size(size));
return this;
}
public font(fontName: string): RunPropertiesDefaults {
this.properties.push(new RunFonts(fontName));
return this;
}
}