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

26 lines
810 B
TypeScript
Raw Normal View History

import { XmlComponent } from "file/xml-components";
2018-07-25 15:02:58 +03:00
import { Size, SizeCs } from "../../paragraph/run/formatting";
2017-12-20 00:52:41 +00:00
import { RunProperties } from "../../paragraph/run/properties";
import { RunFonts } from "../../paragraph/run/run-fonts";
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-07-25 15:02:58 +03:00
this.properties.push(new SizeCs(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
}