move run-fonts to docx/run and add a test

This commit is contained in:
felipe
2017-03-08 19:48:32 +01:00
parent a454ff9643
commit 237be76d33
3 changed files with 26 additions and 4 deletions

30
ts/docx/run/run-fonts.ts Normal file
View File

@ -0,0 +1,30 @@
import {XmlAttributeComponent, XmlComponent} from "../xml-components";
interface IRunFontAttributesProperties {
ascii: string;
hAnsi: string;
hint?: string;
}
class RunFontAttributes extends XmlAttributeComponent {
constructor(properties: IRunFontAttributesProperties) {
super({
ascii: "w:ascii",
hAnsi: "w:hAnsi",
hint: "w:hint",
}, properties);
}
}
export class RunFonts extends XmlComponent {
constructor(ascii: string, hint?: string) {
super("w:rFonts");
this.root.push(new RunFontAttributes({
ascii: ascii,
hAnsi: ascii,
hint: hint,
}));
}
}