Inspiration

A fellow hacker began the hackathon doing calligraphy homework, and I thought it would be really cool to be able to type in that font. Font-makers already exist online, but I have yet to encounter a mobile version. An app that allows you to draw your own font (or secret code) and save it online would be super helpful for all of the artsy pinterest-oriented font-lovers out there.

What it does

The user is prompted to carefully draw each English letter multiple times. The resulting images are converted into XML glyph format via iOS movement tracking (eventually, these glyphs can be assembled into a .svg file for an official UTF8 font). The different versions of each letter are analyzed and result in one final image for each letter, which is then added to the .ttf file template provided by http://www.myscriptfont.com/. The template can be saved to the user's camera roll. Further functionality includes the ability to type via a custom keyboard in your own handwriting.

How I built it

objective-c, git

Challenges I ran into

Going into this, I had no idea how complicated "font" files were. I had originally planned to make an app that uses an iOS OCR API to analyze user input, and then manually create a .ttf file. However, after researching .ttf files I found that they basically resemble executables - not the kind of file you can just open in vim... I spent at least an hour looking for an algorithm to manually convert an image or template to .ttf with no avail. Further research showed that there wasn't an iOS API for creating .ttf or .svg files. I met with an iOS mentor for guidance with file type conversions, who sent me to web dev. The web dev mentor and I tried to figure out how to send a post request to http://www.myscriptfont.com/, which theoretically would produce the desired .ttf, which turned out to be a huge mess because of one mysterious parameter in the url. I then was advised by various sponsors to investigate the use of .svg font files instead of .ttf (which can be opened in vim!). However, I have no prior experience with XML, and manually creating an OCR that produces a glyph object took a lot of research and diagrams. I've also been really frustrated by objective-c in general lately... NSUserDefaults absolutely refuses to accept my main data structure, and it's been a huge struggle to pass font information in this data structure between view controllers.

Accomplishments that I'm proud of

I'm really proud of the ability to create a glyph object from a physical iOS motion and the in-app custom keyboard.

What I learned

I learned a ton about file types, font making and the math behind it, and XML.

What's next for selfScript

Adding functionality to the tableview containing various fonts. Also eventually creating an iOS API for this kind of file conversion - I looked everywhere, they aren't around, and the world could really use one!

Built With

Share this project:

Updates