feat: 汉字每日打卡页面优化

This commit is contained in:
R524809
2026-05-22 11:00:04 +08:00
parent 41082f59ef
commit bcece55238
7 changed files with 95 additions and 27 deletions
+24 -1
View File
@@ -113,10 +113,11 @@ export class BaseDrawService {
}
/**
* 暂未使用
* 页脚:顶部分割线 + 居中 `doodle-footer.png`(小鸭与「涂鸦丫」品牌图)。
* 图片底边与纸张底边留白对齐,便于「探头」视觉。请在整页正文绘制完成后调用,避免被内容覆盖。
*/
async drawPrintFooter(): Promise<void> {
async drawPrintImageFooter(): Promise<void> {
const { ctx, canvasWidth, canvasHeight } = this;
const margin = 24;
const bottomMargin = 2;
@@ -172,6 +173,28 @@ export class BaseDrawService {
}
}
/**
* 页脚:页面底部居中绘制品牌文案「涂鸦丫小程序」(粗体)。
* 请在整页正文绘制完成后调用,避免被内容覆盖。
*/
async drawPrintFooter(): Promise<void> {
const { ctx, canvasWidth, canvasHeight } = this;
const text = '涂鸦丫小程序';
const bottomMargin = 12;
const fontSize = 13;
const font = `bold ${fontSize}px "Microsoft Yahei", sans-serif`;
const textColor = '#7C766A';
ctx.save();
ctx.font = font;
ctx.fillStyle = textColor;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
const y = canvasHeight - bottomMargin - fontSize / 2;
ctx.fillText(text, canvasWidth / 2, y);
ctx.restore();
}
/**
* 绘制分割线(逻辑像素,尺寸除以3)
*/