KaniyamFoundation / ProjectIdeas

A Place to write down the project ideas and to plan them
40 stars 3 forks source link

Create a TTF from handwritten text #106

Open tshrinivasan opened 4 years ago

tshrinivasan commented 4 years ago

https://www.calligraphr.com is a good website that converts your handwritten text into a FONT TTF file.

They provide a template page with alphabets. You have to print, write all characters on that paper scan it. upload to that website.

booom.

The TTF file is ready.

We have to bring a Free/Open Source version of this application. It can be a commandline, web or desktop application.

They support for multiple languages including Tamil. But the template for tamil is not enough.

The Tamil TTF file created with this template is missing lot of tamil characters.

image

We need a 3-4 pages of template with more and required letters. so that we can add all letters for Tamil.

We can make the entire process of building TTF file from handwritten pages of templates, using python to split the images and fontforge to create TTF file.

FontForge is a wonderful open source software. It can automate all the things we do manually.

Sharing the whole idea here.

Create a template for Tamil with 3-4 pages, with all required letters, along with english(small,CAPS) and numbers. Print it Write all letters scan or Take photo of it. Process it via python code to cut into individual boxes Use the below fontforge to make TTF file with all images in a folder.

Filename: generate-ttf-file-from-images.pe

!/usr/bin/fontforge

New() Import("/home/shrinivasan/Desktop/test-font/uni*.png",1) SelectAll() AutoTrace() ScaleToEm(1024) Generate("a.ttf") Save("a.sfd")

Links

  1. Python code to split the template into individual images https://github.com/suddharshan/slicing-one-image-into-many-parts

Works for english well. Have to fine tune for our custom 3-4 page tamil template

My neighbor sudharsan did it so quickly on my request.

  1. http://scruss.com/blog/2010/05/09/creating-a-truetype-font-from-your-handwriting-with-your-scanner-your-printer-and-fontforge/

Same process explained well

  1. https://saranyaselvaraj.wordpress.com/2009/09/29/creating-tamil-fonts/ My friend malathy wrote long time ago, on our KanchiLUG golden days, on how to make tamil fonts.

4.http://designwithfontforge.com/en-US/index.html Good book in designing fonts using fontforge. will be good if you or someone writes for tamil.

  1. We can automate all the things we do in fontforge using its scripting. http://fontforge.github.io/en-US/tutorials/scripting/
tshrinivasan commented 4 years ago

Template_01(1).pdf

Here is a template for tamil done by Udhayan.

Template_03.pdf

Added letters to test the flow.

Working on splitting into individual images.

suddharshan commented 4 years ago

here is the code to split the new tamil template image https://github.com/suddharshan/image-slicing-tamil

Shreeshrii commented 4 years ago

Some scripts that may be useful for the project:

https://github.com/osp/osp.tools.fons A recipe to make fonts out of bitmap images.

https://github.com/osp/osp.tools.fons/tree/master/glyphtracer-1.4 Glyphtracer takes an image that contains pictures of several letters. It recognizes all them and lets the user tag each letter to a Unicode code point. It then converts the images to vector form and writes them to a FontForge's data format. The font can then be finalized with FontForge.

For Tamil, the Tamil Glyph List will need to be added to https://github.com/osp/osp.tools.fons/blob/master/glyphtracer-1.4/gtlib.py

Possible source for glyph list https://github.com/adobe-fonts/source-tamil-sans/blob/master/GlyphOrderAndAliasDB

Shreeshrii commented 4 years ago

Import("/home/shrinivasan/Desktop/test-font/uni*.png",1)

Bulk import of uni*.png files does not work. Convert them to vector .svg format.