@hailin-zheng/editor-core 2.2.34 → 2.2.36
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 +32 -16
- package/index-cjs.js.map +1 -1
- package/index.js +32 -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,41 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5250
5250
|
if (actualFontBoundingBoxAscent === undefined) {
|
5251
5251
|
t.data.attrs['dominant-baseline'] = 'hanging';
|
5252
5252
|
}
|
5253
|
-
if (
|
5254
|
-
|
5255
|
-
t.data.attrs['
|
5253
|
+
if (props.fontWeight !== 'normal' && event.mode === 'view') {
|
5254
|
+
t.data.attrs['font-weight'] = this.element.props.fontWeight;
|
5255
|
+
//t.data.attrs['filter'] = 'url(#t_bold)'
|
5256
5256
|
}
|
5257
|
-
if (
|
5258
|
-
t.data.attrs['
|
5257
|
+
if (props.fontStyle !== 'normal') {
|
5258
|
+
t.data.attrs['font-style'] = props.fontStyle;
|
5259
5259
|
}
|
5260
|
-
if (
|
5260
|
+
if (props.color) {
|
5261
|
+
t.data.attrs['fill'] = props.color;
|
5262
|
+
}
|
5263
|
+
if (props.background) {
|
5261
5264
|
const bgX = event.relativePagePos.x;
|
5262
5265
|
const bgY = event.relativePagePos.y;
|
5263
|
-
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height,
|
5266
|
+
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height, props.background));
|
5264
5267
|
}
|
5265
|
-
if (
|
5266
|
-
const underHeight =
|
5268
|
+
if (props.underline) {
|
5269
|
+
const underHeight = props.fontSize * 1.2;
|
5267
5270
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y + underHeight} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y + underHeight}`;
|
5268
5271
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5269
5272
|
}
|
5270
|
-
if (
|
5273
|
+
if (props.linethrough) {
|
5271
5274
|
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
5275
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5273
5276
|
}
|
5274
|
-
if (
|
5277
|
+
if (props.border) {
|
5275
5278
|
event.highlights.push(ElementUtil.getStrokeSvgPath(ElementUtil.getRectPath(event.relativePagePos.x, event.relativePagePos.y, this.rect.width, this.rect.height), '#000', 1));
|
5276
5279
|
}
|
5277
|
-
if (
|
5280
|
+
if (props.overline) {
|
5278
5281
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y}`;
|
5279
5282
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5280
5283
|
}
|
5281
5284
|
//处理null-text
|
5282
5285
|
if (this.element.isDecorate && this.element.disableClick && !this.element.parent) ;
|
5283
|
-
if (
|
5286
|
+
if (props.fontWeight === "bold" && event.mode === 'print') {
|
5287
|
+
const blurRate = props.fontSize * 0.5 / 15;
|
5284
5288
|
const g = {
|
5285
5289
|
sel: "g",
|
5286
5290
|
data: {
|
@@ -5305,7 +5309,19 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5305
5309
|
data: {
|
5306
5310
|
ns: "http://www.w3.org/2000/svg",
|
5307
5311
|
attrs: {
|
5308
|
-
translate: { x:
|
5312
|
+
translate: { x: blurRate, y: 0 }
|
5313
|
+
}
|
5314
|
+
},
|
5315
|
+
children: [
|
5316
|
+
{ ...t }
|
5317
|
+
]
|
5318
|
+
},
|
5319
|
+
{
|
5320
|
+
sel: "g",
|
5321
|
+
data: {
|
5322
|
+
ns: "http://www.w3.org/2000/svg",
|
5323
|
+
attrs: {
|
5324
|
+
translate: { x: 0, y: blurRate }
|
5309
5325
|
}
|
5310
5326
|
},
|
5311
5327
|
children: [
|
@@ -23477,7 +23493,7 @@ class DocEditor {
|
|
23477
23493
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
23478
23494
|
}
|
23479
23495
|
version() {
|
23480
|
-
return "2.2.
|
23496
|
+
return "2.2.36";
|
23481
23497
|
}
|
23482
23498
|
switchPageHeaderEditor() {
|
23483
23499
|
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|