|
|
@@ -1034,7 +1034,7 @@ export class CanvasPhotoEditor {
|
|
|
ctx.fillStyle = '#8C8C8C';
|
|
|
let textX = layout.width //textWidth > (this.rqWidth / 2) ? drawX : drawX + (textWidth / 2)
|
|
|
// ctx.fillText(text, jxx + textWidth + (layout.width / 2), itemY + layout.height + 30, layout.width);
|
|
|
- this.drawCenteredTextWithEllipsis(ctx, text, jxx + (this.rqWidth / 2), itemY + layout.height + 40, 24, 2, '16px Microsoft Yahei')
|
|
|
+ this.drawCenteredTextWithEllipsis(ctx, text, jxx + (this.rqWidth / 2), itemY + layout.height + 40, 24, 2)
|
|
|
ctx.fillStyle = 'rgba(0, 0, 0, 1)'; // 半透明黑色背景
|
|
|
ctx.setLineDash([1, 1]);
|
|
|
ctx.strokeRect(
|
|
|
@@ -1398,7 +1398,7 @@ resizePageAndReflow(pages, pageIndex, itemValue) {
|
|
|
* @param {number} maxLines - 最大显示行数(超出显示省略号)
|
|
|
* @param {string} font - 字体样式(如 '16px Microsoft Yahei')
|
|
|
*/
|
|
|
- drawCenteredTextWithEllipsis(ctx, text, x, y, lineHeight, maxLines, font = '16pt 仿宋_GB2312') {
|
|
|
+ drawCenteredTextWithEllipsis(ctx, text, x, y, lineHeight, maxLines, font = '16px "FangSong_GB2312"') {
|
|
|
// 1. 设置字体样式(必须先设置,否则measureText计算不准确)
|
|
|
let maxWidth = this.rqWidth - 20
|
|
|
ctx.font = font;
|
|
|
@@ -1623,7 +1623,7 @@ resizePageAndReflow(pages, pageIndex, itemValue) {
|
|
|
ctx, text,
|
|
|
coord.x + coord.width / 2,
|
|
|
coord.y + coord.height + 40,
|
|
|
- 24, 2, "14pt 宋体"
|
|
|
+ 24, 2
|
|
|
);
|
|
|
|
|
|
// 虚线框
|
|
|
@@ -1793,7 +1793,7 @@ resizePageAndReflow(pages, pageIndex, itemValue) {
|
|
|
ctx, text,
|
|
|
coord.x + coord.width / 2,
|
|
|
coord.y + coord.height + 40,
|
|
|
- 24, 2, "14pt 宋体"
|
|
|
+ 24, 2
|
|
|
);
|
|
|
|
|
|
// ctx.setLineDash([1, 1]);
|