From d78eb3037c37b54593ce7640844e1adf3b86bf5c Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Fri, 2 Jan 2026 16:11:58 +0300 Subject: [PATCH] feat(font): add constants with information about fonts characteristics --- src/entities/Font/index.ts | 12 +++++++ src/entities/Font/model/font.ts | 63 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/src/entities/Font/index.ts b/src/entities/Font/index.ts index 6375211..77b9316 100644 --- a/src/entities/Font/index.ts +++ b/src/entities/Font/index.ts @@ -1 +1,13 @@ export type { FontCategory, FontProvider, FontSubset } from './model/font'; +export type { + FontshareApiModel, + FontshareDesigner, + FontshareFeature, + FontshareFont, + FontsharePublisher, + FontshareStyle, + FontshareStyleProperties, + FontshareTag, + FontshareWeight, +} from './model/fontshare_fonts'; +export type { FontFiles, FontItem, FontVariant, GoogleFontsApiModel } from './model/google_fonts'; diff --git a/src/entities/Font/model/font.ts b/src/entities/Font/model/font.ts index 3222835..59935f0 100644 --- a/src/entities/Font/model/font.ts +++ b/src/entities/Font/model/font.ts @@ -1,14 +1,77 @@ +import type { Category } from '$shared/store/createFilterStore'; + /** * Font category */ export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace'; +export const FONT_CATEGORIES: Category[] = [ + { + id: 'sans-serif', + name: 'Sans-serif', + }, + { + id: 'serif', + name: 'Serif', + }, + { + id: 'display', + name: 'Display', + }, + { + id: 'handwriting', + name: 'Handwriting', + }, + { + id: 'monospace', + name: 'Monospace', + }, +] as const; + /** * Font provider */ export type FontProvider = 'google' | 'fontshare'; +export const FONT_PROVIDERS: Category[] = [ + { + id: 'google', + name: 'Google Fonts', + }, + { + id: 'fontshare', + name: 'Fontshare', + }, +] as const; + /** * Font subset */ export type FontSubset = 'latin' | 'latin-ext' | 'cyrillic' | 'greek' | 'arabic' | 'devanagari'; + +export const FONT_SUBSETS: Category[] = [ + { + id: 'latin', + name: 'Latin', + }, + { + id: 'latin-ext', + name: 'Latin Extended', + }, + { + id: 'cyrillic', + name: 'Cyrillic', + }, + { + id: 'greek', + name: 'Greek', + }, + { + id: 'arabic', + name: 'Arabic', + }, + { + id: 'devanagari', + name: 'Devanagari', + }, +] as const;