feat(font): add constants with information about fonts characteristics
Some checks failed
Lint / Lint Code (push) Failing after 7m23s
Test / Svelte Checks (push) Failing after 7m14s

This commit is contained in:
Ilia Mashkov
2026-01-02 16:11:58 +03:00
parent 9f8d7ad844
commit d78eb3037c
2 changed files with 75 additions and 0 deletions

View File

@@ -1 +1,13 @@
export type { FontCategory, FontProvider, FontSubset } from './model/font'; 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';

View File

@@ -1,14 +1,77 @@
import type { Category } from '$shared/store/createFilterStore';
/** /**
* Font category * Font category
*/ */
export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace'; 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 * Font provider
*/ */
export type FontProvider = 'google' | 'fontshare'; export type FontProvider = 'google' | 'fontshare';
export const FONT_PROVIDERS: Category[] = [
{
id: 'google',
name: 'Google Fonts',
},
{
id: 'fontshare',
name: 'Fontshare',
},
] as const;
/** /**
* Font subset * Font subset
*/ */
export type FontSubset = 'latin' | 'latin-ext' | 'cyrillic' | 'greek' | 'arabic' | 'devanagari'; 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;