frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I built a tool to turn handwriting into a font with PyTorch/OpenCV

https://handfonted.xyz/
2•reshamgaire•7mo ago
Hey HN,

For the last few months, I've been working on a personal project called HandFonted, and I'm excited to share the result with you all. The goal was to build a fully automated pipeline that could take a single image of a person's handwritten alphabets and generate a usable .ttf font file.

You can try it here: https://handfonted.xyz And the code is open-source here: https://github.com/reshamgaire/HandFonted

The Technical Stack and Workflow: The process is broken down into three main stages:

1. Segmentation (OpenCV): The user uploads an image. I use a series of OpenCV functions to process it: resizing for consistency, adaptive Gaussian thresholding to handle lighting variations, and morphological operations (opening/dilation) to clean up noise. Contours are then detected to isolate each character. I also added a small heuristic to merge dots with their parent 'i' and 'j' bodies by checking for components that are close and vertically aligned.

2. Classification (PyTorch): This is the machine learning core. The segmented character images are fed into a custom-built CNN. I experimented with a few architectures and landed on a hybrid model that combines concepts from ResNet (residual blocks for deep training) and Inception (parallel convolutions of different kernel sizes). The model was trained on a dataset of character images to classify each of the 52 uppercase and lowercase letters.

3. Font Generation (fontTools & scikit-image): Once a character is classified, the real fun begins. First, the bitmap image is skeletonized using scikit-image. A distance transform is then applied to the skeleton to create a stroke of uniform thickness. skimage.measure.find_contours is used to trace the outline of this new, clean character, converting it from a raster image to a set of vector coordinates. Finally, I use the fontTools library to programmatically build the font. It takes the vector outlines, converts them into TTF-compatible glyphs, and inserts them into a base font file, replacing the original glyph data and adjusting metrics like side-bearing and advance width.

Challenges & Learnings: The biggest challenge was glyph metrics. Simply plopping a new character shape into a font file doesn't work. I had to write logic to estimate a reasonable LSB (Left Side Bearing) and advance width to make the font somewhat usable for typing, though it's still an area for improvement. Training a robust classification model that works on varied handwriting styles was tough. Data augmentation was key here. The project was a fantastic deep dive into some classic computer vision problems and the surprisingly complex world of font file structures.

I built this because I thought it was a cool problem to solve. It's completely free and open source. I would love to hear any feedback you have, especially on the technical implementation. Happy to answer any questions!

Google in Your Terminal

https://gogcli.sh/
1•johlo•1m ago•0 comments

Shannon: Claude Code for Pen Testing

https://github.com/KeygraphHQ/shannon
1•hendler•1m ago•0 comments

Anthropic: Latest Claude model finds more than 500 vulnerabilities

https://www.scworld.com/news/anthropic-latest-claude-model-finds-more-than-500-vulnerabilities
1•Bender•6m ago•0 comments

Brooklyn cemetery plans human composting option, stirring interest and debate

https://www.cbsnews.com/newyork/news/brooklyn-green-wood-cemetery-human-composting/
1•geox•6m ago•0 comments

Why the 'Strivers' Are Right

https://greyenlightenment.com/2026/02/03/the-strivers-were-right-all-along/
1•paulpauper•7m ago•0 comments

Brain Dumps as a Literary Form

https://davegriffith.substack.com/p/brain-dumps-as-a-literary-form
1•gmays•7m ago•0 comments

Agentic Coding and the Problem of Oracles

https://epkconsulting.substack.com/p/agentic-coding-and-the-problem-of
1•qingsworkshop•8m ago•0 comments

Malicious packages for dYdX cryptocurrency exchange empties user wallets

https://arstechnica.com/security/2026/02/malicious-packages-for-dydx-cryptocurrency-exchange-empt...
1•Bender•8m ago•0 comments

Show HN: I built a <400ms latency voice agent that runs on a 4gb vram GTX 1650"

https://github.com/pheonix-delta/axiom-voice-agent
1•shubham-coder•9m ago•0 comments

Penisgate erupts at Olympics; scandal exposes risks of bulking your bulge

https://arstechnica.com/health/2026/02/penisgate-erupts-at-olympics-scandal-exposes-risks-of-bulk...
3•Bender•9m ago•0 comments

Arcan Explained: A browser for different webs

https://arcan-fe.com/2026/01/26/arcan-explained-a-browser-for-different-webs/
1•fanf2•11m ago•0 comments

What did we learn from the AI Village in 2025?

https://theaidigest.org/village/blog/what-we-learned-2025
1•mrkO99•11m ago•0 comments

An open replacement for the IBM 3174 Establishment Controller

https://github.com/lowobservable/oec
1•bri3d•14m ago•0 comments

The P in PGP isn't for pain: encrypting emails in the browser

https://ckardaris.github.io/blog/2026/02/07/encrypted-email.html
2•ckardaris•16m ago•0 comments

Show HN: Mirror Parliament where users vote on top of politicians and draft laws

https://github.com/fokdelafons/lustra
1•fokdelafons•16m ago•1 comments

Ask HN: Opus 4.6 ignoring instructions, how to use 4.5 in Claude Code instead?

1•Chance-Device•18m ago•0 comments

We Mourn Our Craft

https://nolanlawson.com/2026/02/07/we-mourn-our-craft/
1•ColinWright•20m ago•0 comments

Jim Fan calls pixels the ultimate motor controller

https://robotsandstartups.substack.com/p/humanoids-platform-urdf-kitchen-nvidias
1•robotlaunch•24m ago•0 comments

Exploring a Modern SMTPE 2110 Broadcast Truck with My Dad

https://www.jeffgeerling.com/blog/2026/exploring-a-modern-smpte-2110-broadcast-truck-with-my-dad/
1•HotGarbage•24m ago•0 comments

AI UX Playground: Real-world examples of AI interaction design

https://www.aiuxplayground.com/
1•javiercr•25m ago•0 comments

The Field Guide to Design Futures

https://designfutures.guide/
1•andyjohnson0•25m ago•0 comments

The Other Leverage in Software and AI

https://tomtunguz.com/the-other-leverage-in-software-and-ai/
1•gmays•27m ago•0 comments

AUR malware scanner written in Rust

https://github.com/Sohimaster/traur
3•sohimaster•30m ago•1 comments

Free FFmpeg API [video]

https://www.youtube.com/watch?v=6RAuSVa4MLI
3•harshalone•30m ago•1 comments

Are AI agents ready for the workplace? A new benchmark raises doubts

https://techcrunch.com/2026/01/22/are-ai-agents-ready-for-the-workplace-a-new-benchmark-raises-do...
2•PaulHoule•35m ago•0 comments

Show HN: AI Watermark and Stego Scanner

https://ulrischa.github.io/AIWatermarkDetector/
1•ulrischa•35m ago•0 comments

Clarity vs. complexity: the invisible work of subtraction

https://www.alexscamp.com/p/clarity-vs-complexity-the-invisible
1•dovhyi•36m ago•0 comments

Solid-State Freezer Needs No Refrigerants

https://spectrum.ieee.org/subzero-elastocaloric-cooling
2•Brajeshwar•37m ago•0 comments

Ask HN: Will LLMs/AI Decrease Human Intelligence and Make Expertise a Commodity?

1•mc-0•38m ago•1 comments

From Zero to Hero: A Brief Introduction to Spring Boot

https://jcob-sikorski.github.io/me/writing/from-zero-to-hello-world-spring-boot
1•jcob_sikorski•38m ago•1 comments