This project provides a FastAPI-based API that converts text into SVG with individual path elements for each character component.
- FastAPI endpoint for text-to-SVG conversion
- Granular SVG paths for each character component
- TTF/OTF font support via base64 encoding
- Proper character spacing and alignment
- React-based UI for easy testing and visualization
/
βββ src/ # React frontend
β βββ App.tsx # Main application component
β βββ main.tsx # Entry point
β βββ index.css # Tailwind CSS styles
β
βββ server/ # FastAPI backend
β βββ main.py # FastAPI application entry point
β βββ models.py # Pydantic models for request/response
β βββ font_parser.py # Font parsing logic
β βββ svg_generator.py # SVG generation logic
β
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Node.js 16+
- Python 3.8+
- npm or yarn
- Clone the repository
- Install frontend dependencies:
npm install- Install backend dependencies:
pip install -r requirements.txt- Start the FastAPI backend:
cd server
uvicorn main:app --reload --host 0.0.0.0 --port 8000- Start the React frontend:
npm run dev- Open your browser and navigate to
https://aaroophan.github.io/SVG-ify
POST /text-to-path
{
"text": "Hello",
"font_size": 40,
"fill_color": "#000000",
"font_data": "base64EncodedTTF/OTF"
}{
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 300 80\">...</svg>"
}MIT