From 9c849e78bac55d5bcbb88f41659e2012f27999df Mon Sep 17 00:00:00 2001 From: personal82555 Date: Mon, 12 Oct 2026 18:03:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E5=AD=97=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20=E2=80=94=20=E5=A4=9A=E8=A1=8C=E6=96=87?= =?UTF-8?q?=E5=AD=97canvas=E6=B8=B2=E6=9F=93,=20=E5=AD=97=E4=BD=93/?= =?UTF-8?q?=E5=AD=97=E5=8F=B7/=E9=A2=9C=E8=89=B2/=E8=83=8C=E6=99=AF/?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE/=E8=A1=8C=E9=AB=98/=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=80=8D=E6=95=B0(1x-3x)=E5=8F=AF=E8=B0=83,=20PNG/JPG=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E9=A2=84=E8=A7=88=E4=B8=8B=E8=BD=BD,=20=E5=8F=97?= =?UTF-8?q?=E6=8E=A7=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + docker/it-tools-relay/server.py | 2 +- locales/en.yml | 3 + locales/zh.yml | 3 + src/tools/index.ts | 3 +- src/tools/license/license.ts | 1 + src/tools/text-to-image/index.ts | 12 + src/tools/text-to-image/text-to-image.vue | 344 ++++++++++++++++++++++ 8 files changed, 367 insertions(+), 2 deletions(-) create mode 100644 src/tools/text-to-image/index.ts create mode 100644 src/tools/text-to-image/text-to-image.vue diff --git a/components.d.ts b/components.d.ts index d8c53e7..627c556 100644 --- a/components.d.ts +++ b/components.d.ts @@ -223,6 +223,7 @@ declare module '@vue/runtime-core' { TextDiff: typeof import('./src/tools/text-diff/text-diff.vue')['default'] TextStatistics: typeof import('./src/tools/text-statistics/text-statistics.vue')['default'] TextToBinary: typeof import('./src/tools/text-to-binary/text-to-binary.vue')['default'] + TextToImage: typeof import('./src/tools/text-to-image/text-to-image.vue')['default'] TextToNatoAlphabet: typeof import('./src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue')['default'] TextToUnicode: typeof import('./src/tools/text-to-unicode/text-to-unicode.vue')['default'] TokenDisplay: typeof import('./src/tools/otp-code-generator-and-validator/token-display.vue')['default'] diff --git a/docker/it-tools-relay/server.py b/docker/it-tools-relay/server.py index dd3c81d..ed00377 100644 --- a/docker/it-tools-relay/server.py +++ b/docker/it-tools-relay/server.py @@ -44,7 +44,7 @@ AUTH_PASS = os.environ.get("AUTH_PASS", "") PROJECT_NAME = os.environ.get("PROJECT_NAME", "IT-Tools") TRIAL_FILE = os.environ.get("TRIAL_FILE", "/app/data/trials.json") TRIAL_MS = int(os.environ.get("TRIAL_MS_MIN", "30")) * 60 * 1000 -PROTECTED_TOOLS = {"translator", "image-ocr", "pdf-ocr", "ai-retouch", "label-designer", "doc-convert", "image-tools", "pdf-tools", "video-tools", "audio-tools", "seal-maker", "signature-pad"} +PROTECTED_TOOLS = {"translator", "image-ocr", "pdf-ocr", "ai-retouch", "label-designer", "doc-convert", "image-tools", "pdf-tools", "video-tools", "audio-tools", "seal-maker", "signature-pad", "text-to-image"} MACHINE_RE = re.compile(r"^\d{10,16}$") # verify() messages that unconditionally block activation diff --git a/locales/en.yml b/locales/en.yml index 687ee37..624f176 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -275,6 +275,9 @@ tools: title: Image OCR description: Extract text from images with OCR - click, drag & drop or paste a screenshot, get recognized lines with confidence scores, copy or download as TXT. + text-to-image: + title: 'Text to image' + description: 'Render multi-line text into images with custom font, color, background, export PNG/JPG up to 3x' signature-pad: title: 'Signature pad' description: 'Draw handwritten signatures in browser with realistic pen strokes, export transparent PNG, sign images and PDFs' diff --git a/locales/zh.yml b/locales/zh.yml index fb0ceba..cfc7d39 100644 --- a/locales/zh.yml +++ b/locales/zh.yml @@ -272,6 +272,9 @@ tools: title: 图片OCR文字识别 description: 上传、拖拽或粘贴截图识别图片中的文字,逐行输出识别结果和置信度,支持复制全部和下载TXT。 + text-to-image: + title: '文字生成图片' + description: '多行文字一键生成图片,字体/字号/颜色/背景/位置/行高可调,PNG/JPG 导出,支持 2x/3x 高清倍数' signature-pad: title: '手写签名' description: '浏览器本地手写签名(鼠标/触屏/手写笔),真实笔触模拟,透明底 PNG 下载,可一键签章到图片与 PDF 合同' diff --git a/src/tools/index.ts b/src/tools/index.ts index 4226042..f21f0d9 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -85,6 +85,7 @@ import { tool as videoTools } from './video-tools'; import { tool as audioTools } from './audio-tools'; import { tool as sealMaker } from './seal-maker'; import { tool as signaturePad } from './signature-pad'; +import { tool as textToImage } from './text-to-image'; import { tool as docConvert } from './doc-convert'; import { tool as aiRetouch } from './ai-retouch'; import { tool as wifiQrCodeGenerator } from './wifi-qr-code-generator'; @@ -156,7 +157,7 @@ export const toolsByCategory: ToolCategory[] = [ }, { name: 'Images and videos', - components: [qrCodeGenerator, wifiQrCodeGenerator, batchBarcodeGenerator, codeReader, imageOcr, pdfOcr, pdfTools, imageTools, videoTools, audioTools, sealMaker, signaturePad, docConvert, aiRetouch, labelDesigner, siteBookmarks, svgPlaceholderGenerator, cameraRecorder], + components: [qrCodeGenerator, wifiQrCodeGenerator, batchBarcodeGenerator, codeReader, imageOcr, pdfOcr, pdfTools, imageTools, videoTools, audioTools, sealMaker, signaturePad, textToImage, docConvert, aiRetouch, labelDesigner, siteBookmarks, svgPlaceholderGenerator, cameraRecorder], }, { name: 'Development', diff --git a/src/tools/license/license.ts b/src/tools/license/license.ts index e640204..b16874d 100644 --- a/src/tools/license/license.ts +++ b/src/tools/license/license.ts @@ -18,6 +18,7 @@ export const PROTECTED_TOOLS: Record = { '/audio-tools': '音频工具', '/seal-maker': '印章生成', '/signature-pad': '手写签名', + '/text-to-image': '文字生成图片', }; export const TRIAL_MS = 30 * 60 * 1000; // 每个功能免费 30 分钟 diff --git a/src/tools/text-to-image/index.ts b/src/tools/text-to-image/index.ts new file mode 100644 index 0000000..d33a80f --- /dev/null +++ b/src/tools/text-to-image/index.ts @@ -0,0 +1,12 @@ +import { Typography } from '@vicons/tabler'; +import { defineTool } from '../tool'; +import { translate } from '@/plugins/i18n.plugin'; + +export const tool = defineTool({ + name: translate('tools.text-to-image.title'), + path: '/text-to-image', + description: translate('tools.text-to-image.description'), + keywords: ['text', 'image', '文字', '生成图片', '文字图片', '排版'], + component: () => import('./text-to-image.vue'), + icon: Typography, +}); diff --git a/src/tools/text-to-image/text-to-image.vue b/src/tools/text-to-image/text-to-image.vue new file mode 100644 index 0000000..d16ff18 --- /dev/null +++ b/src/tools/text-to-image/text-to-image.vue @@ -0,0 +1,344 @@ + + +