Skip to content

feat: Add Vietnamese Font Generator - AI-powered font Vietnamization tool - #1

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778816099-viet-font-app
Open

feat: Add Vietnamese Font Generator - AI-powered font Vietnamization tool#1
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778816099-viet-font-app

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Vietnamese Font Generator

A new web application that uses AI (Google Gemini or OpenAI ChatGPT) to analyze font styles and generate Vietnamese diacritical marks for existing fonts, following the Google Fonts diacritics guidelines.

How it works

  1. User uploads a font file (.ttf/.otf) and optional sample images
  2. App analyzes the font to identify missing Vietnamese characters (134+ precomposed chars)
  3. AI vision analyzes the font style from sample images (weight, contrast, terminals, construction)
  4. For characters composable from existing glyphs (base + combining marks), composite glyphs are created
  5. For fully missing characters, AI generates SVG path data matching the font's style
  6. Modified font is exported as TTF for download

Key features

  • Dual AI support: Google Gemini 2.0 Flash and OpenAI GPT-4o
  • Smart composite generation: Uses existing base+mark glyphs when available
  • Complete Vietnamese charset: All 134+ precomposed Vietnamese characters
  • Google Fonts compliant: Anchor-based mark positioning, GDEF classification, stacked diacritics
  • Clean web UI: Drag-and-drop upload, real-time font analysis, progress tracking
  • RESTful API: Analyze, generate, and download endpoints

Files added

  • viet-font-app/backend/main.py - FastAPI application with all endpoints
  • viet-font-app/backend/ai_client.py - Gemini and OpenAI API integration
  • viet-font-app/backend/font_processor.py - Font manipulation using fonttools
  • viet-font-app/backend/vietnamese.py - Vietnamese character data and Unicode mappings
  • viet-font-app/frontend/index.html - Web UI
  • viet-font-app/frontend/style.css - Styling
  • viet-font-app/frontend/app.js - Frontend logic
  • viet-font-app/requirements.txt - Python dependencies
  • viet-font-app/README.md - Documentation

Type of change

  • New feature
  • Non-breaking change

Link to Devin session: https://app.devin.ai/sessions/ba04c50e3b4344f89ec82b2d634026a2
Requested by: @TanUIUX

AI-powered tool for adding Vietnamese diacritical marks to existing fonts.

Features:
- Support for Gemini and OpenAI (ChatGPT) API providers
- Font analysis showing missing Vietnamese characters
- Composite glyph generation using existing base+mark glyphs
- AI-generated SVG path glyphs for missing characters
- Follows Google Fonts diacritics guidelines (anchors, GDEF, stacked marks)
- Full Vietnamese character set (134+ precomposed characters)
- Clean drag-and-drop web UI with progress tracking
- TTF export with download

Tech stack: FastAPI + fonttools + vanilla HTML/CSS/JS

Co-Authored-By: adamer <adamer@hunght1890.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

Test Results - Vietnamese Font Generator

Tested the app end-to-end locally at localhost:8000. Devin session

Core Flow: Upload → Analyze → Generate → Download (all passed)
  • Font analysis (missing chars): Uploaded Roboto with 90 Vietnamese chars stripped → correctly showed Missing Vietnamese=90, Total Glyphs=1326, UPM=2048
  • Font analysis (complete font): Uploaded complete Roboto → correctly showed Missing Vietnamese=0, "All Vietnamese characters are present!"
  • Composite glyph generation: Generated all 90 missing Vietnamese characters as composite glyphs (base + combining marks) without needing AI API call. Results: Generated=90, Failed=0
  • Font download: Downloaded vietnamized_font_7bc8a979.ttf (480 KB). Verified with fonttools that all 90 Vietnamese characters are present in the output

Generation results

UI Tests (all passed)
  • Generate button enable/disable: Disabled without API key, enabled with key, disabled again when cleared
  • AI provider switching: Gemini selected by default, OpenAI selected after click (blue border toggles correctly)
  • File info display: Shows filename and size, Remove button works, hidden attribute respected
Not Tested (no API keys available)
  • AI vision analysis (Gemini/OpenAI) for font style detection
  • AI-powered SVG glyph generation for characters that can't be composed from existing base+mark glyphs
  • Sample image upload and processing

Co-Authored-By: adamer <adamer@hunght1890.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant