added #color and #size methods to Run

This commit is contained in:
felipe
2017-03-12 17:31:36 +01:00
parent d85c6ce56a
commit 3dbd917667
2 changed files with 35 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import { Break } from "./break";
import { Caps, SmallCaps } from "./caps";
import { Bold, Italics } from "./formatting";
import { Bold, Color, Italics, Size } from "./formatting";
import { RunProperties } from "./properties";
import { RunFonts } from "./run-fonts";
import { SubScript, SuperScript } from "./script";
@ -34,6 +34,16 @@ export class Run extends XmlComponent {
return this;
}
public color(color: string): Run {
this.properties.push(new Color(color));
return this;
}
public size(size: number): Run {
this.properties.push(new Size(size));
return this;
}
public break(): Run {
this.root.splice(1, 0, new Break());
return this;