feat: 拼音字母选择
This commit is contained in:
@@ -3,7 +3,7 @@ import type {
|
||||
LetterTracingData,
|
||||
TracingRow,
|
||||
} from '../generators/letter-tracing-generator';
|
||||
import { fontFamilyOf } from '../../shared/data/fontProfiles';
|
||||
import { fontFamilyOf } from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
@@ -11,8 +11,10 @@ import {
|
||||
FOUR_LINE_GRID_H,
|
||||
type LetterFontSizes,
|
||||
} from '../../shared/draw/drawTools';
|
||||
const COLOR_BLACK = '#1a1a1a';
|
||||
const COLOR_LIGHT_RED = '#FF8E8E';
|
||||
import { TRACING_COLORS } from '../../../core/data/tracingStyles';
|
||||
|
||||
const COLOR_BLACK = TRACING_COLORS.strong;
|
||||
const COLOR_LIGHT_RED = TRACING_COLORS.guide;
|
||||
|
||||
/** 左右大写/小写两栏之间的间距(相对行宽 + 下限,避免过窄屏过小) */
|
||||
const COLUMN_GUTTER_RATIO = 0.02;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
PRINT_CLEARLY_DASHED,
|
||||
PRINT_CLEARLY_REGULAR,
|
||||
fontFamilyOf,
|
||||
} from '../../shared/data/fontProfiles';
|
||||
} from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawClosedFourLineGrid,
|
||||
@@ -53,15 +53,13 @@ const GRID_COL_GAP = 6;
|
||||
// 格子行间距(px)
|
||||
const GRID_ROW_GAP = 8;
|
||||
|
||||
// 网格描边主色
|
||||
const GRID_BORDER = '#9AA9A2';
|
||||
// 网格中间线虚线颜色
|
||||
const GRID_MIDDLE = 'rgba(154, 169, 162, 0.65)';
|
||||
import { GRID_COLORS, TRACING_COLORS } from '../../../core/data/tracingStyles';
|
||||
|
||||
// 黑色文本主色
|
||||
const COLOR_BLACK = '#1a1a1a';
|
||||
// 数据红色(例:未签到状态)
|
||||
const COLOR_LIGHT_RED = '#FF8E8E';
|
||||
const GRID_BORDER = GRID_COLORS.border;
|
||||
const GRID_MIDDLE = GRID_COLORS.middleLine;
|
||||
|
||||
const COLOR_BLACK = TRACING_COLORS.strong;
|
||||
const COLOR_LIGHT_RED = TRACING_COLORS.guide;
|
||||
|
||||
export default class DailyCheckinDraw extends BaseDrawService {
|
||||
async draw(data: DailyCheckinData) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
import {
|
||||
fontFamilyOf,
|
||||
PRINT_CLEARLY_DASHED,
|
||||
} from '../../shared/data/fontProfiles';
|
||||
} from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
fontFamilyOf,
|
||||
PRINT_CLEARLY_BOLD,
|
||||
PRINT_CLEARLY_DASHED,
|
||||
} from '../../shared/data/fontProfiles';
|
||||
} from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
@@ -18,8 +18,9 @@ import {
|
||||
loadLetterFont,
|
||||
type LetterFontSizes,
|
||||
} from '../../shared/draw/drawTools';
|
||||
import { GRID_COLORS, TRACING_COLORS } from '../../../core/data/tracingStyles';
|
||||
|
||||
const LINE_INK_ALPHA = 'rgba(50, 46, 37, 1)';
|
||||
const LINE_INK_ALPHA = GRID_COLORS.border;
|
||||
const ACCENT_RED = 'rgba(252, 46, 0, 1)';
|
||||
const TITLE_TEXT_FONT = '14px sans-serif';
|
||||
const TITLE_ICON_GAP = 4;
|
||||
@@ -167,10 +168,10 @@ export default class SingleLetterDraw extends BaseDrawService {
|
||||
const groupsPerLine = [8, 6, 3, 1];
|
||||
const slotW = lineW / groupsPerLine[0]; // 以第一行的 8 组为基准
|
||||
const lineStyles = [
|
||||
{ color: 'rgba(26, 26, 26, 1)', alpha: 1, dashed: false },
|
||||
{ color: '#FF8E8E', alpha: 1, dashed: false },
|
||||
{ color: '#FF8E8E', alpha: 0.5, dashed: false },
|
||||
{ color: '#FF8E8E', alpha: 0.5, dashed: true },
|
||||
{ color: TRACING_COLORS.strong, alpha: 1, dashed: false },
|
||||
{ color: TRACING_COLORS.guide, alpha: 1, dashed: false },
|
||||
{ color: TRACING_COLORS.guide, alpha: 0.5, dashed: false },
|
||||
{ color: TRACING_COLORS.guide, alpha: 0.5, dashed: true },
|
||||
] as const;
|
||||
|
||||
for (let r = 0; r < lineTops.length; r++) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
import {
|
||||
fontFamilyOf,
|
||||
PRINT_CLEARLY_DASHED,
|
||||
} from '../../shared/data/fontProfiles';
|
||||
} from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
LetterTracingData,
|
||||
TracingRow,
|
||||
} from '../generators/letter-tracing-generator';
|
||||
import { fontFamilyOf } from '../../shared/data/fontProfiles';
|
||||
import { fontFamilyOf } from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
@@ -12,8 +12,10 @@ import {
|
||||
type LetterFontSizes,
|
||||
} from '../../shared/draw/drawTools';
|
||||
|
||||
const COLOR_BLACK = '#1a1a1a';
|
||||
const COLOR_LIGHT_RED = '#FF8E8E';
|
||||
import { TRACING_COLORS } from '../../../core/data/tracingStyles';
|
||||
|
||||
const COLOR_BLACK = TRACING_COLORS.strong;
|
||||
const COLOR_LIGHT_RED = TRACING_COLORS.guide;
|
||||
const COLUMN_GUTTER = 18;
|
||||
|
||||
type TwoColumnData = Extract<
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
PRINT_CLEARLY_BOLD,
|
||||
PRINT_CLEARLY_DASHED,
|
||||
fontFamilyOf,
|
||||
} from '../../shared/data/fontProfiles';
|
||||
} from '../../../core/font/fontProfiles';
|
||||
import {
|
||||
calcLetterFontSizes,
|
||||
drawFourLineGrid,
|
||||
@@ -13,26 +13,21 @@ import {
|
||||
loadLetterFont,
|
||||
type LetterFontSizes,
|
||||
} from '../../shared/draw/drawTools';
|
||||
import { TRACING_COLORS } from '../../../core/data/tracingStyles';
|
||||
|
||||
type UpperLowerData = Extract<
|
||||
LetterTracingData,
|
||||
{ mode: 'letter-tracing-upper-lower' }
|
||||
>;
|
||||
|
||||
/** 页面左右边距(margin,px),用于排版时留白 */
|
||||
const M = 24;
|
||||
/** 上下两大区(Uppercase / lowercase)之间的间距 */
|
||||
const SECTION_GAP = 25;
|
||||
/** 标题字号 */
|
||||
const TITLE_SIZE = 28;
|
||||
/** 标题与第一行四线三格的间距 */
|
||||
const TITLE_GAP = 25;
|
||||
/** 同一区域内相邻四线三格行之间的间距 */
|
||||
const ROW_GAP = 24;
|
||||
const TITLE_COLOR = '#000';
|
||||
|
||||
/** 浅红色描红(不透明 hex,避免打印时半透明发灰) */
|
||||
const TRACE_LIGHT_RED = '#FF8E8E';
|
||||
const TRACE_LIGHT_RED = TRACING_COLORS.guide;
|
||||
|
||||
const DASHED_PROFILE = PRINT_CLEARLY_DASHED;
|
||||
const TITLE_PROFILE = PRINT_CLEARLY_BOLD;
|
||||
|
||||
Reference in New Issue
Block a user