Files
docx-js/src/file/styles/defaults/run-properties.ts
amitm02 696b5daf5c rtl
2018-07-25 15:02:58 +03:00

26 lines
810 B
TypeScript

import { XmlComponent } from "file/xml-components";
import { Size, SizeCs } from "../../paragraph/run/formatting";
import { RunProperties } from "../../paragraph/run/properties";
import { RunFonts } from "../../paragraph/run/run-fonts";
export class RunPropertiesDefaults extends XmlComponent {
private readonly 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));
this.properties.push(new SizeCs(size));
return this;
}
public font(fontName: string): RunPropertiesDefaults {
this.properties.push(new RunFonts(fontName));
return this;
}
}