move run-fonts to docx/run and add a test
This commit is contained in:
30
ts/docx/run/run-fonts.ts
Normal file
30
ts/docx/run/run-fonts.ts
Normal 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,
|
||||
}));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user