60 lines
1.6 KiB
Text
60 lines
1.6 KiB
Text
---
|
|
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
|
|
```
|