Reputation: 2443
I am trying to create an app that takes all english characters in users own handwriting via a physical scanner and converts it into a .ttf
file. I want to do this programmatically without using any font editor like FontForge.
So can anyone tell me what are the contents in a .ttf
file? I opened up a .ttf
file on my MacBook Pro FontBook.app
and saw only characters written in that particular style. But how were they written in that .ttf
file? Any idea? please help.
Upvotes: 1
Views: 2477
Reputation: 1633
The TTF specification has all of the details regarding how TTF files can be laid out. It is 90 pages long https://www.microsoft.com/typography/tt/ttf_spec/ttch02.doc.
To answer your question: The first three pages of that document give you the basic file structure.
As you work through the specification it may be helpful to open an existing TTF file in a hex editor so you can walk through and see the actual bytes that make up a TTF.
A much more practical approach would be to use an existing library. A quick Google search led me to Fontastic http://code.andreaskoller.com/libraries/fontastic/ which looks (in my opinion) hundreds of times easier than manually creating your own TTF file.
Upvotes: 2