Making it easier to work with default styles

Adds the likely common styles, font and size, to be defined in defaults.
This commit is contained in:
Jacob Wright
2017-09-16 08:24:15 -06:00
parent 32cda4dfb3
commit 190208d5df
3 changed files with 24 additions and 7 deletions

View File

@ -1,10 +1,24 @@
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.root.push(new RunProperties());
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;
}
}