Papyrus is a font that I commonly use for digital art that I post on DeviantArt – the mixed-media “inspirational” kind that has an image with a quote or other inset text. I find that for stuff that’s either serious or humorous but mocking something serious, Papyrus is the best typeface to use. It just looks so dramatic.
Naturally, you can imagine how disappointed I was when I found that the Windows version of GIMP doesn’t have that font. I went looking for a website where I could download it, but found that all the download pages on the Internet were paywalled. I was like, really? BUY fonts? Who the hell does that? I don’t even buy my music, so I’m definitely not buying a font. I’m gonna pirate it.
So how does one pirate a font, exactly? Well, basically you need two things: First you need 1337 h4xx0r skillz like mine; second you need a ton of spare time and patience, because the process I went through was extremely lengthy and tedious. First I did a simple image search for the Papyrus font. Pretty obvious first step. I found an image that showed all the letters and numbers and some punctuation in that font. Would have been nicer if I’d found separate images for each glyph, but I guess that would be making it too easy.
After downloading the image, I opened it up in GIMP. Now this was the really tedious nightmarish part: I had to painstakingly copy every glyph into its own image, making sure I copied exactly the right number of pixels so they would all line up when I pasted them together. My object was to create a program where I could simply type letters on the keyboard and those letters would appear on the screen in the Papyrus font, as if I were using a word processor. I wanted it to be as seamless as possible. To do this I had to make sure early on that I got them lined up. It was a pain in the ass, but I eventually had a separate image for each glyph. I won’t be posting them here though. I figure if I only pirate the font for my own personal use and don’t distribute it to anyone, then the people selling it are less likely to come after me. I’m just covering my own ass, okay?
The HTML page is divided into two regions: the input region where text is entered (represented by the
charCodeAt() function to get the ASCII value for the character (line 14). It then proceeds through a decision statement to select a filename paradigm depending on what numerical range the character code is in. For numbers (codes 48-57) and lowercase letters (codes 97-122) the filename is simply (that character).gif. For capital letters (codes 65-90) the filename is the double character and then .gif (I had to vary it somehow because filenames aren’t case-sensitive). For the space and punctuation characters, a special filename is used for each one.
Lines 34-39 print a
<br> tag if the inputted character is a newline, and if the character is anything other than a newline an
<img> tag with the already constructed filename is printed. The “printing” is done by appending a string to the
innerHTML property (I shouldn’t have to explain what that does).
Possible future enhancements for this project:
- Do some minimal adjustments for better kerning (like if there’s a capital P and then a lowercase e, move the e to below the loop of the P so there isn’t that big awkward empty space).
- Make the glyph images transparent so they actually can be overlaid in the manner described above.
- Detect when there’s not enough space left on the page for the next word and start a new line accordingly.
- Give the program the ability to edit the Papyrus text in real time.
So there you have it – my proven method for pirating fonts. And fortunately I only had to do it once, since Papyrus was the only font I wanted to use that I didn’t have. That’s it for today. Happy hacking.