Files
docx-js/src/file/styles/defaults/run-properties.ts

26 lines
829 B
TypeScript
Raw Normal View History

2018-10-26 01:04:07 +01:00
import { Size, SizeComplexScript } from "file/paragraph/run/formatting";
import { RunProperties } from "file/paragraph/run/properties";
import { RunFonts } from "file/paragraph/run/run-fonts";
import { XmlComponent } from "file/xml-components";
2016-04-09 02:04:53 +01:00
2016-04-09 20:16:35 +01:00
export class RunPropertiesDefaults extends XmlComponent {
2018-01-29 01:55:25 +00:00
private readonly properties: RunProperties;
2016-04-09 20:16:35 +01:00
2016-04-09 02:04:53 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:rPrDefault");
this.properties = new RunProperties();
this.root.push(this.properties);
}
public size(size: number): RunPropertiesDefaults {
this.properties.push(new Size(size));
2018-08-07 02:47:24 +01:00
this.properties.push(new SizeComplexScript(size));
return this;
}
public font(fontName: string): RunPropertiesDefaults {
this.properties.push(new RunFonts(fontName));
return this;
2016-04-09 02:04:53 +01:00
}
2017-03-09 09:45:01 +01:00
}