@hailin-zheng/editor-core 2.2.34 → 2.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index-cjs.js +29 -16
- package/index-cjs.js.map +1 -1
- package/index.js +29 -16
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index-cjs.js
CHANGED
@@ -5242,7 +5242,7 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5242
5242
|
//行高处理
|
5243
5243
|
y += (height - props.fontSize) / 2;
|
5244
5244
|
const t = ElementUtil.createSvgText(text, {
|
5245
|
-
'font-family':
|
5245
|
+
'font-family': props.fontName,
|
5246
5246
|
'font-size': fontSize,
|
5247
5247
|
x,
|
5248
5248
|
y,
|
@@ -5250,37 +5250,38 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5250
5250
|
if (actualFontBoundingBoxAscent === undefined) {
|
5251
5251
|
t.data.attrs['dominant-baseline'] = 'hanging';
|
5252
5252
|
}
|
5253
|
-
if (
|
5254
|
-
if (
|
5255
|
-
t.data.attrs['font-style'] =
|
5253
|
+
if (props.fontWeight !== 'normal') ;
|
5254
|
+
if (props.fontStyle !== 'normal') {
|
5255
|
+
t.data.attrs['font-style'] = props.fontStyle;
|
5256
5256
|
}
|
5257
|
-
if (
|
5258
|
-
t.data.attrs['fill'] =
|
5257
|
+
if (props.color) {
|
5258
|
+
t.data.attrs['fill'] = props.color;
|
5259
5259
|
}
|
5260
|
-
if (
|
5260
|
+
if (props.background) {
|
5261
5261
|
const bgX = event.relativePagePos.x;
|
5262
5262
|
const bgY = event.relativePagePos.y;
|
5263
|
-
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height,
|
5263
|
+
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height, props.background));
|
5264
5264
|
}
|
5265
|
-
if (
|
5266
|
-
const underHeight =
|
5265
|
+
if (props.underline) {
|
5266
|
+
const underHeight = props.fontSize * 1.2;
|
5267
5267
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y + underHeight} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y + underHeight}`;
|
5268
5268
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5269
5269
|
}
|
5270
|
-
if (
|
5270
|
+
if (props.linethrough) {
|
5271
5271
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y + this.rect.height / 2} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y + this.rect.height / 2}`;
|
5272
5272
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5273
5273
|
}
|
5274
|
-
if (
|
5274
|
+
if (props.border) {
|
5275
5275
|
event.highlights.push(ElementUtil.getStrokeSvgPath(ElementUtil.getRectPath(event.relativePagePos.x, event.relativePagePos.y, this.rect.width, this.rect.height), '#000', 1));
|
5276
5276
|
}
|
5277
|
-
if (
|
5277
|
+
if (props.overline) {
|
5278
5278
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y}`;
|
5279
5279
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5280
5280
|
}
|
5281
5281
|
//处理null-text
|
5282
5282
|
if (this.element.isDecorate && this.element.disableClick && !this.element.parent) ;
|
5283
|
-
if (
|
5283
|
+
if (props.fontWeight === "bold") {
|
5284
|
+
const blurRate = props.fontSize * 0.5 / 15;
|
5284
5285
|
const g = {
|
5285
5286
|
sel: "g",
|
5286
5287
|
data: {
|
@@ -5305,7 +5306,19 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5305
5306
|
data: {
|
5306
5307
|
ns: "http://www.w3.org/2000/svg",
|
5307
5308
|
attrs: {
|
5308
|
-
translate: { x:
|
5309
|
+
translate: { x: blurRate, y: 0 }
|
5310
|
+
}
|
5311
|
+
},
|
5312
|
+
children: [
|
5313
|
+
{ ...t }
|
5314
|
+
]
|
5315
|
+
},
|
5316
|
+
{
|
5317
|
+
sel: "g",
|
5318
|
+
data: {
|
5319
|
+
ns: "http://www.w3.org/2000/svg",
|
5320
|
+
attrs: {
|
5321
|
+
translate: { x: 0, y: blurRate }
|
5309
5322
|
}
|
5310
5323
|
},
|
5311
5324
|
children: [
|
@@ -23477,7 +23490,7 @@ class DocEditor {
|
|
23477
23490
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
23478
23491
|
}
|
23479
23492
|
version() {
|
23480
|
-
return "2.2.
|
23493
|
+
return "2.2.35";
|
23481
23494
|
}
|
23482
23495
|
switchPageHeaderEditor() {
|
23483
23496
|
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|