mirror of
https://github.com/tbluemel/rtf.js.git
synced 2026-11-30 16:47:59 +01:00
Constant, build, regen test
This commit is contained in:
+19
@@ -5565,6 +5565,11 @@ var Helper = /** @class */ (function () {
|
||||
HIGHANSI: "hich",
|
||||
DOUBLE: "dbch",
|
||||
};
|
||||
Helper.SUPERSUBSCRIPT = {
|
||||
SUPERSCRIPT: 1,
|
||||
NONE: 0,
|
||||
SUBSCRIPT: -1,
|
||||
};
|
||||
Helper._A = "A".charCodeAt(0);
|
||||
Helper._a = "a".charCodeAt(0);
|
||||
Helper._F = "F".charCodeAt(0);
|
||||
@@ -5688,6 +5693,7 @@ var Chp = /** @class */ (function () {
|
||||
this.highlightindex = parent.highlightindex;
|
||||
this.fontsize = parent.fontsize;
|
||||
this.fontfamily = parent.fontfamily;
|
||||
this.supersubscript = parent.supersubscript;
|
||||
}
|
||||
else {
|
||||
this.bold = false;
|
||||
@@ -5698,6 +5704,7 @@ var Chp = /** @class */ (function () {
|
||||
this.colorindex = 0;
|
||||
this.highlightindex = 0;
|
||||
this.fontsize = 24;
|
||||
this.supersubscript = _Helper__WEBPACK_IMPORTED_MODULE_0__.Helper.SUPERSUBSCRIPT.NONE;
|
||||
}
|
||||
}
|
||||
return Chp;
|
||||
@@ -7945,6 +7952,9 @@ var RtfDestination = /** @class */ (function (_super) {
|
||||
},
|
||||
b: _this._genericFormatOnOff("chp", "bold"),
|
||||
i: _this._genericFormatOnOff("chp", "italic"),
|
||||
sub: _this._genericFormatSetVal("chp", "supersubscript", -1),
|
||||
super: _this._genericFormatSetVal("chp", "supersubscript", 1),
|
||||
nosupersub: _this._genericFormatSetVal("chp", "supersubscript", 0),
|
||||
cf: _this._genericFormatSetValRequired("chp", "colorindex"),
|
||||
highlight: _this._genericFormatSetValRequired("chp", "highlightindex"),
|
||||
fs: _this._genericFormatSetValRequired("chp", "fontsize"),
|
||||
@@ -8357,6 +8367,15 @@ var RenderChp = /** @class */ (function () {
|
||||
}
|
||||
}
|
||||
el.style.fontSize = Math.floor(this._chp.fontsize / 2) + "pt";
|
||||
if (this._chp.supersubscript === _Helper__WEBPACK_IMPORTED_MODULE_0__.Helper.SUPERSUBSCRIPT.SUPERSCRIPT) {
|
||||
el.style.verticalAlign = "super";
|
||||
}
|
||||
else if (this._chp.supersubscript === _Helper__WEBPACK_IMPORTED_MODULE_0__.Helper.SUPERSUBSCRIPT.SUBSCRIPT) {
|
||||
el.style.verticalAlign = "sub";
|
||||
}
|
||||
if (this._chp.supersubscript === _Helper__WEBPACK_IMPORTED_MODULE_0__.Helper.SUPERSUBSCRIPT.SUPERSCRIPT || this._chp.supersubscript === _Helper__WEBPACK_IMPORTED_MODULE_0__.Helper.SUPERSUBSCRIPT.SUBSCRIPT) {
|
||||
el.style.fontSize = Math.floor((this._chp.fontsize / 2) - 2) + "pt";
|
||||
}
|
||||
};
|
||||
return RenderChp;
|
||||
}());
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -90,6 +90,11 @@ export class Helper {
|
||||
HIGHANSI: "hich",
|
||||
DOUBLE: "dbch",
|
||||
};
|
||||
public static SUPERSUBSCRIPT = {
|
||||
SUPERSCRIPT: 1,
|
||||
NONE: 0,
|
||||
SUBSCRIPT: -1,
|
||||
};
|
||||
|
||||
public static log(message: string): void {
|
||||
if (isLoggingEnabled) {
|
||||
|
||||
@@ -51,7 +51,7 @@ export class Chp {
|
||||
this.highlightindex = parent.highlightindex;
|
||||
this.fontsize = parent.fontsize;
|
||||
this.fontfamily = parent.fontfamily;
|
||||
this.supersubscript = parent.supersubscript
|
||||
this.supersubscript = parent.supersubscript;
|
||||
} else {
|
||||
this.bold = false;
|
||||
this.underline = Helper.UNDERLINE.NONE;
|
||||
@@ -61,7 +61,7 @@ export class Chp {
|
||||
this.colorindex = 0;
|
||||
this.highlightindex = 0;
|
||||
this.fontsize = 24;
|
||||
this.supersubscript = 0;
|
||||
this.supersubscript = Helper.SUPERSUBSCRIPT.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,13 +76,13 @@ export class RenderChp {
|
||||
}
|
||||
el.style.fontSize = Math.floor(this._chp.fontsize / 2) + "pt";
|
||||
|
||||
if (this._chp.supersubscript === 1) {
|
||||
if (this._chp.supersubscript === Helper.SUPERSUBSCRIPT.SUPERSCRIPT) {
|
||||
el.style.verticalAlign = "super"
|
||||
} else if (this._chp.supersubscript === -1) {
|
||||
} else if (this._chp.supersubscript === Helper.SUPERSUBSCRIPT.SUBSCRIPT) {
|
||||
el.style.verticalAlign = "sub"
|
||||
}
|
||||
|
||||
if (this._chp.supersubscript === 1 || this._chp.supersubscript === -1) {
|
||||
if (this._chp.supersubscript === Helper.SUPERSUBSCRIPT.SUPERSCRIPT || this._chp.supersubscript === Helper.SUPERSUBSCRIPT.SUBSCRIPT) {
|
||||
el.style.fontSize = Math.floor((this._chp.fontsize / 2) - 2) + "pt"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<div style="min-height: 12pt; text-align: left;">
|
||||
<span style="font-family: Helvetica; font-size: 12pt;">Normal
|
||||
</span>
|
||||
<span style="font-family: Helvetica; vertical-align: super; font-size: 10pt;">
|
||||
super
|
||||
</span>
|
||||
<span style="font-family: Helvetica; vertical-align: sub; font-size: 10pt;">
|
||||
sub
|
||||
</span>
|
||||
<span style="font-family: Helvetica; font-size: 12pt;"> and normal once again.
|
||||
</span>
|
||||
</div>
|
||||
<span style="font-family: Helvetica; font-size: 12pt;">Normal
|
||||
</span>
|
||||
<span style="font-family: Helvetica; font-size: 10pt; vertical-align: super;">super
|
||||
</span>
|
||||
<span style="font-family: Helvetica; font-size: 10pt; vertical-align: sub;">sub
|
||||
</span>
|
||||
<span style="font-family: Helvetica; font-size: 12pt;"> and normal once again.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user