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