Heh, if I were to make a font based on my handwriting, it would almost work as some level of encryption on my blog; there’s certainly no way anyone would be able to read it.
When I was in elementary school (in the 80s) I used to fail handwriting over and over. My teacher told me "When you get older, if you want to work in an office, you're going to have to have to write a lot of reports, and for that you'll need good handwriting." to which I replied "No, I'm going to work on computers."
If I made a font based on my handwriting, it could be considered a type of one-way encryption.
I learned to touch type in 1986 on a manual typewriter in secondary school. I knew I was going to work with computers and figured touch typing would be a worthwhile skill. I was the only male in the class and copped shit from my peers for taking the subject as everyone else perceived it as a class for women looking to go into secretarial work. To this day I still think it is the best thing I learned at school.
I remember doing this as a new immigrant in Australia (92). We were too poor to get a computer and I didn't know how to use one either. So my parents got me taking a train to the nearest station closest to a public library so I could book out their typewriter (yep) for two hours every sat morning to practise touch typing!!
What a silly thing to tell people is "women's work". I wasn't born until 1990, but even in the 80's weren't personal computers a pretty common thing (e.g. the Apple ][, the Commodore 64, Amiga)? I wonder why a guy learning to type wouldn't appear useful to people?
One way encryption made me crackup. Also remembered something funny from college.
One of our mates had such a poor handwriting that we used to joke our grades were getting hit because teachers were exhausted after reading his answers. Same guy used to get frequent letters from his parents saying they could not understand what he wrote in the previous letter :)
I had the exact same thing happen to me, and I had the exact same response.
My print handwriting is pretty bad, and when I was in grade school in the 90s they were still trying to teach cursive, and my cursive is impressively illegible. My teacher told me that I'm "too smart" to be not work in a high-paying desk job, and that no one will hire me unless I have readable handwriting.
I know she meant well and I'm not in any way trying to speak ill of her since I think she was actually a really good teacher, but I seriously cannot imagine being declined for any job (other than calligrapher) because of handwriting, even in the 90s. My response to her was that I can type really fast and that typing will almost always be easier to read than virtually anyone's handwriting.
When I took calculus in high school, I initially did my work by hand, but pretty early on I learned how to use MathType with OpenOffice, and then eventually LaTeX. After I turned in one assignment that was typed out and subsequently turned in one that was handwritten, my teacher politely asked me if I could type out all my assignments since he had to occasionally bring his wife in the room to read my handwriting.
-----------
Nowadays I still do write down notes by hand with a fountain pen, but the nice thing about notes is that I'm the only one that needs to be able to read them. If I do almost literally anything that I expect people to read, I type it out, either in Markdown, LaTeX, or TLA+ (depending on the domain and how much math needs to be involved, of course).
That reminds me of certain kinds of medieval script. I had a professor in college whose dissertation made use of 12th century medical texts as primary sources. She told us about some of the frustrations with reading it.
Calligraphic letterforms of the time use this basic form called a “minnum” (possibly not the correct spelling), possibly so called because the word “minimum” can be written in lowercase using them exclusively. I think you know where I might be going here.
At one point, she went to her advisor for help, and he says in his broad, Scottish accent “Diane, count yer minna!” We all got a kick out of it.
The point (and the difference to just thoroughly commenting your code) is that you have one source file that equally serves as the basis for generating the actual program as well as its documentation. The link above shows the raw file, github renders it nicely if you go to the main page of the repository.
In my devops work, I've been using literate programming as part of my personal documentation. Org-mode gets a lot of hype here on HN, but I really get a lot of value out of Org, Org-Roam, and Org-Babel (org-babel is the bit that underpins the literate programming part of org)
Being able to see the code that generates certain tables in my older documentation really helps me to more quickly remember and use stuff I did months or years ago.
Example: The command to get a list of S3 buckets that have a particular attribute set. The command to do that might not make much sense by itself (say in a history grep) but with extra text describing what and why, I understand it faster.
I also use org-babel to do the same thing at work, most recently with convoluted AWS CLI commands with lots of JMESPath query syntax that I can never remember. I use it for personal documentation, but it can also can make for very nice looking documents that you can later share with your team during Sprint retrospectives, or perhaps convert to a Confluence page.
Yes exactly, export to HTML and paste into Confluence.
Although it is nice also to show off my Emacs setup during a screen share to a couple dozen people who don't know what it is. They treat the org-mode headlines, rearranging, todo items, schedules, etc, as some sort of magic. Org-babel with the results in a simple table kinda blew their minds. The number of project managers who want "my emacs setup" created for themselves was kinda funny, since they're all normally so focused on Microsoft Project or Jira.
Basically, tables rock, especially when you can use rectangle commands to copy and paste kerning values between classes you have to split up, and generating a test webpage programmatically is fun too. :D
Hahaha, I'm only just now emerging from the fog of raising a small child. She keeps telling me not to stay up late at night, I keep staying up at night because I want to do stuff...
I'v always liked the idea of literate programming, but I was always wondering how it actually feels in practice. Do they usual editor/IDE features still work like in a non-literate environment? – I assume it might work in Emacs, but are there other editors that support this approach?
Thinking about it, is Jupyter Notebooks (and the like) a form of literate programming?
Thinking even more about it, I think I actually used (or tried to) literate programming in a course about Machine Learning using R and – if I remember correctly – LaTeX to generate the actual application and a PDF.
Nothing inherent to Jupyter (it is not like Jupyter notebooks vs. Python REPL), just some niceties:
- low latency (it feels more responsive)
- interactive output (tqdm works)
- how Python objects are displayed by default
Essentially a good implementation of Python code blocks would reimplement half of Jupyter anyway.
It’s extremely widely used in the R world. The RStudio IDE has extensive tooling for the R Markdown format. https://rmarkdown.rstudio.com/
We don’t use the term “literate programming” much anymore, the concept of “reproducible reports” resonates much more with R users. But the experience is much the same.
It was disappointing to me when I recently found out that I couldn’t create Jupyter notebooks with vim. The on-disk format is JSON.
It sounds silly, but when there’s a lot of work do in terms of writing the literature part, and then adding the actual code part, I’m much happier with vim than I am with the browser based editor.
(This is for producing literate programs for the purpose of teaching others, not for my own benefit.)
In my view Jupiter notebooks can be, but must not be, a form of literate programming. Many tutorials take the form of a single juypter-notebook exaplaining concepts with code interleaved, which i would argue is a form of literate programming. But my data-exploration notebooks, mostly code and an abundance of plots with sparse comments interleaved, don't really resemble anything i would call literate programming.
Do you mean "need not be" rather than "must not be"? "Must not be" means they shouldn't ever be.
Most of my Jupyter notebooks are just code, but I've got some with long Latex mathematical derivations of formulas that appear in the code. I would actually like to be able to have that kind of thing in comments within the code itself. I don't do literate programming really though.
> I'v always liked the idea of literate programming, but I was always wondering how it actually feels in practice. Do they usual editor/IDE features still work like in a non-literate environment? – I assume it might work in Emacs, but are there other editors that support this approach?
In Org Mode, you get all the syntax highlightings and keybindings for whatever language's mode if you do literate programming with it.
What you won't get are things like being able to integrate your compilation failures, etc. As an example, if you write something that fails to compile, Emacs will not quickly be able to take you to the line that caused the failure. Similarly, things like linting, etc typically break.
Frustratingly, if you get an exception (e.g. "KeyError" in Python), it will not show the result of any print statements, so debugging is a bit painful.
I'm sure someone can solve these problems, but I don't know that anyone has.
Either some IDE like functionality doesn't work or syntax highlighting doesn't work after you go through additional complexity compared to simply starting a project.
It was really nice being able to break the program down into steps like generate the template, cut glyphs, etc. and be able to execute parts without worrying about how to reevaluate all the relevant parts of the code or what kind of functions I want to define. I'm beginning to really like noweb.
Sounds doable, suspiciously so. When I get rich and have a lot of time, I'll go through it just to figure out why ‘handwritten’ fonts don't ever include a dozen alternate sets of the same characters so the shapes actually vary—like when written by hand. Instead, I type out something like ‘na na na na na na na na na na na na na na na na Batman’ and observe the same ‘n’ and the same ‘a’ over and over.
From what I've read, the technology exists to build a font that would be a pretty convincing handwriting alternative. It would take a lot of effort, as it would n involve several glyph alternatives for each character, several variations of dozens of ligatures (joined glyphs) and randomness for selection. You could even do variants like slightly different spacing/sizing/positioning (no one writes perfectly straight).
Probably part of the issue is use case. Personal handwriting is kind of neat for a headline or call-out on a blog or something, but I wouldn't necessarily want to read a whole long post that way. I'm not really sure where else it would be useful - students trying to cheat on a "handwriting required" assignment, if that's even still a thing?
That feature is what I was talking about. However, alternates seem to be more-or-less commonplace for usual ligatures or, lately, for gimmicks like symbols in ‘programming fonts’—but pretty rarely employed for variety and randomness. Whenever I see a ‘handwritten’ font, I spot identical characters even in short runs of text.
As far as I (vaguely) know, alternates aren't intended to produce true randomness. So instead I would throw in sheer quantity of alternate glyphs, to put identical ones further apart and shuffle other ones more.
With the method from the posted article, producing the characters doesn't seem to take much effort. And the characters there aren't joined, so no need for traditional ligatures. Lastly, with a large number of alternates, kerning would add a lot of work—but then again, you don't really kern when writing with a pen, do you?
If the goal is to produce a simulation of handwriting then a font (which is a simulation of a case of metal blocks) seems like a bad starting point. Better to simulate a pen moving along a curve and then vary curve parameters (acceleration etc).
> a font (which is a simulation of a case of metal blocks)
In metal typesetting, a font is exactly a collection of metal blocks (which embody glyphs of a given design, size, and thickness). But on a computer, a font is a piece of software that renders text in a given typeface — simulating a pen moving along curves with varying parameters is entirely feasible. Not at all a bad starting point.
One of the things I want to do is to use autotrace centerline to get a basic stroke trace, and then manually tweak it so that drawing the glyphs makes sense. Then I can use that for SVG animations (there are Javascript tutorials for that), which I can use to help my kiddo learn how to write. (Whether I should teach her to forge my handwriting so early might be another matter... ;) )
Personal handwriting is used a lot in sales mailers. Except that it's totally fake, it looks like someone spent time on it. Same thing when they send you a letter with a post it on it. Looks real-ish.
Thank you! This answers one of my questions. But what about procedural generation — a new glyph every time, e.g. an interpolation of multiple prototypical shapes as described in that SE answer … something something eigenspace?
I know PostScript is Turing complete and thus assume a PS font can pull this off; does this extend to OpenType? Apparently yes: OpenType is pretty much a superset of PS (and TrueType, of course). Just searched the web for “opentype turing complete” and the second result led right back to HN[0]:
> OpenType is technically Turing Complete, however the usual way is to just cycle through letter form variations. — danielvf
So this answers my other question? Hold up, check this out: Another answer from that SE post you linked mentions the Beowolf [sic] font[1].
> FF Beowolf came about at the end of the dark and murky 1980s when Just van Rossum and Erik van Blokland found a way to hack PostScript fonts. When printed, each point in each letter on the page would move randomly, giving the letters a shaken, distraught appearance.
> […]
> while it worked fine (if a tad slow) through most of the 1990s, FF Beowolf was eventually barred from performing its PostScript magic: pesky things like printer drivers and operating systems learned to ignore the aberrations. FF Beowolf seemed destined to end up a mere memory. OpenType technology brought new hope, cutting new pathways in the type-tech continuum, which would eventually lead to a new generation of random fonts. Purists and typographic philosophers will be quick to point out that these OT fonts do not actually alter their shape in the printer as their forebearers did. Instead they make use of a kind of pre-programmed randomness: each glyph in each font (except R20) has ten alternate forms and a massive Faustian brain to control the mayhem.
What a rabbit hole! In this case, it seems we're back to “several variations”, but I still don't know whether full-on procedural generation is generally workable with OpenType. Does more modern technology's “ignorance” of “the aberrations” have to do with caching of glyph shapes? Is the Turing completeness curtailed to protect against DoS, decompression/logic bombs?
By the way, the type specimen on the FF Beowolf page I linked features an amusingly à propos quote:
> Im Rausch schreiben, nüchtern gegenlesen.
Write intoxicated, proofread sober.
> It would take a lot of effort, as it would n involve several glyph alternatives for each character, several variations of dozens of ligatures (joined glyphs) and randomness for selection.
Agreed, it's a silly amount of work — if you did it the brute force way. Which is exactly why I'm interested in smart procedural generation. You mentioned that such a style wouldn't be appropriate for running text, so infinite variability isn't important (and use cases where it would be important can be rather questionable).
However, even a curt headline often contains multiple Es or Ts or other Aoin Shrdlus[2]. And because the more appropriate use cases tend to involve above-average font sizes, word wrapping can conspire to place identical glyphs in close proximity. I think one wouldn't have to be a huge typography nerd to find one's suspension of disbelief in the pretense of hand lettering kind of shattered in the countenance of such a similitude. Not to mention homogeneous digraphs.
Having just a few alternate forms of each character totally solves that; no need for ligatures. But a font that gets by on just one prototype for each glyph would be even more efficient (less labour intensive).
To be consistent with me I’d need both of the common a’s, whatever they’re individually called
I think it’s because I like the curly-top “a” but habitually do the cursive-friendly “a”
edit: speaking of cursive friendly a’s I was doing a thing when carrying a paper note book for a few months, not too long ago, where’d I’d ask a friend or relative or maybe a stranger to write a-z in lowercase cursive. I probably collected 50+ of these
It collected both skilled and struggling to recall contributions. Certainly the oldest had the sleekest cursive
Little other things popped up, like the correct “b” and an incorrect “b” was fairly common to see
I think the built-in OTF support for contextual alternates still go by character pairs, so na na na will still look identical even if I can get ba na na to look slightly different. I can easily get SVG out of FontForge, though, and I've come across some programs that take text, randomize the glyphs used, and return an SVG. I might be able to figure out something like that. I probably won't go to that extent on my blog, but it may be fun to explore just for curiosity's sake
Ooh, another comment in this thread linked to something about cycling through alternate glyphs, which would work for the na na na case! I think that might work.
Oh man. I remember back in the 1990's, there was a company that you could fill in a grid with all the letters in your handwriting (block letters only), mail it to them, and for something like $50 they'd mail you back a floppy disk with a TrueType font of your handwriting a few weeks later.
These days, it occurs to me that with some kind of deep learning, you could probably take a couple dozen pages of someone's cursive, and turn it into a font with thousands of ligatures and variants that would be virtually entirely convincing.
I don't see this mentioned anywhere here, but there's a website I came across years ago that allows you to do the same, but you just scan the sheet instead of mailing.
Albeit it's not entirely free (pricewise or otherwise). I still think your second idea is better, where a learning algorithm "captures" handwriting and generates a font or more text with the same style. I can only imagine the implications in authenticity and forgery, though.
I came across that in 2005s, & obviously could not pay that much; so searched around for free ways to do that. Found an article which listed to download that your website's grid; write with a thick pen; scan & then use FontForge to convert it to a font. Lot of labour. But I did it; & still have that font; used on many paper forms.
Now recently few years ago I came across an app where you draw each letter on mobile; then it sends all data to its server & you get the font. It worked for few months, I made few variations of my handwriting, then its server stopped responding.
Now I have another font where few glyphs of my signatures (few variations), my logo, my initials are as font; & I use it to sign checks or forms or such.
In the mid-2000's I got a Toshiba Portégé convertible laptop off eBay for a few hundred bucks. It had an active digitizer built in and had some software that let you do something similar. It wasn't fancy enough to include alternates and it wasn't the best at connecting cursive, but if you mainly used print/non-script letters like I do, it was a neat trick to be able to use some semblance of my handwriting as a font in Windows.
There was a free website many years ago that I used, where you print out a form with blocks on it and write each letter, then scan it and upload it and it gets turned into a font. I can't seem to find it now (or maybe it went paid).
Microsoft has an app that lets you do this with a Windows tablet:
Yeah I was going to say...I did this in 2005. It was a Microsoft app that either came with Windows XP Tablet Edition of was otherwise widely known to enthusiast users of said operating system such as myself.
The helpful poster wasn't me, but I should totally make the PDF link easier to get to. No one should ever need to give me their email address for stuff. :)
There is no indication that app4soft is Sacha Chua, who is considered by many to be a pillar of the Emacs community. I would not hesitate to trust her with my email address.
On linked page there is a link to public SlideShare version of this book:
> 2014-02-24: Want it without letting me know your e-mail address? You can snag the PDF from Slideshare.[0] (You'll have to manually check for updates, though.)
The only comparable thing I've seen (and not so similar) is Cosma Shalizi's bactra.org - the Notebooks section is amazing, and a lot of his Reviews are great.
Sacha Chua's emacs videos on YouTube are a treat. Highly recommended for the great interviews, of one emacs enthusiast talking to other emacs enthusiasts.
My wedding anniversary is coming up and I want to frame our wedding vows as a surprise. I'd really like to use our handwritten vows, but mine are in a notebook across several pages. I was wondering if there was a way to scan everything, extract the text, and put it all on one page. Here's to hoping this guide will help.
Ha, it wasn't. It brings up an interesting point, though. Even though I'd scan and manipulate the original vows, I still feel that's a bit more special than simply re-writing them.
This is tied to the absolute path of files in your home directory making it difficult to rebuild with say differing kerning values. It would be nice if it referred to relative paths. At least one path seems to be /home/sacha.local/lib when I assume it ought to be referring to /home/sacha/.local/lib
It would be neat if it referred to relative paths within the repo even nicer if it if evaluating it installed needed python libraries locally so you could clone it. Open it in emacs. Modify. Eval buffer.
Regarding kerning the only thing I think is really off is r followed by e example Here its not as noticeable with a smallish font but becomes more noticeable in a larger headline or title. I'm using it as the font for org headlines.
Hah, it's not really reproducible at this point, but I was so excited that I didn't want to wait until I got everything sorted out. I spent a little time last night kerning even more (it's surprisingly fun), so if the kerning at http://pages.sachachua.com/sachac-hand/files/test.html looks better for you, you can get the new font files from Github. Gosh, thanks for using the font right away!
The local lib stuff is so that you can get aglfn.txt into the right place for the python library. I'll see if that can be given a path. If so, I can include it in files/.
I've always wanted to do this, but it only really works if you have a typeset handwriting style. Regular handwriting has too many "ligatures".
For example consider just "vo" vs "io". The end of "v" ends horizontally near the top. "i" end at the bottom. So the line that starts "o" has to begin at different positions.
Most fonts solve this by starting a discontinuous "o" always at the bottom. But this looks ugly.
I tend to use print because it's easier for me to speed-read my sketchnotes that way, but I did come across a typography tutorial that explains how to do cursive connectors through variants. Maybe someday, if the kiddo starts learning cursive. :)
This was a cool thing to try when PostScript became more common, the release of the Apple LaserWriter printer [0]. I made a Type 1 font kind of like my handwriting. It's tedious but not super complicated. The real challenge is making something that doesn't look awful - hinting and ligatures and stuff. I might try it again.
I have an old Tablet PC that came with a program that did this. On a roadtrip one day a friend was bored and she stylused in all the letters. Her printing looks a bit like a child's and I've used that font a bunch of times now, on everything from kids menus to thank-you letters from my dog. I probably ought to pay her some royalties!
Totally. I felt that generating and processing my own template with reference fonts and a custom letter order was an excellent reason to learn more Python, though!
I did this sophomore year because my French teacher wanted things handwritten. I spent a lot of time making it fit on the lined paper and getting the color just right but I'm sure she figured it out anyway.
If I look at the resulting font in Safari on my iPhone it shows up as double lines. Until I zoom in, then it suddenly looks fine. Does anyone have an idea what is the cause of this?
Oh! I should totally make a bold version instead of relying on the browser. Thanks to both of you for testing and troubleshooting! I'll do it later after the kiddo goes to bed. I'm excited about looking into alternate glyphs too.