Skip to content

Commit 3f41763

Browse files
committed
2 parents c6279e0 + e146db2 commit 3f41763

File tree

8 files changed

+1343
-16
lines changed

8 files changed

+1343
-16
lines changed

.github/workflows/pages.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v4
34+
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: './docs'
39+
40+
# Deployment job
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ So no matter what device you use Obsidian on, you can customize your notes with
3939
- Custom CSS Style Support: You can apply the font to anywhere you want!
4040
- Ability to set custom font on specific pages (See [#7](https://github.com/pourmand1376/obsidian-custom-font/issues/7))
4141

42+
## Web-based Font Converter
43+
44+
**[🌐 Font to Base64 CSS Converter](https://pourmand1376.github.io/obsidian-custom-font/)**
45+
46+
Use our web-based tool to convert font files to base64-encoded CSS without installing the plugin! Perfect for users who want just the conversion functionality or experience performance issues with the full plugin.
47+
48+
Features:
49+
- Convert .woff, .ttf, .woff2, and .otf font files
50+
- Multiple CSS output options (Obsidian variables, custom classes, force styles)
51+
- Copy to clipboard or download CSS files
52+
- No installation required - works in any modern browser
53+
4254
## Issues and Pull-Requests
4355

4456
This idea of this plugin just recently came into my mind. I don't know what features would be useful to you. Issues and pull requests are highly appreciated.

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source: docs

docs/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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

Comments
 (0)