feat: port all template categories to JSON format
- Ported Minimalist templates to JSON (Swiss Grid, Brutalist, etc.) - Ported Tech templates to JSON (SaaS, Terminal, Cyberpunk, etc.) - Ported Creative templates to JSON (Art Gallery, Zine, Pop Art, etc.) - Ported Industrial templates to JSON (Blueprint, Factory, Schematic, etc.) - Ported Nature templates to JSON (Botanical, Ocean, Mountain, etc.) - Ported Lifestyle templates to JSON (Cookbook, Travel, Coffee House, etc.) - Ported Vintage templates to JSON (Art Deco, Medieval, Retro 80s, etc.) - Updated README.md to reflect the new JSON-based style system (example configuration and contribution workflow) - Completed migration of over 150 styles to the new architecture
This commit is contained in:
1275
src/utils/docxConverter.ts
Normal file
1275
src/utils/docxConverter.ts
Normal file
File diff suppressed because it is too large
Load Diff
34
src/utils/fontUtils.ts
Normal file
34
src/utils/fontUtils.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// Font utility functions
|
||||
|
||||
/**
|
||||
* Generate Google Fonts import URL for a list of fonts
|
||||
*/
|
||||
export const generateGoogleFontsImport = (fonts: string[]): string => {
|
||||
const familyParams = fonts
|
||||
.map(f => `family=${encodeURIComponent(f)}:wght@400;500;600;700`)
|
||||
.join('&');
|
||||
return `https://fonts.googleapis.com/css2?${familyParams}&display=swap`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Extract unique fonts from a style's word config
|
||||
*/
|
||||
export const extractFontsFromStyle = (wordConfig: {
|
||||
heading1: { font: string };
|
||||
heading2: { font: string };
|
||||
body: { font: string };
|
||||
}): string[] => {
|
||||
return Array.from(new Set([
|
||||
wordConfig.heading1.font,
|
||||
wordConfig.heading2.font,
|
||||
wordConfig.body.font
|
||||
])).filter(Boolean);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a font is available system-wide
|
||||
*/
|
||||
export const isSystemFont = (font: string): boolean => {
|
||||
const systemFonts = ['Arial', 'Georgia', 'Times New Roman', 'Courier New', 'Verdana'];
|
||||
return systemFonts.includes(font);
|
||||
};
|
||||
Reference in New Issue
Block a user