Files
docx-js/src/file/paragraph/run/run-fonts.ts

35 lines
882 B
TypeScript
Raw Normal View History

import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2016-05-21 00:02:46 +01:00
interface IRunFontAttributesProperties {
readonly ascii: string;
readonly cs: string;
readonly eastAsia: string;
readonly hAnsi: string;
readonly hint?: string;
2016-05-21 00:02:46 +01:00
}
class RunFontAttributes extends XmlAttributeComponent<IRunFontAttributesProperties> {
protected readonly xmlKeys = {
ascii: "w:ascii",
2018-07-24 12:24:26 +08:00
cs: "w:cs",
eastAsia: "w:eastAsia",
hAnsi: "w:hAnsi",
hint: "w:hint",
};
2016-05-21 00:02:46 +01:00
}
export class RunFonts extends XmlComponent {
constructor(ascii: string, hint?: string) {
super("w:rFonts");
2018-01-23 01:33:12 +00:00
this.root.push(
new RunFontAttributes({
ascii: ascii,
2018-07-24 12:24:26 +08:00
cs: ascii,
eastAsia: ascii,
2018-01-23 01:33:12 +00:00
hAnsi: ascii,
hint: hint,
}),
);
2016-05-21 00:02:46 +01:00
}
}