Room 208

Elaborate Burn

Posts from January 2014

Confession: I regularly fix minor mistakes in Git commits I’ve already pushed to public servers by quickly amending HEAD, doing a git push --force, and hoping nobody pulled from the repo in the thirty seconds or so between pushes.

Using custom fonts with Dichotomy

@abandonedsteel writes:

Just one question - do you, perhaps, have suggestions for alternate monospace fonts? And if so, how would I use them in this theme?

Certainly. The most important thing to note when selecting a typeface is that Dichotomy expects normal, bold, and italic styles to all have the same character width. For instance, links turn bold when the mouse cursor moves over them, and if the typeface you’re using has normal and bold fonts with different character widths, you’re going to end up with text jumping all over the place.

A small digression about browser font synthesis: If you ask for a bold font in a font family that doesn’t contain one, most browsers will fake one by simply doubling some pixels horizontally. Needless to say, this means that the mock bold font will not have the same character width as the original. Browsers will also synthesize italic fonts when needed by applying a uniform slant to the glyphs, but the character width isn’t affected by this process, and so it’s okay if the typeface doesn’t have italics. If it does, though, it had better also have a separate bold italic font, otherwise bold synthesis will ruin everything again.

Dichotomy uses Ubuntu Mono by default, which conveniently has regular, bold, italic, and bold-italic variants. Early versions used Lekton, which I liked but unfortunately committed the cardinal sin of having an italic without a bold italic.

Okay, okay, so how do you do it?

In short, head over to Advanced options, and enter something like the following in the Custom CSS box:

body {
    font-family: "MyFace", monospace;

You’d replace "MyFace" with the name of your preferred font family, of course, preserving the quotes. That monospace at the end is important to ensure that people who can’t use the font you specified still get something monospaced. Don’t leave home without it.

System fonts

It’d be great if we could pick a monospaced font family that’s already installed on everyone’s computers, so we wouldn’t have to add code to download the font files from elsewhere. Sadly, it’s slim pickings here. Consolas comes with Windows and Office these days, and may be your best bet on this route. OS X ships a decent version of Courier, but Courier New on Windows is thin and spindly and hard to read and I hate it. Don’t use it.

Web fonts

Okay, so let’s take a look at some downloadable web fonts. This option requires more work, but it carries the advantage that most browsers will automatically download the required font files, sidestepping the problem of default system availability. Ordinarily, I would point you to Google Fonts and say, “Search away!” But even though they provide options for searching by various font attributes, fixed width is not among them. Never fear, though, because I’ve compiled a shortlist of typefaces available there that satisfy our criteria:

(Yow, that really was short.) To use one of these fonts, you’ll need to follow the Open [font name] in Google Fonts link near the top of the specimen page. Check the appropriate styles to include – you’ll want at least Normal 400 and Bold 700, as well as any italic variants if they’re present – then scroll down to step 3. Select the @import tab, and copy and paste the code there at the top of your custom CSS, before any other declarations. Then change the font family name as I mentioned above, and save.

If you’re using Dichotomy with custom HTML, this won’t work properly due to an oversight in versions up to 3.0 – but in that case I trust you can read the diff fixing this problem and make changes to the code accordingly.

Any questions?

I hope this guide was reasonably clear, but if not, you can always send me e-mail or grumble to me via Tumblr asks.

Dichotomy now available in the Tumblr Theme Garden

The recent 3.0 release of Dichotomy is now available through the Tumblr Theme Garden, for your one-click installation pleasure. Note that Tumblr has a nasty tendency to reset user theme settings when upgrading themes, so existing Dichotomy users will want to visit the Customize page and make a copy of their current preferences before taking the plunge. (Though, honestly, black and white and gray ought to be enough for anyone.)

Dichotomy 3.0

Whoa, look at that shiny “3”! This version of Dichotomy introduces:

@mnxmnkmnd writes:

What was SHAFT when Lain came out?

I realize this is in all likelihood a joke, but I’ll give it a serious answer anyway: SHAFT’s website proclaims that they’ve been around since 1975, but they were largely a subcontractor for other animation studios until the turn of the century, after a few co-outings with Gainax. Fun fact: SHAFT is credited for “Work Assistance” on the adaptation of NieA_7, which came in 2000 – two years after Lain, and towards the end of SHAFT’s second-string period.

Akiyuki Shinbou, the studio’s most well-known personality, started directing in 1990, although he didn’t become associated with SHAFT until Moon Phase in 2004. He was apparently directing some very ’90s anime during Lain’s TV run.

SHAFT ought to apply for a patent or trademark or something on …
"But what if I'm making paper?"
Dear Tumblr, Yes, yes, we all know you were acquired by Yahoo …
Lies, damned lies, and statistics, part II. This graph covers …
From about 16½ minutes into the Steins;Gate film.