Skip to content
AaroophanPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Text-to-Multi-Path SVG Converter

This project provides a FastAPI-based API that converts text into SVG with individual path elements for each character component.

Features

  • 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

Project Structure

/
β”œβ”€β”€ 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

Getting Started

Prerequisites

  • Node.js 16+
  • Python 3.8+
  • npm or yarn

Installation

  1. Clone the repository
  2. Install frontend dependencies:
npm install
  1. Install backend dependencies:
pip install -r requirements.txt

Running the Application

  1. Start the FastAPI backend:
cd server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
  1. Start the React frontend:
npm run dev
  1. Open your browser and navigate to https://aaroophan.github.io/SVG-ify

API Usage

Endpoint

POST /text-to-path

Request Body

{
  "text": "Hello",
  "font_size": 40,
  "fill_color": "#000000",
  "font_data": "base64EncodedTTF/OTF"
}

Response

{
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 300 80\">...</svg>"
}

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages