Spaces:
Sleeping
Sleeping
Commit
Β·
1af44fa
1
Parent(s):
5fa28b9
Add initial README.md with project details, features, installation instructions, and usage guidelines
Browse files
README.md
CHANGED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Text2Pen
|
| 3 |
+
emoji: ποΈ
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.25.0"
|
| 8 |
+
app_file: main.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# βοΈ Text2Pen
|
| 13 |
+
|
| 14 |
+
A modern, customizable tool to convert your typed text into realistic handwriting on A4 paper.
|
| 15 |
+
Supports multi-column layouts, handwriting font selection, background customization, color, jitter, and moreβall with a clean Gradio web UI.
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## π Features
|
| 20 |
+
|
| 21 |
+
- **Modern Gradio Web UI**: Easy-to-use, clean, and responsive.
|
| 22 |
+
- **Direct Text Input or File Upload**: Paste text or upload `.txt` files.
|
| 23 |
+
- **Handwriting Fonts**: Choose from built-in fonts or upload your own `.ttf`.
|
| 24 |
+
- **Backgrounds**: Use blank, ruled, or custom backgrounds.
|
| 25 |
+
- **Multi-Column Layout**: Split your page into 1, 2, or 3 columns.
|
| 26 |
+
- **Customizable**: Font size, line spacing, margin, color, jitter, and more.
|
| 27 |
+
- **Preview & Download**: Preview pages as images, download as PDF (generated on demand).
|
| 28 |
+
- **A4 Output**: Perfect for cheat sheets, study notes, or printing.
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## πΈ Screenshots
|
| 33 |
+
|
| 34 |
+
### Main UI
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
|
| 38 |
+
### Customization Tab
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
### Example Output
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
|
| 46 |
+
### Multi Column Layout
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## π οΈ Installation
|
| 53 |
+
|
| 54 |
+
1. **Clone the repository:**
|
| 55 |
+
```sh
|
| 56 |
+
git clone https://github.com/yourusername/Text2Pen.git
|
| 57 |
+
cd Text2Pen
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
2. **Install dependencies:**
|
| 61 |
+
```sh
|
| 62 |
+
pip install -r requirements.txt
|
| 63 |
+
```
|
| 64 |
+
*Requirements: `gradio`, `pillow`*
|
| 65 |
+
|
| 66 |
+
3. **(Optional) Add Fonts/Backgrounds:**
|
| 67 |
+
- Place `.ttf` fonts in the `fonts/` folder.
|
| 68 |
+
- Place background images in the `backgrounds/` folder.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## π Usage
|
| 73 |
+
|
| 74 |
+
### Start the App
|
| 75 |
+
|
| 76 |
+
```sh
|
| 77 |
+
python main.py
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
- The Gradio UI will open in your browser.
|
| 81 |
+
- Enter or upload your text, customize options, and generate handwriting.
|
| 82 |
+
|
| 83 |
+
### Output
|
| 84 |
+
|
| 85 |
+
- **Preview**: See generated pages as images.
|
| 86 |
+
- **Download PDF**: Click "Generate & Download PDF" to get a PDF (temporary file, not saved).
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## π Project Structure
|
| 91 |
+
|
| 92 |
+
```
|
| 93 |
+
Text2Pen/
|
| 94 |
+
β
|
| 95 |
+
βββ main.py
|
| 96 |
+
βββ README.md
|
| 97 |
+
βββ requirements.txt
|
| 98 |
+
βββ fonts/
|
| 99 |
+
β βββ QEJulianDean.ttf
|
| 100 |
+
β βββ QEKevinKnowles.ttf
|
| 101 |
+
βββ backgrounds/
|
| 102 |
+
β βββ ruled_a4.png
|
| 103 |
+
βββ generated/
|
| 104 |
+
β βββ images/
|
| 105 |
+
β βββ pdfs/
|
| 106 |
+
βββ sample_ui_1.png
|
| 107 |
+
βββ sample_ui_2.png
|
| 108 |
+
βββ sample_output_page.png
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## βοΈ Customization
|
| 114 |
+
|
| 115 |
+
- **Fonts**: Add your own `.ttf` files to the `fonts/` folder or upload via the UI.
|
| 116 |
+
- **Backgrounds**: Add PNG/JPG backgrounds to the `backgrounds/` folder or upload via the UI.
|
| 117 |
+
- **Advanced Options**: Adjust font size, line spacing, margin, jitter, columns, and color in the Customization tab.
|
| 118 |
+
|
| 119 |
+
---
|
| 120 |
+
|
| 121 |
+
## π Notes
|
| 122 |
+
|
| 123 |
+
- PDF files are generated as temporary files and are not stored permanently.
|
| 124 |
+
- Images are saved in `generated/images/` for preview purposes.
|
| 125 |
+
- For best results, use high-quality handwriting fonts and A4-sized backgrounds.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## π License
|
| 130 |
+
|
| 131 |
+
Apache License 2.0
|
| 132 |
+
|
| 133 |
+
---
|
| 134 |
+
|
| 135 |
+
## π Credits
|
| 136 |
+
|
| 137 |
+
- [Gradio](https://gradio.app/)
|
| 138 |
+
- [Pillow](https://python-pillow.org/)
|
| 139 |
+
- Handwriting fonts from [Google Fonts](https://fonts.google.com/) and [DaFont](https://www.dafont.com/)
|
| 140 |
+
|
| 141 |
+
---
|
| 142 |
+
|
| 143 |
+
## π‘ Example Use Cases
|
| 144 |
+
|
| 145 |
+
- Micro cheat sheets for exams
|
| 146 |
+
- Study notes that look handwritten
|
| 147 |
+
- Generating realistic handwritten letters
|
| 148 |
+
- Printing custom notes for planners or journals
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## π€ Contributing
|
| 153 |
+
|
| 154 |
+
Pull requests and suggestions are welcome!
|
| 155 |
+
|
| 156 |
+
---
|
| 157 |
+
|
| 158 |
+
## π§ Contact
|
| 159 |
+
Add commentMore actions
|
| 160 |
+
For questions or feedback, open an issue or contact [subhashbs36@gmail.com](mailto:subhashbs36@gmail.com).
|