Hacker News new | past | comments | ask | show | jobs | submit login

You can actually achieve pretty good results without even using different versions of letters. I did an experiment with this a few years ago when I was playing with an idea of a tool to produce artificial hand-lettering for comics.

Here's the basic algorithm:

1. Generate two maps of low frequency noise. Perlin noise would probably work well, but just blurred noise will do. If we're thinking in terms of blurring, the radius should be on the order of x-height/2. Call that scale "S". One map is for X and one is for Y.

2. Convert the text to Bézier curves.

3. Process those curves, subdividing any long curve segments until they are no longer than S.

4. Now, process the curves again, and for each point, look up the corresponding point in your two maps. Displace the point's position according to the map value, with maximum distance somewhere on the order of S/4.

5. Render the new curves.

The parameters would need to be tweaked (I'm reporting them from vague memory), but that basic outline can provide surprisingly convincing results when applied to a handwriting font. Note that I did not mention what order of Bézier curve to use. You can get good results even by converting to polygons, but the segment length will need to be shorter.




Hey, have any examples you could upload so we could see? Even if it is just an image dumped into dropbox? I'd love to see how it turned out.


Unfortunately, I don't think I do have any. If I get motivated and have time, I'll try to reïmplement it as a JS demo.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: