From 730eba138d544ae8641899a71971f7c51bc4a8f4 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Fri, 30 Jan 2026 17:42:06 +0300 Subject: [PATCH] feat(FontSampler): refactor styles of FontSampler component --- .../ui/FontDisplay/FontDisplay.svelte | 6 +- .../ui/FontSampler/FontSampler.svelte | 60 +++++++++++++++---- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/src/features/DisplayFont/ui/FontDisplay/FontDisplay.svelte b/src/features/DisplayFont/ui/FontDisplay/FontDisplay.svelte index 0cc8940..c6d8afc 100644 --- a/src/features/DisplayFont/ui/FontDisplay/FontDisplay.svelte +++ b/src/features/DisplayFont/ui/FontDisplay/FontDisplay.svelte @@ -9,10 +9,10 @@ import { displayedFontsStore } from '../../model'; import FontSampler from '../FontSampler/FontSampler.svelte'; -
- {#each displayedFontsStore.fonts as font (font.id)} +
+ {#each displayedFontsStore.fonts as font, index (font.id)}
- +
{/each}
diff --git a/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte index eba95fe..ce75329 100644 --- a/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte +++ b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte @@ -9,12 +9,11 @@ import { selectedFontsStore, } from '$entities/Font'; import { controlManager } from '$features/SetupFont'; -import { cn } from '$shared/shadcn/utils/shadcn-utils'; import { ContentEditable, IconButton, } from '$shared/ui'; -import MinusIcon from '@lucide/svelte/icons/minus'; +import XIcon from '@lucide/svelte/icons/x'; interface Props { /** @@ -25,6 +24,10 @@ interface Props { * Text to display */ text: string; + /** + * Index of the font sampler + */ + index?: number; /** * Font settings */ @@ -36,6 +39,7 @@ interface Props { let { font, text = $bindable(), + index = 0, ...restProps }: Props = $props(); @@ -51,23 +55,37 @@ function removeSample() {
-
- - {font.name} - - +
+
+ + typeface_{String(index).padStart(3, '0')} + +
+ + {font.name} + +
+ + {#snippet icon({ className })} - + {/snippet}
-
+ +
+ +
+ + SZ:{fontSize}PX + +
+ + WGT:{fontWeight} + +
+ + LH:{lineHeight?.toFixed(2)} + +
+ + LTR:{letterSpacing} + +