@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.js
CHANGED
@@ -5213,7 +5213,7 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5213
5213
|
//行高处理
|
5214
5214
|
y += (height - props.fontSize) / 2;
|
5215
5215
|
const t = ElementUtil.createSvgText(text, {
|
5216
|
-
'font-family':
|
5216
|
+
'font-family': props.fontName,
|
5217
5217
|
'font-size': fontSize,
|
5218
5218
|
x,
|
5219
5219
|
y,
|
@@ -5221,37 +5221,41 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5221
5221
|
if (actualFontBoundingBoxAscent === undefined) {
|
5222
5222
|
t.data.attrs['dominant-baseline'] = 'hanging';
|
5223
5223
|
}
|
5224
|
-
if (
|
5225
|
-
|
5226
|
-
t.data.attrs['
|
5224
|
+
if (props.fontWeight !== 'normal' && event.mode === 'view') {
|
5225
|
+
t.data.attrs['font-weight'] = this.element.props.fontWeight;
|
5226
|
+
//t.data.attrs['filter'] = 'url(#t_bold)'
|
5227
5227
|
}
|
5228
|
-
if (
|
5229
|
-
t.data.attrs['
|
5228
|
+
if (props.fontStyle !== 'normal') {
|
5229
|
+
t.data.attrs['font-style'] = props.fontStyle;
|
5230
5230
|
}
|
5231
|
-
if (
|
5231
|
+
if (props.color) {
|
5232
|
+
t.data.attrs['fill'] = props.color;
|
5233
|
+
}
|
5234
|
+
if (props.background) {
|
5232
5235
|
const bgX = event.relativePagePos.x;
|
5233
5236
|
const bgY = event.relativePagePos.y;
|
5234
|
-
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height,
|
5237
|
+
event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, this.rect.width, this.rect.height, props.background));
|
5235
5238
|
}
|
5236
|
-
if (
|
5237
|
-
const underHeight =
|
5239
|
+
if (props.underline) {
|
5240
|
+
const underHeight = props.fontSize * 1.2;
|
5238
5241
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y + underHeight} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y + underHeight}`;
|
5239
5242
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5240
5243
|
}
|
5241
|
-
if (
|
5244
|
+
if (props.linethrough) {
|
5242
5245
|
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}`;
|
5243
5246
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5244
5247
|
}
|
5245
|
-
if (
|
5248
|
+
if (props.border) {
|
5246
5249
|
event.highlights.push(ElementUtil.getStrokeSvgPath(ElementUtil.getRectPath(event.relativePagePos.x, event.relativePagePos.y, this.rect.width, this.rect.height), '#000', 1));
|
5247
5250
|
}
|
5248
|
-
if (
|
5251
|
+
if (props.overline) {
|
5249
5252
|
const path = `M${event.relativePagePos.x} ${event.relativePagePos.y} L${event.relativePagePos.x + this.rect.width} ${event.relativePagePos.y}`;
|
5250
5253
|
event.highlights.push(ElementUtil.getStrokeSvgPath(path, '#000', 1));
|
5251
5254
|
}
|
5252
5255
|
//处理null-text
|
5253
5256
|
if (this.element.isDecorate && this.element.disableClick && !this.element.parent) ;
|
5254
|
-
if (
|
5257
|
+
if (props.fontWeight === "bold" && event.mode === 'print') {
|
5258
|
+
const blurRate = props.fontSize * 0.5 / 15;
|
5255
5259
|
const g = {
|
5256
5260
|
sel: "g",
|
5257
5261
|
data: {
|
@@ -5276,7 +5280,19 @@ class TextGroupRenderObject extends LeafRenderObject {
|
|
5276
5280
|
data: {
|
5277
5281
|
ns: "http://www.w3.org/2000/svg",
|
5278
5282
|
attrs: {
|
5279
|
-
translate: { x:
|
5283
|
+
translate: { x: blurRate, y: 0 }
|
5284
|
+
}
|
5285
|
+
},
|
5286
|
+
children: [
|
5287
|
+
{ ...t }
|
5288
|
+
]
|
5289
|
+
},
|
5290
|
+
{
|
5291
|
+
sel: "g",
|
5292
|
+
data: {
|
5293
|
+
ns: "http://www.w3.org/2000/svg",
|
5294
|
+
attrs: {
|
5295
|
+
translate: { x: 0, y: blurRate }
|
5280
5296
|
}
|
5281
5297
|
},
|
5282
5298
|
children: [
|
@@ -23448,7 +23464,7 @@ class DocEditor {
|
|
23448
23464
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
23449
23465
|
}
|
23450
23466
|
version() {
|
23451
|
-
return "2.2.
|
23467
|
+
return "2.2.36";
|
23452
23468
|
}
|
23453
23469
|
switchPageHeaderEditor() {
|
23454
23470
|
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|