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

220 lines
4.4 KiB
TypeScript
Raw Normal View History

import { Attributes, XmlComponent } from "file/xml-components";
2020-05-22 12:22:45 +08:00
2017-03-09 22:56:08 +00:00
export { Underline } from "./underline";
2020-05-22 12:22:45 +08:00
export { EmphasisMark } from "./emphasis-mark";
export { SubScript, SuperScript } from "./script";
2020-06-07 12:38:03 +08:00
export { RunFonts, IFontAttributesProperties } from "./run-fonts";
2016-03-30 04:30:58 +01:00
2016-04-09 20:16:35 +01:00
export class Bold extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:b");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
}
export class BoldComplexScript extends XmlComponent {
constructor() {
super("w:bCs");
this.root.push(
new Attributes({
val: true,
}),
);
}
}
2018-09-19 18:41:55 -03:00
export class CharacterSpacing extends XmlComponent {
constructor(value: number) {
super("w:spacing");
this.root.push(
new Attributes({
val: value,
}),
);
}
}
2016-04-09 20:16:35 +01:00
export class Italics extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:i");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
}
export class ItalicsComplexScript extends XmlComponent {
constructor() {
super("w:iCs");
this.root.push(
new Attributes({
val: true,
}),
);
}
}
2016-05-07 20:17:18 +01:00
export class Caps extends XmlComponent {
2016-03-30 04:30:58 +01:00
constructor() {
2016-05-07 20:40:18 +01:00
super("w:caps");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Color extends XmlComponent {
constructor(color: string) {
super("w:color");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: color,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class DoubleStrike extends XmlComponent {
constructor() {
super("w:dstrike");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Emboss extends XmlComponent {
constructor() {
super("w:emboss");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Imprint extends XmlComponent {
constructor() {
super("w:imprint");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class SmallCaps extends XmlComponent {
constructor() {
super("w:smallCaps");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-05-07 20:40:18 +01:00
}
}
export class Strike extends XmlComponent {
constructor() {
super("w:strike");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: true,
}),
);
2016-03-30 04:30:58 +01:00
}
2016-05-07 20:40:18 +01:00
}
export class Size extends XmlComponent {
constructor(size: number) {
super("w:sz");
2018-01-23 01:33:12 +00:00
this.root.push(
new Attributes({
val: size,
}),
);
2016-05-07 20:40:18 +01:00
}
2017-03-08 20:32:30 +00:00
}
2018-07-24 18:52:45 +03:00
2018-08-07 02:47:24 +01:00
export class SizeComplexScript extends XmlComponent {
2018-07-25 15:02:58 +03:00
constructor(size: number) {
super("w:szCs");
this.root.push(
new Attributes({
val: size,
}),
);
}
}
2018-08-07 02:47:24 +01:00
export class RightToLeft extends XmlComponent {
2018-07-24 18:52:45 +03:00
constructor() {
super("w:rtl");
this.root.push(
new Attributes({
val: true,
}),
);
}
2018-07-25 15:02:58 +03:00
}
2019-08-05 13:42:45 +03:00
export class Highlight extends XmlComponent {
constructor(color: string) {
super("w:highlight");
this.root.push(
new Attributes({
val: color,
}),
);
}
}
export class HighlightComplexScript extends XmlComponent {
constructor(color: string) {
super("w:highlightCs");
this.root.push(
new Attributes({
val: color,
}),
);
}
}
2019-08-06 23:08:21 +01:00
export class Shading extends XmlComponent {
2019-08-05 13:42:45 +03:00
constructor(value: string, fill: string, color: string) {
super("w:shd");
this.root.push(
new Attributes({
val: value,
fill: fill,
color: color,
}),
);
}
}
export class ShadowComplexScript extends XmlComponent {
constructor(value: string, fill: string, color: string) {
super("w:shdCs");
this.root.push(
new Attributes({
val: value,
fill: fill,
color: color,
}),
);
}
}