From 734ae099a7965ded5711b2ca7b45b1f6352f499a Mon Sep 17 00:00:00 2001 From: Expector Date: Wed, 1 Apr 2026 20:51:07 +0800 Subject: [PATCH 1/7] feat(text-to-styled-letters): add tool for converting text to styled letters --- components.d.ts | 21 +++ .../command-palette/command-palette.vue | 2 +- src/tools/index.ts | 2 + src/tools/text-to-styled-letters/index.ts | 12 ++ .../text-to-styled-letters.constants.ts | 130 ++++++++++++++++++ .../text-to-styled-letters.service.ts | 102 ++++++++++++++ .../text-to-styled-letters.vue | 55 ++++++++ src/ui/c-select/c-select.vue | 2 +- src/ui/c-table/c-table.vue | 2 +- 9 files changed, 325 insertions(+), 3 deletions(-) create mode 100644 src/tools/text-to-styled-letters/index.ts create mode 100644 src/tools/text-to-styled-letters/text-to-styled-letters.constants.ts create mode 100644 src/tools/text-to-styled-letters/text-to-styled-letters.service.ts create mode 100644 src/tools/text-to-styled-letters/text-to-styled-letters.vue diff --git a/components.d.ts b/components.d.ts index 3e65c3cc52..d78339c446 100644 --- a/components.d.ts +++ b/components.d.ts @@ -90,7 +90,9 @@ declare module '@vue/runtime-core' { HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default'] IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default'] 'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default'] + 'IconMdi:contentCopy': typeof import('~icons/mdi/content-copy')['default'] 'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default'] + IconMdiArrowDown: typeof import('~icons/mdi/arrow-down')['default'] IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default'] IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default'] IconMdiClose: typeof import('~icons/mdi/close')['default'] @@ -98,6 +100,7 @@ declare module '@vue/runtime-core' { IconMdiEye: typeof import('~icons/mdi/eye')['default'] IconMdiEyeOff: typeof import('~icons/mdi/eye-off')['default'] IconMdiHeart: typeof import('~icons/mdi/heart')['default'] + IconMdiRefresh: typeof import('~icons/mdi/refresh')['default'] IconMdiSearch: typeof import('~icons/mdi/search')['default'] IconMdiTranslate: typeof import('~icons/mdi/translate')['default'] IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default'] @@ -131,17 +134,34 @@ declare module '@vue/runtime-core' { MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] NCheckbox: typeof import('naive-ui')['NCheckbox'] + NCode: typeof import('naive-ui')['NCode'] NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] + NDatePicker: typeof import('naive-ui')['NDatePicker'] NDivider: typeof import('naive-ui')['NDivider'] + NDynamicInput: typeof import('naive-ui')['NDynamicInput'] NEllipsis: typeof import('naive-ui')['NEllipsis'] + NForm: typeof import('naive-ui')['NForm'] + NFormItem: typeof import('naive-ui')['NFormItem'] + NGi: typeof import('naive-ui')['NGi'] + NGrid: typeof import('naive-ui')['NGrid'] NH1: typeof import('naive-ui')['NH1'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] + NImage: typeof import('naive-ui')['NImage'] + NInputGroup: typeof import('naive-ui')['NInputGroup'] + NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel'] + NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] + NProgress: typeof import('naive-ui')['NProgress'] + NScrollbar: typeof import('naive-ui')['NScrollbar'] + NSlider: typeof import('naive-ui')['NSlider'] NSpace: typeof import('naive-ui')['NSpace'] + NSpin: typeof import('naive-ui')['NSpin'] + NStatistic: typeof import('naive-ui')['NStatistic'] + NSwitch: typeof import('naive-ui')['NSwitch'] NTable: typeof import('naive-ui')['NTable'] NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] @@ -172,6 +192,7 @@ declare module '@vue/runtime-core' { TextStatistics: typeof import('./src/tools/text-statistics/text-statistics.vue')['default'] TextToBinary: typeof import('./src/tools/text-to-binary/text-to-binary.vue')['default'] TextToNatoAlphabet: typeof import('./src/tools/text-to-nato-alphabet/text-to-nato-alphabet.vue')['default'] + TextToStyledLetters: typeof import('./src/tools/text-to-styled-letters/text-to-styled-letters.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'] 'TokenGenerator.tool': typeof import('./src/tools/token-generator/token-generator.tool.vue')['default'] diff --git a/src/modules/command-palette/command-palette.vue b/src/modules/command-palette/command-palette.vue index bceef5cdcd..5d953fee2e 100644 --- a/src/modules/command-palette/command-palette.vue +++ b/src/modules/command-palette/command-palette.vue @@ -128,7 +128,7 @@ function activateOption(option: PaletteOption) {
-
+
{{ category }}
diff --git a/src/tools/index.ts b/src/tools/index.ts index 388cfaf494..6f21a5c458 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -1,6 +1,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64StringConverter } from './base64-string-converter'; import { tool as basicAuthGenerator } from './basic-auth-generator'; +import { tool as textToStyledLetters } from './text-to-styled-letters'; import { tool as emailNormalizer } from './email-normalizer'; import { tool as asciiTextDrawer } from './ascii-text-drawer'; @@ -116,6 +117,7 @@ export const toolsByCategory: ToolCategory[] = [ xmlToJson, jsonToXml, markdownToHtml, + textToStyledLetters, ], }, { diff --git a/src/tools/text-to-styled-letters/index.ts b/src/tools/text-to-styled-letters/index.ts new file mode 100644 index 0000000000..24de5692c0 --- /dev/null +++ b/src/tools/text-to-styled-letters/index.ts @@ -0,0 +1,12 @@ +import { AbcRound } from '@vicons/material'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'Text to styled letters', + path: '/text-to-styled-letters', + description: 'Convert your text into styled letters in unicode.', + keywords: ['text', 'to', 'styled', 'letters'], + component: () => import('./text-to-styled-letters.vue'), + icon: AbcRound, + createdAt: new Date('2026-04-01'), +}); diff --git a/src/tools/text-to-styled-letters/text-to-styled-letters.constants.ts b/src/tools/text-to-styled-letters/text-to-styled-letters.constants.ts new file mode 100644 index 0000000000..64f18a7703 --- /dev/null +++ b/src/tools/text-to-styled-letters/text-to-styled-letters.constants.ts @@ -0,0 +1,130 @@ +export const styledLetters = { + A: ['๐€', '๐ด', '๐‘จ', '๐’œ', '๐“', '๐•ฌ', '๐”ธ', '๐– ', '๐—”', '๐˜ˆ', '๐˜ผ', '๐™ฐ'], + B: ['๐', '๐ต', '๐‘ฉ', 'โ„ฌ', '๐“‘', '๐•ญ', '๐”น', '๐–ก', '๐—•', '๐˜‰', '๐˜ฝ', '๐™ฑ'], + C: ['๐‚', '๐ถ', '๐‘ช', '๐’ž', '๐“’', '๐•ฎ', 'โ„‚', '๐–ข', '๐—–', '๐˜Š', '๐˜พ', '๐™ฒ'], + D: ['๐ƒ', '๐ท', '๐‘ซ', '๐’Ÿ', '๐““', '๐•ฏ', '๐”ป', '๐–ฃ', '๐——', '๐˜‹', '๐˜ฟ', '๐™ณ'], + E: ['๐„', '๐ธ', '๐‘ฌ', 'โ„ฐ', '๐“”', '๐•ฐ', '๐”ผ', '๐–ค', '๐—˜', '๐˜Œ', '๐™€', '๐™ด'], + F: ['๐…', '๐น', '๐‘ญ', 'โ„ฑ', '๐“•', '๐•ฑ', '๐”ฝ', '๐–ฅ', '๐—™', '๐˜', '๐™', '๐™ต'], + G: ['๐†', '๐บ', '๐‘ฎ', '๐’ข', '๐“–', '๐•ฒ', '๐”พ', '๐–ฆ', '๐—š', '๐˜Ž', '๐™‚', '๐™ถ'], + H: ['๐‡', '๐ป', '๐‘ฏ', 'โ„‹', '๐“—', '๐•ณ', 'โ„', '๐–ง', '๐—›', '๐˜', '๐™ƒ', '๐™ท'], + I: ['๐ˆ', '๐ผ', '๐‘ฐ', 'โ„', '๐“˜', '๐•ด', '๐•€', '๐–จ', '๐—œ', '๐˜', '๐™„', '๐™ธ'], + J: ['๐‰', '๐ฝ', '๐‘ฑ', '๐’ฅ', '๐“™', '๐•ต', '๐•', '๐–ฉ', '๐—', '๐˜‘', '๐™…', '๐™น'], + K: ['๐Š', '๐พ', '๐‘ฒ', '๐’ฆ', '๐“š', '๐•ถ', '๐•‚', '๐–ช', '๐—ž', '๐˜’', '๐™†', '๐™บ'], + L: ['๐‹', '๐ฟ', '๐‘ณ', 'โ„’', '๐“›', '๐•ท', '๐•ƒ', '๐–ซ', '๐—Ÿ', '๐˜“', '๐™‡', '๐™ป'], + M: ['๐Œ', '๐‘€', '๐‘ด', 'โ„ณ', '๐“œ', '๐•ธ', '๐•„', '๐–ฌ', '๐— ', '๐˜”', '๐™ˆ', '๐™ผ'], + N: ['๐', '๐‘', '๐‘ต', '๐’ฉ', '๐“', '๐•น', 'โ„•', '๐–ญ', '๐—ก', '๐˜•', '๐™‰', '๐™ฝ'], + O: ['๐Ž', '๐‘‚', '๐‘ถ', '๐’ช', '๐“ž', '๐•บ', '๐•†', '๐–ฎ', '๐—ข', '๐˜–', '๐™Š', '๐™พ'], + P: ['๐', '๐‘ƒ', '๐‘ท', '๐’ซ', '๐“Ÿ', '๐•ป', 'โ„™', '๐–ฏ', '๐—ฃ', '๐˜—', '๐™‹', '๐™ฟ'], + Q: ['๐', '๐‘„', '๐‘ธ', '๐’ฌ', '๐“ ', '๐•ผ', 'โ„š', '๐–ฐ', '๐—ค', '๐˜˜', '๐™Œ', '๐š€'], + R: ['๐‘', '๐‘…', '๐‘น', 'โ„›', '๐“ก', '๐•ฝ', 'โ„', '๐–ฑ', '๐—ฅ', '๐˜™', '๐™', '๐š'], + S: ['๐’', '๐‘†', '๐‘บ', '๐’ฎ', '๐“ข', '๐•พ', '๐•Š', '๐–ฒ', '๐—ฆ', '๐˜š', '๐™Ž', '๐š‚'], + T: ['๐“', '๐‘‡', '๐‘ป', '๐’ฏ', '๐“ฃ', '๐•ฟ', '๐•‹', '๐–ณ', '๐—ง', '๐˜›', '๐™', '๐šƒ'], + U: ['๐”', '๐‘ˆ', '๐‘ผ', '๐’ฐ', '๐“ค', '๐–€', '๐•Œ', '๐–ด', '๐—จ', '๐˜œ', '๐™', '๐š„'], + V: ['๐•', '๐‘‰', '๐‘ฝ', '๐’ฑ', '๐“ฅ', '๐–', '๐•', '๐–ต', '๐—ฉ', '๐˜', '๐™‘', '๐š…'], + W: ['๐–', '๐‘Š', '๐‘พ', '๐’ฒ', '๐“ฆ', '๐–‚', '๐•Ž', '๐–ถ', '๐—ช', '๐˜ž', '๐™’', '๐š†'], + X: ['๐—', '๐‘‹', '๐‘ฟ', '๐’ณ', '๐“ง', '๐–ƒ', '๐•', '๐–ท', '๐—ซ', '๐˜Ÿ', '๐™“', '๐š‡'], + Y: ['๐˜', '๐‘Œ', '๐’€', '๐’ด', '๐“จ', '๐–„', '๐•', '๐–ธ', '๐—ฌ', '๐˜ ', '๐™”', '๐šˆ'], + Z: ['๐™', '๐‘', '๐’', '๐’ต', '๐“ฉ', '๐–…', 'โ„ค', '๐–น', '๐—ญ', '๐˜ก', '๐™•', '๐š‰'], + + a: ['๐š', '๐‘Ž', '๐’‚', '๐’ถ', '๐“ช', '๐–†', '๐•’', '๐–บ', '๐—ฎ', '๐˜ข', '๐™–', '๐šŠ'], + b: ['๐›', '๐‘', '๐’ƒ', '๐’ท', '๐“ซ', '๐–‡', '๐•“', '๐–ป', '๐—ฏ', '๐˜ฃ', '๐™—', '๐š‹'], + c: ['๐œ', '๐‘', '๐’„', '๐’ธ', '๐“ฌ', '๐–ˆ', '๐•”', '๐–ผ', '๐—ฐ', '๐˜ค', '๐™˜', '๐šŒ'], + d: ['๐', '๐‘‘', '๐’…', '๐’น', '๐“ญ', '๐–‰', '๐••', '๐–ฝ', '๐—ฑ', '๐˜ฅ', '๐™™', '๐š'], + e: ['๐ž', '๐‘’', '๐’†', 'โ„ฏ', '๐“ฎ', '๐–Š', '๐•–', '๐–พ', '๐—ฒ', '๐˜ฆ', '๐™š', '๐šŽ'], + f: ['๐Ÿ', '๐‘“', '๐’‡', '๐’ป', '๐“ฏ', '๐–‹', '๐•—', '๐–ฟ', '๐—ณ', '๐˜ง', '๐™›', '๐š'], + g: ['๐ ', '๐‘”', '๐’ˆ', 'โ„Š', '๐“ฐ', '๐–Œ', '๐•˜', '๐—€', '๐—ด', '๐˜จ', '๐™œ', '๐š'], + h: ['๐ก', 'โ„Ž', '๐’‰', '๐’ฝ', '๐“ฑ', '๐–', '๐•™', '๐—', '๐—ต', '๐˜ฉ', '๐™', '๐š‘'], + i: ['๐ข', '๐‘–', '๐’Š', '๐’พ', '๐“ฒ', '๐–Ž', '๐•š', '๐—‚', '๐—ถ', '๐˜ช', '๐™ž', '๐š’'], + j: ['๐ฃ', '๐‘—', '๐’‹', '๐’ฟ', '๐“ณ', '๐–', '๐•›', '๐—ƒ', '๐—ท', '๐˜ซ', '๐™Ÿ', '๐š“'], + k: ['๐ค', '๐‘˜', '๐’Œ', '๐“€', '๐“ด', '๐–', '๐•œ', '๐—„', '๐—ธ', '๐˜ฌ', '๐™ ', '๐š”'], + l: ['๐ฅ', '๐‘™', '๐’', '๐“', '๐“ต', '๐–‘', '๐•', '๐—…', '๐—น', '๐˜ญ', '๐™ก', '๐š•'], + m: ['๐ฆ', '๐‘š', '๐’Ž', '๐“‚', '๐“ถ', '๐–’', '๐•ž', '๐—†', '๐—บ', '๐˜ฎ', '๐™ข', '๐š–'], + n: ['๐ง', '๐‘›', '๐’', '๐“ƒ', '๐“ท', '๐–“', '๐•Ÿ', '๐—‡', '๐—ป', '๐˜ฏ', '๐™ฃ', '๐š—'], + o: ['๐จ', '๐‘œ', '๐’', 'โ„ด', '๐“ธ', '๐–”', '๐• ', '๐—ˆ', '๐—ผ', '๐˜ฐ', '๐™ค', '๐š˜'], + p: ['๐ฉ', '๐‘', '๐’‘', '๐“…', '๐“น', '๐–•', '๐•ก', '๐—‰', '๐—ฝ', '๐˜ฑ', '๐™ฅ', '๐š™'], + q: ['๐ช', '๐‘ž', '๐’’', '๐“†', '๐“บ', '๐––', '๐•ข', '๐—Š', '๐—พ', '๐˜ฒ', '๐™ฆ', '๐šš'], + r: ['๐ซ', '๐‘Ÿ', '๐’“', '๐“‡', '๐“ป', '๐–—', '๐•ฃ', '๐—‹', '๐—ฟ', '๐˜ณ', '๐™ง', '๐š›'], + s: ['๐ฌ', '๐‘ ', '๐’”', '๐“ˆ', '๐“ผ', '๐–˜', '๐•ค', '๐—Œ', '๐˜€', '๐˜ด', '๐™จ', '๐šœ'], + t: ['๐ญ', '๐‘ก', '๐’•', '๐“‰', '๐“ฝ', '๐–™', '๐•ฅ', '๐—', '๐˜', '๐˜ต', '๐™ฉ', '๐š'], + u: ['๐ฎ', '๐‘ข', '๐’–', '๐“Š', '๐“พ', '๐–š', '๐•ฆ', '๐—Ž', '๐˜‚', '๐˜ถ', '๐™ช', '๐šž'], + v: ['๐ฏ', '๐‘ฃ', '๐’—', '๐“‹', '๐“ฟ', '๐–›', '๐•ง', '๐—', '๐˜ƒ', '๐˜ท', '๐™ซ', '๐šŸ'], + w: ['๐ฐ', '๐‘ค', '๐’˜', '๐“Œ', '๐”€', '๐–œ', '๐•จ', '๐—', '๐˜„', '๐˜ธ', '๐™ฌ', '๐š '], + x: ['๐ฑ', '๐‘ฅ', '๐’™', '๐“', '๐”', '๐–', '๐•ฉ', '๐—‘', '๐˜…', '๐˜น', '๐™ญ', '๐šก'], + y: ['๐ฒ', '๐‘ฆ', '๐’š', '๐“Ž', '๐”‚', '๐–ž', '๐•ช', '๐—’', '๐˜†', '๐˜บ', '๐™ฎ', '๐šข'], + z: ['๐ณ', '๐‘ง', '๐’›', '๐“', '๐”ƒ', '๐–Ÿ', '๐•ซ', '๐—“', '๐˜‡', '๐˜ป', '๐™ฏ', '๐šฃ'], +}; + +export const styledDigits = { + 0: ['๐ŸŽ', '๐Ÿ˜', '๐Ÿข', '๐Ÿฌ', '๐Ÿถ'], + 1: ['๐Ÿ', '๐Ÿ™', '๐Ÿฃ', '๐Ÿญ', '๐Ÿท'], + 2: ['๐Ÿ', '๐Ÿš', '๐Ÿค', '๐Ÿฎ', '๐Ÿธ'], + 3: ['๐Ÿ‘', '๐Ÿ›', '๐Ÿฅ', '๐Ÿฏ', '๐Ÿน'], + 4: ['๐Ÿ’', '๐Ÿœ', '๐Ÿฆ', '๐Ÿฐ', '๐Ÿบ'], + 5: ['๐Ÿ“', '๐Ÿ', '๐Ÿง', '๐Ÿฑ', '๐Ÿป'], + 6: ['๐Ÿ”', '๐Ÿž', '๐Ÿจ', '๐Ÿฒ', '๐Ÿผ'], + 7: ['๐Ÿ•', '๐ŸŸ', '๐Ÿฉ', '๐Ÿณ', '๐Ÿฝ'], + 8: ['๐Ÿ–', '๐Ÿ ', '๐Ÿช', '๐Ÿด', '๐Ÿพ'], + 9: ['๐Ÿ—', '๐Ÿก', '๐Ÿซ', '๐Ÿต', '๐Ÿฟ'], +}; + +export const styledGreek = { + 'ฮ‘': ['๐šจ', '๐›ข', '๐œœ', '๐–', '๐ž'], // Alpha + 'ฮ’': ['๐šฉ', '๐›ฃ', '๐œ', '๐—', '๐ž‘'], // Beta + 'ฮ“': ['๐šช', '๐›ค', '๐œž', '๐˜', '๐ž’'], // Gamma + 'ฮ”': ['๐šซ', '๐›ฅ', '๐œŸ', '๐™', '๐ž“'], // Delta + 'ฮ•': ['๐šฌ', '๐›ฆ', '๐œ ', '๐š', '๐ž”'], // Epsilon + 'ฮ–': ['๐šญ', '๐›ง', '๐œก', '๐›', '๐ž•'], // Zeta + 'ฮ—': ['๐šฎ', '๐›จ', '๐œข', '๐œ', '๐ž–'], // Eta + 'ฮ˜': ['๐šฏ', '๐›ฉ', '๐œฃ', '๐', '๐ž—'], // Theta + 'ฮ™': ['๐šฐ', '๐›ช', '๐œค', '๐ž', '๐ž˜'], // Iota + 'ฮš': ['๐šฑ', '๐›ซ', '๐œฅ', '๐Ÿ', '๐ž™'], // Kappa + 'ฮ›': ['๐šฒ', '๐›ฌ', '๐œฆ', '๐ ', '๐žš'], // Lambda + 'ฮœ': ['๐šณ', '๐›ญ', '๐œง', '๐ก', '๐ž›'], // Mu + 'ฮ': ['๐šด', '๐›ฎ', '๐œจ', '๐ข', '๐žœ'], // Nu + 'ฮž': ['๐šต', '๐›ฏ', '๐œฉ', '๐ฃ', '๐ž'], // Xi + 'ฮŸ': ['๐šถ', '๐›ฐ', '๐œช', '๐ค', '๐žž'], // Omicron + 'ฮ ': ['๐šท', '๐›ฑ', '๐œซ', '๐ฅ', '๐žŸ'], // Pi + 'ฮก': ['๐šธ', '๐›ฒ', '๐œฌ', '๐ฆ', '๐ž '], // Rho + 'ฯด': ['๐šน', '๐›ณ', '๐œญ', '๐ง', '๐žก'], // Theta symbol (variant) + 'ฮฃ': ['๐šบ', '๐›ด', '๐œฎ', '๐จ', '๐žข'], // Sigma + 'ฮค': ['๐šป', '๐›ต', '๐œฏ', '๐ฉ', '๐žฃ'], // Tau + 'ฮฅ': ['๐šผ', '๐›ถ', '๐œฐ', '๐ช', '๐žค'], // Upsilon + 'ฮฆ': ['๐šฝ', '๐›ท', '๐œฑ', '๐ซ', '๐žฅ'], // Phi + 'ฮง': ['๐šพ', '๐›ธ', '๐œฒ', '๐ฌ', '๐žฆ'], // Chi + 'ฮจ': ['๐šฟ', '๐›น', '๐œณ', '๐ญ', '๐žง'], // Psi + 'ฮฉ': ['๐›€', '๐›บ', '๐œด', '๐ฎ', '๐žจ'], // Omega + 'โˆ‡': ['๐›', '๐›ป', '๐œต', '๐ฏ', '๐žฉ'], // Nabla + + 'ฮฑ': ['๐›‚', '๐›ผ', '๐œถ', '๐ฐ', '๐žช'], // alpha + 'ฮฒ': ['๐›ƒ', '๐›ฝ', '๐œท', '๐ฑ', '๐žซ'], // beta + 'ฮณ': ['๐›„', '๐›พ', '๐œธ', '๐ฒ', '๐žฌ'], // gamma + 'ฮด': ['๐›…', '๐›ฟ', '๐œน', '๐ณ', '๐žญ'], // delta + 'ฮต': ['๐›†', '๐œ€', '๐œบ', '๐ด', '๐žฎ'], // epsilon + 'ฮถ': ['๐›‡', '๐œ', '๐œป', '๐ต', '๐žฏ'], // zeta + 'ฮท': ['๐›ˆ', '๐œ‚', '๐œผ', '๐ถ', '๐žฐ'], // eta + 'ฮธ': ['๐›‰', '๐œƒ', '๐œฝ', '๐ท', '๐žฑ'], // theta + 'ฮน': ['๐›Š', '๐œ„', '๐œพ', '๐ธ', '๐žฒ'], // iota + 'ฮบ': ['๐›‹', '๐œ…', '๐œฟ', '๐น', '๐žณ'], // kappa + 'ฮป': ['๐›Œ', '๐œ†', '๐€', '๐บ', '๐žด'], // lambda + 'ฮผ': ['๐›', '๐œ‡', '๐', '๐ป', '๐žต'], // mu + 'ฮฝ': ['๐›Ž', '๐œˆ', '๐‚', '๐ผ', '๐žถ'], // nu + 'ฮพ': ['๐›', '๐œ‰', '๐ƒ', '๐ฝ', '๐žท'], // xi + 'ฮฟ': ['๐›', '๐œŠ', '๐„', '๐พ', '๐žธ'], // omicron + 'ฯ€': ['๐›‘', '๐œ‹', '๐…', '๐ฟ', '๐žน'], // pi + 'ฯ': ['๐›’', '๐œŒ', '๐†', '๐ž€', '๐žบ'], // rho + 'ฯ‚': ['๐›“', '๐œ', '๐‡', '๐ž', '๐žป'], // final sigma + 'ฯƒ': ['๐›”', '๐œŽ', '๐ˆ', '๐ž‚', '๐žผ'], // sigma + 'ฯ„': ['๐›•', '๐œ', '๐‰', '๐žƒ', '๐žฝ'], // tau + 'ฯ…': ['๐›–', '๐œ', '๐Š', '๐ž„', '๐žพ'], // upsilon + 'ฯ†': ['๐›—', '๐œ‘', '๐‹', '๐ž…', '๐žฟ'], // phi (ฯ†) + 'ฯ‡': ['๐›˜', '๐œ’', '๐Œ', '๐ž†', '๐Ÿ€'], // chi + 'ฯˆ': ['๐›™', '๐œ“', '๐', '๐ž‡', '๐Ÿ'], // psi + 'ฯ‰': ['๐›š', '๐œ”', '๐Ž', '๐žˆ', '๐Ÿ‚'], // omega + 'โˆ‚': ['๐››', '๐œ•', '๐', '๐ž‰', '๐Ÿƒ'], // partial differential + 'ฯต': ['๐›œ', '๐œ–', '๐', '๐žŠ', '๐Ÿ„'], // epsilon (lunate variant) + 'ฯ‘': ['๐›', '๐œ—', '๐‘', '๐ž‹', '๐Ÿ…'], // theta symbol + 'ฯฐ': ['๐›ž', '๐œ˜', '๐’', '๐žŒ', '๐Ÿ†'], // kappa symbol + 'ฯ•': ['๐›Ÿ', '๐œ™', '๐“', '๐ž', '๐Ÿ‡'], // phi symbol + 'ฯฑ': ['๐› ', '๐œš', '๐”', '๐žŽ', '๐Ÿˆ'], // rho symbol + 'ฯ–': ['๐›ก', '๐œ›', '๐•', '๐ž', '๐Ÿ‰'], // pi symbol +}; diff --git a/src/tools/text-to-styled-letters/text-to-styled-letters.service.ts b/src/tools/text-to-styled-letters/text-to-styled-letters.service.ts new file mode 100644 index 0000000000..fefb9cc1b6 --- /dev/null +++ b/src/tools/text-to-styled-letters/text-to-styled-letters.service.ts @@ -0,0 +1,102 @@ +import { styledDigits, styledGreek, styledLetters } from './text-to-styled-letters.constants'; + +export { textToStyledLetters }; +export type { StyleType }; + +// ๆ ทๅผ็ฑปๅž‹ๅฎšไน‰ +type StyleType = + | 'bold' // ็ฒ—ไฝ“ + | 'italic' // ๆ–œไฝ“ + | 'boldItalic' // ็ฒ—ๆ–œไฝ“ + | 'script' // ๆ‰‹ๅ†™ไฝ“ + | 'boldScript' // ็ฒ—ๆ‰‹ๅ†™ไฝ“ + | 'fraktur' // ๅ“ฅ็‰นไฝ“/Fraktur + | 'doubleStruck' // ๅŒ็บฟไฝ“/้ป‘ๆฟ็ฒ—ไฝ“ + | 'sansSerif' // ๆ— ่กฌ็บฟ + | 'sansSerifBold' // ๆ— ่กฌ็บฟ็ฒ—ไฝ“ + | 'sansSerifItalic'// ๆ— ่กฌ็บฟๆ–œไฝ“ + | 'sansSerifBoldItalic' // ๆ— ่กฌ็บฟ็ฒ—ๆ–œไฝ“ + | 'monospace'; // ็ญ‰ๅฎฝ + +// ๆ ทๅผ็ดขๅผ•ๆ˜ ๅฐ„ +const STYLE_INDEX: Record = { + bold: 0, + italic: 1, + boldItalic: 2, + script: 3, + boldScript: 4, + fraktur: 5, + doubleStruck: 6, + sansSerif: 7, + sansSerifBold: 8, + sansSerifItalic: 9, + sansSerifBoldItalic: 10, + monospace: 11, +}; + +// ๅธŒ่…Šๅญ—ๆฏๅชๆœ‰5็งๆ ทๅผ๏ผŒ้œ€่ฆ็‰นๆฎŠๅค„็† +const GREEK_STYLE_MAP: Record = { + bold: 0, + italic: 1, + boldItalic: 2, + script: null, // ๅธŒ่…Šๅญ—ๆฏๆ— ๆญคๆ ทๅผ + boldScript: null, // ๅธŒ่…Šๅญ—ๆฏๆ— ๆญคๆ ทๅผ + fraktur: null, // ๅธŒ่…Šๅญ—ๆฏๆ— ๆญคๆ ทๅผ + doubleStruck: null, // ๅธŒ่…Šๅญ—ๆฏๆ— ๆญคๆ ทๅผ + sansSerifBold: 3, // ๆ˜ ๅฐ„ๅˆฐ sans-serif bold + sansSerifBoldItalic: 4, // ๆ˜ ๅฐ„ๅˆฐ sans-serif bold italic + // ไปฅไธ‹ๆ˜ ๅฐ„ๅˆฐๆœ€ๆŽฅ่ฟ‘็š„ๅฏ็”จๆ ทๅผ + sansSerif: 3, // ๆ—  sans-serif regular๏ผŒ็”จ bold ไปฃๆ›ฟ + sansSerifItalic: 4, // ๆ—  sans-serif italic๏ผŒ็”จ bold italic ไปฃๆ›ฟ + monospace: null, // ๅธŒ่…Šๅญ—ๆฏๆ— ็ญ‰ๅฎฝ +}; + +function textToStyledLetters({ + text, + style, +}: { + text: string + style: StyleType +}): string { + const latinIndex = STYLE_INDEX[style]; + const greekIndex = GREEK_STYLE_MAP[style]; + + let result = ''; + + for (const char of text) { + let converted = false; + + // ๅฐ่ฏ•ๅŒน้…ๆ‹‰ไธๅญ—ๆฏ๏ผˆๅคงๅ†™ๆˆ–ๅฐๅ†™๏ผ‰ + if (styledLetters[char]) { + const styled = styledLetters[char][latinIndex]; + if (styled) { + result += styled; + converted = true; + } + } + // ๅฐ่ฏ•ๅŒน้…ๆ•ฐๅญ— + else if (styledDigits[char]) { + // ๆ•ฐๅญ—ๅชๆœ‰7็งๆ ทๅผ๏ผˆ็ดขๅผ•0-6๏ผ‰๏ผŒ่ถ…ๅ‡บ่Œƒๅ›ด้œ€่ฆๅค„็† + const digitIndex = latinIndex <= 6 ? latinIndex : null; + if (digitIndex !== null && styledDigits[char][digitIndex]) { + result += styledDigits[char][digitIndex]; + converted = true; + } + } + // ๅฐ่ฏ•ๅŒน้…ๅธŒ่…Šๅญ—ๆฏ + else if (styledGreek[char] && greekIndex !== null) { + const styled = styledGreek[char][greekIndex]; + if (styled) { + result += styled; + converted = true; + } + } + + // ๆ— ๆณ•่ฝฌๆข๏ผŒ็…งๆŠ„ๅŽŸๅญ—็ฌฆ + if (!converted) { + result += char; + } + } + + return result; +} diff --git a/src/tools/text-to-styled-letters/text-to-styled-letters.vue b/src/tools/text-to-styled-letters/text-to-styled-letters.vue new file mode 100644 index 0000000000..dae4be29a3 --- /dev/null +++ b/src/tools/text-to-styled-letters/text-to-styled-letters.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/ui/c-select/c-select.vue b/src/ui/c-select/c-select.vue index 7b3607c93e..38e2eb8fef 100644 --- a/src/ui/c-select/c-select.vue +++ b/src/ui/c-select/c-select.vue @@ -151,7 +151,7 @@ function onSearchInput() { >
- + {{ selectedOption.label }} diff --git a/src/ui/c-table/c-table.vue b/src/ui/c-table/c-table.vue index ef569890e0..43293ab3c9 100644 --- a/src/ui/c-table/c-table.vue +++ b/src/ui/c-table/c-table.vue @@ -39,7 +39,7 @@ const headers = computed(() => {