Add language support
This commit is contained in:
@ -2,7 +2,6 @@ import { BorderElement, IBorderOptions } from "@file/border";
|
||||
import { IShadingAttributesProperties, Shading } from "@file/shading";
|
||||
import { ChangeAttributes, IChangedAttributesProperties } from "@file/track-revision/track-revision";
|
||||
import {
|
||||
BuilderElement,
|
||||
HpsMeasureElement,
|
||||
IgnoreIfEmptyXmlComponent,
|
||||
NumberValueElement,
|
||||
@ -13,6 +12,7 @@ import {
|
||||
|
||||
import { EmphasisMark, EmphasisMarkType } from "./emphasis-mark";
|
||||
import { CharacterSpacing, Color, Highlight, HighlightComplexScript } from "./formatting";
|
||||
import { createLanguageComponent, ILanguageOptions } from "./language";
|
||||
import { IFontAttributesProperties, RunFonts } from "./run-fonts";
|
||||
import { SubScript, SuperScript } from "./script";
|
||||
import { Underline, UnderlineType } from "./underline";
|
||||
@ -52,16 +52,7 @@ export interface IRunStylePropertiesOptions {
|
||||
readonly emboss?: boolean;
|
||||
readonly imprint?: boolean;
|
||||
readonly revision?: IRunPropertiesChangeOptions;
|
||||
// <xsd:complexType name="CT_Language">
|
||||
// <xsd:attribute name="val" type="s:ST_Lang" use="optional"/>
|
||||
// <xsd:attribute name="eastAsia" type="s:ST_Lang" use="optional"/>
|
||||
// <xsd:attribute name="bidi" type="s:ST_Lang" use="optional"/>
|
||||
// </xsd:complexType>
|
||||
readonly language?: {
|
||||
readonly value?: string;
|
||||
readonly eastAsia?: string;
|
||||
readonly bidirectional?: string;
|
||||
};
|
||||
readonly language?: ILanguageOptions;
|
||||
readonly border?: IBorderOptions;
|
||||
readonly vanish?: boolean;
|
||||
readonly specVanish?: boolean;
|
||||
@ -253,29 +244,7 @@ export class RunProperties extends IgnoreIfEmptyXmlComponent {
|
||||
}
|
||||
|
||||
if (options.language) {
|
||||
this.push(
|
||||
new BuilderElement<{
|
||||
readonly value: string;
|
||||
readonly eastAsia: string;
|
||||
readonly bidirectional: string;
|
||||
}>({
|
||||
name: "w:lang",
|
||||
attributes: {
|
||||
value: {
|
||||
key: "w:val",
|
||||
value: options.language.value,
|
||||
},
|
||||
eastAsia: {
|
||||
key: "w:eastAsia",
|
||||
value: options.language.eastAsia,
|
||||
},
|
||||
bidirectional: {
|
||||
key: "w:bidi",
|
||||
value: options.language.bidirectional,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
this.push(createLanguageComponent(options.language));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user