:feat: support emphasis mark

This commit is contained in:
wangfengming
2020-05-22 12:22:45 +08:00
parent 2654799822
commit 120c3a7bbe
15 changed files with 371 additions and 15 deletions

View File

@ -1,3 +1,4 @@
import { EmphasisMarkType } from "file/paragraph/run/emphasis-mark";
import * as formatting from "file/paragraph/run/formatting";
import { RunProperties } from "file/paragraph/run/properties";
import { UnderlineType } from "file/paragraph/run/underline";
@ -23,6 +24,9 @@ export interface IBaseCharacterStyleOptions {
readonly type?: UnderlineType;
readonly color?: string;
};
readonly emphasisMark?: {
readonly type?: EmphasisMarkType;
};
readonly color?: string;
readonly font?: string;
readonly characterSpacing?: number;
@ -104,6 +108,10 @@ export class CharacterStyle extends Style {
this.runProperties.push(new formatting.Underline(options.run.underline.type, options.run.underline.color));
}
if (options.run.emphasisMark) {
this.runProperties.push(new formatting.EmphasisMark(options.run.emphasisMark.type));
}
if (options.run.color) {
this.runProperties.push(new formatting.Color(options.run.color));
}