|
| 1 | +# Font to Base64 CSS Converter |
| 2 | + |
| 3 | +A web-based tool that converts font files (.woff, .ttf, .woff2, .otf) to base64-encoded CSS for use with Obsidian. This tool extracts the core font conversion functionality from the [Obsidian Custom Font Plugin](https://github.com/pourmand1376/obsidian-custom-font) and makes it available as a standalone web application. |
| 4 | + |
| 5 | +## Live Demo |
| 6 | + |
| 7 | +🌐 **[Use the converter here](https://pourmand1376.github.io/obsidian-custom-font/)** |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Multiple font format support**: .woff, .ttf, .woff2, and .otf files |
| 12 | +- **Drag & drop interface**: Easy file upload with visual feedback |
| 13 | +- **Multiple CSS output options**: |
| 14 | + - Default CSS (Obsidian CSS variables) |
| 15 | + - Custom CSS class |
| 16 | + - Force style (applies to all elements) |
| 17 | +- **Batch processing**: Convert multiple fonts at once |
| 18 | +- **Copy to clipboard**: One-click copying of generated CSS |
| 19 | +- **Download option**: Save CSS as a file for later use |
| 20 | +- **Mobile friendly**: Responsive design that works on all devices |
| 21 | + |
| 22 | +## How to Use |
| 23 | + |
| 24 | +1. **Upload fonts**: Select or drag and drop your font files |
| 25 | +2. **Choose output format**: Select how you want the CSS structured |
| 26 | +3. **Convert**: Click the "Convert to CSS" button |
| 27 | +4. **Copy or download**: Get your base64-encoded CSS ready for use |
| 28 | + |
| 29 | +## For Obsidian Users |
| 30 | + |
| 31 | +1. Copy the generated CSS |
| 32 | +2. Save it as a `.css` file in your vault's `.obsidian/snippets/` folder |
| 33 | +3. Enable the CSS snippet in Obsidian's Appearance settings |
| 34 | + |
| 35 | +## Why Use This Tool? |
| 36 | + |
| 37 | +This web-based converter is perfect for: |
| 38 | +- Users who only need font conversion without the full plugin |
| 39 | +- Those experiencing performance issues with the complete plugin |
| 40 | +- Quick one-time font conversions |
| 41 | +- Users who prefer lightweight solutions |
| 42 | + |
| 43 | +## Technical Details |
| 44 | + |
| 45 | +The converter uses the same core logic as the Obsidian Custom Font Plugin: |
| 46 | +- Reads font files as ArrayBuffer |
| 47 | +- Converts to base64 encoding |
| 48 | +- Generates proper CSS @font-face declarations |
| 49 | +- Provides appropriate MIME types for each font format |
| 50 | + |
| 51 | +## Privacy |
| 52 | + |
| 53 | +All processing happens locally in your browser. Font files are never uploaded to any server, ensuring your fonts remain private and secure. |
| 54 | + |
| 55 | +## Related |
| 56 | + |
| 57 | +- [Obsidian Custom Font Plugin](https://github.com/pourmand1376/obsidian-custom-font) - The full plugin this tool is based on |
| 58 | +- [GitHub Issue #23](https://github.com/pourmand1376/obsidian-custom-font/issues/23) - The request that inspired this tool |
0 commit comments