2024-01-17 15:40:47 +02:00
|
|
|
import { LineSpacing, ParagraphProperty } from "./paragraph-property";
|
2024-11-22 03:58:49 +02:00
|
|
|
import {
|
|
|
|
RunProperty,
|
|
|
|
RunFonts,
|
|
|
|
createDefaultRunProperty,
|
|
|
|
} from "./run-property";
|
2020-12-14 08:01:23 +02:00
|
|
|
|
|
|
|
export class DocDefaults {
|
|
|
|
runProperty: RunProperty;
|
2024-11-22 03:58:49 +02:00
|
|
|
paragraphProperty: ParagraphProperty = new ParagraphProperty();
|
2020-12-14 08:01:23 +02:00
|
|
|
|
|
|
|
size(size: number) {
|
2024-11-22 03:58:49 +02:00
|
|
|
this.runProperty ??= createDefaultRunProperty();
|
|
|
|
this.runProperty.size(size);
|
2020-12-14 08:01:23 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
fonts(fonts: RunFonts) {
|
2024-11-22 03:58:49 +02:00
|
|
|
this.runProperty ??= createDefaultRunProperty();
|
|
|
|
this.runProperty.fonts(fonts);
|
2020-12-14 08:01:23 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2023-06-23 13:09:27 +03:00
|
|
|
characterSpacing(characterSpacing: number) {
|
2024-11-22 03:58:49 +02:00
|
|
|
this.runProperty ??= createDefaultRunProperty();
|
|
|
|
this.runProperty.spacing(characterSpacing);
|
2020-12-14 08:01:23 +02:00
|
|
|
return this;
|
|
|
|
}
|
2024-01-17 15:40:47 +02:00
|
|
|
|
|
|
|
lineSpacing(lineSpacing: LineSpacing) {
|
2024-11-22 03:58:49 +02:00
|
|
|
this.paragraphProperty.lineSpacing = lineSpacing;
|
2024-01-17 15:40:47 +02:00
|
|
|
return this;
|
|
|
|
}
|
2020-12-14 08:01:23 +02:00
|
|
|
}
|