Typografie

Typografie

Die Typography API ermöglicht die Verwaltung von Schriftarten, Schriftgrößen und Typografie-Skalen.

Endpunkte

Schriftarten

MethodeEndpunktBeschreibung
GET/api/v1/design-system/fontsAlle Schriftarten auflisten
POST/api/v1/design-system/fontsNeue Schriftart erstellen
GET/api/v1/design-system/fonts/{id}Einzelne Schriftart abrufen
PUT/api/v1/design-system/fonts/{id}Schriftart aktualisieren
DELETE/api/v1/design-system/fonts/{id}Schriftart löschen

Schriftfamilien

MethodeEndpunktBeschreibung
GET/api/v1/design-system/font-familiesAlle Schriftfamilien auflisten

Typografie-Skalen

MethodeEndpunktBeschreibung
GET/api/v1/design-system/typography-scalesAlle Skalen auflisten
POST/api/v1/design-system/typography-scalesNeue Skala erstellen
GET/api/v1/design-system/typography-scales/{id}Einzelne Skala abrufen
PUT/api/v1/design-system/typography-scales/{id}Skala aktualisieren
DELETE/api/v1/design-system/typography-scales/{id}Skala löschen

Das Font-Objekt

{ "id": "font_abc123", "organizationId": "org_xyz789", "name": "Inter", "family": "Inter, system-ui, sans-serif", "category": "sans-serif", "source": "google", "weights": [400, 500, 600, 700], "styles": ["normal", "italic"], "usage": { "heading": true, "body": true, "code": false }, "cssImport": "@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');", "createdAt": "2026-01-10T08:00:00Z" }

Attribute

AttributTypBeschreibung
idstringEindeutige Font-ID
namestringSchriftname
familystringCSS font-family Stack
categorystringsans-serif, serif, monospace, display
sourcestringgoogle, adobe, custom, system
weightsarrayVerfügbare Schriftstärken
stylesarrayVerfügbare Stile
usageobjectVerwendungszweck
cssImportstringCSS-Import Statement

Das TypographyScale-Objekt

{ "id": "typo_abc123", "organizationId": "org_xyz789", "name": "default", "baseSize": 16, "scaleRatio": 1.25, "sizes": { "xs": { "size": 12, "lineHeight": 1.5, "letterSpacing": 0 }, "sm": { "size": 14, "lineHeight": 1.5, "letterSpacing": 0 }, "base": { "size": 16, "lineHeight": 1.5, "letterSpacing": 0 }, "lg": { "size": 18, "lineHeight": 1.5, "letterSpacing": -0.01 }, "xl": { "size": 20, "lineHeight": 1.4, "letterSpacing": -0.01 }, "2xl": { "size": 24, "lineHeight": 1.35, "letterSpacing": -0.02 }, "3xl": { "size": 30, "lineHeight": 1.3, "letterSpacing": -0.02 }, "4xl": { "size": 36, "lineHeight": 1.25, "letterSpacing": -0.03 }, "5xl": { "size": 48, "lineHeight": 1.2, "letterSpacing": -0.03 } }, "headingFont": "font_abc123", "bodyFont": "font_abc123", "codeFont": "font_mono456" }

Schriftart erstellen

POST /api/v1/design-system/fonts

Google Fonts

{ "organizationId": "org_xyz789", "name": "Poppins", "source": "google", "weights": [400, 500, 600, 700], "styles": ["normal"], "usage": { "heading": true, "body": false } }

Custom Font

{ "organizationId": "org_xyz789", "name": "MyBrandFont", "source": "custom", "family": "'MyBrandFont', sans-serif", "files": [ { "weight": 400, "style": "normal", "url": "https://cdn.example.com/fonts/mybrand-regular.woff2" }, { "weight": 700, "style": "normal", "url": "https://cdn.example.com/fonts/mybrand-bold.woff2" } ] }

Typografie-Skala erstellen

POST /api/v1/design-system/typography-scales

Request-Body

{ "organizationId": "org_xyz789", "name": "compact", "baseSize": 14, "scaleRatio": 1.2, "generateSizes": true, "headingFont": "font_abc123", "bodyFont": "font_def456" }

Skalen-Verhältnisse

NameVerhältnisBeschreibung
Minor Second1.067Sehr subtil
Major Second1.125Subtil
Minor Third1.2Kompakt
Major Third1.25Standard
Perfect Fourth1.333Größere Abstufung
Augmented Fourth1.414Auffällig
Perfect Fifth1.5Sehr auffällig
Golden Ratio1.618Dramatisch

CSS-Export

:root { /* Font Families */ --font-heading: 'Inter', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif; --font-code: 'JetBrains Mono', monospace; /* Font Sizes */ --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem; --text-4xl: 2.25rem; --text-5xl: 3rem; /* Line Heights */ --leading-tight: 1.25; --leading-normal: 1.5; --leading-relaxed: 1.75; }

Verfügbare System-Fonts

{ "success": true, "data": [ { "name": "System UI", "family": "system-ui, sans-serif" }, { "name": "Arial", "family": "Arial, sans-serif" }, { "name": "Georgia", "family": "Georgia, serif" }, { "name": "Times New Roman", "family": "'Times New Roman', serif" }, { "name": "Courier New", "family": "'Courier New', monospace" } ] }

Fehler

CodeBeschreibung
400Ungültige Schriftkonfiguration
401Nicht authentifiziert
403Keine Berechtigung
404Schriftart/Skala nicht gefunden

Nächste Schritte