From 8508981848322470e381da378c2190ff4ee8dc95 Mon Sep 17 00:00:00 2001 From: Matt Troutman Date: Mon, 19 May 2025 11:57:00 -0500 Subject: [PATCH] Add font folder structure requirements and implementation guidelines --- .cursor/rules/font-folder-structure.mdc | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .cursor/rules/font-folder-structure.mdc diff --git a/.cursor/rules/font-folder-structure.mdc b/.cursor/rules/font-folder-structure.mdc new file mode 100644 index 0000000..a29dcf5 --- /dev/null +++ b/.cursor/rules/font-folder-structure.mdc @@ -0,0 +1,60 @@ +--- +description: +globs: +alwaysApply: false +--- +# Font Folder Structure Requirements + +## Required Directory Structure +Each font folder must follow this structure: +``` +font-[name]/ +├── ttf/ # For .ttf font files +├── otf/ # For .otf font files +├── web/ # For web fonts (.woff, .woff2, .eot, .svg) +└── other_files/ # For all other files and folders +``` + +## Rules +1. All font folders must start with the prefix `font-` +2. Only these four directories are allowed at the root level of each font folder +3. Any files or folders that don't match the required structure must be moved to `other_files/` +4. Font files must be organized by their extension: + - `.ttf` files → `ttf/` + - `.otf` files → `otf/` + - Web fonts (`.woff`, `.woff2`, `.eot`, `.svg`) → `web/` + - All other files → `other_files/` + +## Implementation +The cleanup script [cleanup_font_folders.py](mdc:.fontfoldercleanup/cleanup_font_folders.py) enforces these rules by: +1. Creating the required directory structure +2. Moving files to their appropriate locations +3. Handling nested directories by moving their contents to the correct locations +4. Removing empty directories after moving their contents + +## Example +Before: +``` +font-example/ +├── font.ttf +├── font.otf +├── font.woff +├── license.txt +└── docs/ + └── readme.md +``` + +After: +``` +font-example/ +├── ttf/ +│ └── font.ttf +├── otf/ +│ └── font.otf +├── web/ +│ └── font.woff +└── other_files/ + ├── license.txt + └── docs/ + └── readme.md +```