Anpassungen
This commit is contained in:
@@ -96,6 +96,9 @@ const PerformanceOptimizedFontCard = forwardRef(({
|
||||
const getFontStyle = useCallback((name) => {
|
||||
const baseStyle = { wordBreak: "break-word", lineHeight: "1.3", willChange: "auto" };
|
||||
const fontEntry = fontTransforms[name];
|
||||
if (!fontEntry) {
|
||||
console.warn(`Font definition missing for ${name}`);
|
||||
}
|
||||
if (!fontEntry) return baseStyle;
|
||||
|
||||
const style = { ...baseStyle };
|
||||
|
||||
@@ -25,24 +25,25 @@ const createTransform = (blockKey) => (text) =>
|
||||
|
||||
// 3) Font-Definitionen
|
||||
const fontList = [
|
||||
"abril-fatface", "alegreya", "alfa-slab-one", "almendra", "amatic-sc", "andika",
|
||||
"architects-daughter", "audiowide", "averia-libre", "bebas-neue", "black-ops-one",
|
||||
"caveat", "cinzel-decorative", "courgette", "dancing-script", "exo", "fjalla-one",
|
||||
"germania-one", "glass-antiqua", "gloria-hallelujah", "great-vibes", "holtwood-one-sc",
|
||||
"indie-flower", "italiana", "jost", "kaushan-script", "lato", "metal-mania", "montserrat",
|
||||
"neucha", "noto-sans", "open-sans", "orbitron", "oswald", "pacifico", "permanent-marker",
|
||||
"philosopher", "playfair-display", "poppins", "press-start-2p", "questrial", "quicksand",
|
||||
"rajdhani", "raleway", "righteous", "roboto", "sacramento", "satisfy", "space-mono",
|
||||
"spectral", "staatliches", "stint-ultra-condensed", "syncopate", "ultra", "unica-one",
|
||||
"work-sans", "yellowtail"
|
||||
"Abril Fatface", "Alegreya", "Alfa Slab One", "Almendra", "Amatic SC", "Andika",
|
||||
"Architects Daughter", "Audiowide", "Averia Libre", "Bebas Neue", "Black Ops One",
|
||||
"Caveat", "Cinzel Decorative", "Courgette", "Dancing Script", "Exo", "Fjalla One",
|
||||
"Germania One", "Glass Antiqua", "Gloria Hallelujah", "Great Vibes", "Holtwood One SC",
|
||||
"Indie Flower", "Italiana", "Jost", "Kaushan Script", "Lato", "Metal Mania", "Montserrat",
|
||||
"Neucha", "Noto Sans", "Open Sans", "Orbitron", "Oswald", "Pacifico", "Permanent Marker",
|
||||
"Philosopher", "Playfair Display", "Poppins", "Press Start 2P", "Questrial", "Quicksand",
|
||||
"Rajdhani", "Raleway", "Righteous", "Roboto", "Sacramento", "Satisfy", "Space Mono",
|
||||
"Spectral", "Staatliches", "Stint Ultra Condensed", "Syncopate", "Ultra", "Unica One",
|
||||
"Work Sans", "Yellowtail"
|
||||
];
|
||||
|
||||
// 4) Kategorie-Regeln (vereinfacht)
|
||||
// 4) Kategorie-Regeln (angepasst an neue Namen)
|
||||
const getCategory = (name) => {
|
||||
if (["caveat", "dancing-script", "pacifico", "amatic-sc", "kaushan-script", "courgette", "great-vibes", "satisfy", "sacramento", "neucha", "gloria-hallelujah", "almendra", "indie-flower", "architects-daughter"].includes(name)) return "handwriting";
|
||||
if (["bebas-neue", "black-ops-one", "holtwood-one-sc", "abril-fatface", "playfair-display", "permanent-marker", "alfa-slab-one", "germania-one", "oswald", "stint-ultra-condensed"].includes(name)) return "statement";
|
||||
if (["exo", "orbitron", "audiowide", "rajdhani", "space-mono", "questrial", "syncopate", "unica-one", "italiana", "staatliches"].includes(name)) return "futuristic";
|
||||
if (["press-start-2p", "righteous", "metal-mania", "alegreya", "spectral", "fjalla-one", "glass-antiqua", "cinzel-decorative", "andika"].includes(name)) return "aesthetic";
|
||||
const normalizedName = name.toLowerCase().replace(/ /g, "-");
|
||||
if (["caveat", "dancing-script", "pacifico", "amatic-sc", "kaushan-script", "courgette", "great-vibes", "satisfy", "sacramento", "neucha", "gloria-hallelujah", "almendra", "indie-flower", "architects-daughter"].includes(normalizedName)) return "handwriting";
|
||||
if (["bebas-neue", "black-ops-one", "holtwood-one-sc", "abril-fatface", "playfair-display", "permanent-marker", "alfa-slab-one", "germania-one", "oswald", "stint-ultra-condensed"].includes(normalizedName)) return "statement";
|
||||
if (["exo", "orbitron", "audiowide", "rajdhani", "space-mono", "questrial", "syncopate", "unica-one", "italiana", "staatliches"].includes(normalizedName)) return "futuristic";
|
||||
if (["press-start-2p", "righteous", "metal-mania", "alegreya", "spectral", "fjalla-one", "glass-antiqua", "cinzel-decorative", "andika"].includes(normalizedName)) return "aesthetic";
|
||||
return "modern";
|
||||
};
|
||||
|
||||
@@ -56,14 +57,14 @@ const blockForCategory = {
|
||||
|
||||
export const fontTransforms = Object.fromEntries(
|
||||
fontList.map((font) => {
|
||||
const name = font.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
|
||||
const normalizedFont = font.toLowerCase().replace(/ /g, "-");
|
||||
const category = getCategory(font);
|
||||
const block = blockForCategory[category];
|
||||
return [name, {
|
||||
return [font, {
|
||||
transform: createTransform(block),
|
||||
category,
|
||||
description: `${name} – Unicode-Stil automatisch zugewiesen` ,
|
||||
className: `font-${font}`
|
||||
description: `${font} – Unicode-Stil automatisch zugewiesen`,
|
||||
className: `font-${normalizedFont}`
|
||||
}];
|
||||
})
|
||||
);
|
||||
@@ -72,8 +73,8 @@ export const transformText = (text, fontName) => {
|
||||
const font = fontTransforms[fontName];
|
||||
if (!font || !text) return { transformed: text, fontClassName: "" };
|
||||
return {
|
||||
transformed: font.transform(text),
|
||||
fontClassName: font.className
|
||||
transformed: font.transform(text), // Unicode-Transformation anwenden
|
||||
fontClassName: font.className // Tailwind-Klasse für Font-Familie
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user