Wednesday, May 6, 2015

Fonts for the desktop

I have two laptops where I run Linux: one at home, and one at the office. These are basically the same setup, except at home I run the latest alpha and beta versions of Fedora.

At work, it is important for my documents and websites to look and act the same as my coworkers using Windows and Mac. If I write a document or view a web page, I need to know that I am seeing the same thing they are. So I installed Microsoft's core fonts for the Web on my work system. These fonts were initially released by Microsoft in 1996 to create a de facto standard set of fonts for viewing websites. They are also the most common fonts used in many office documents, at least where I work:

Microsoft's core fonts project was actually a really good idea, and the fonts look nice. But the license wasn't exactly friendly to distributions; you could only redistribute the fonts in the original package format: .exe for Windows, and .sit.hqx for Mac. Fortunately, a few clever developers created a SourceForge project to provide Microsoft's TrueType core fonts on Linux. In practice, this just downloads the original package files (mirrored at SourceForge) and unpacks the archives using cabextract. On my work laptop, I have been using these original core fonts for years.

At home, I have decided to be completely non-proprietary. And that means I prefer to avoid Microsoft's fonts. At the same time, I don't want to miss out on the web experience; when I visit a website that specifies the core fonts, I want to get those fonts. I want to get the same experience as was intended for other desktops. It would be great if websites used downloadable fonts so all visitors always see the intended font, but not every site does this. Because the core fonts are so ubiquitous among proprietary desktops (Windows and Mac) many websites default to these fonts.

How can I use Microsoft's core fonts if I don't want to install the core fonts? The answer is simple: I use other fonts, and set aliases from the core fonts to those other fonts. And that's what I've done.

Fortunately, several high-quality free fonts already exist. Perhaps you know about the Liberation Fonts which aims at metric compatibility with Arial, Times New Roman, and Courier New. The GNU FreeFont project is another, similar example of providing fonts that can replace the core fonts. You can also find fonts under a variety of open licenses from Google Fonts. Most web developers know about the Google Fonts repository, but did you know you can also download the font collection in TrueType and OpenType formats?

Through some experimentation, I provided aliases for the core fonts, using only free fonts. I selected fonts that had similar letter shape and form. While I am not a font expert, I found the uppercase letters A, I, J, L, M, W and the lowercase letters g, i, j, l, t were good places to look for matches. Also, the numbers and special symbols $ and & often provided another comparison. It took some time to go through the font collections, comparing the available fonts with the core fonts. They didn't need to be completely perfect replicas, but representative of the font so that using the replacement effected the spirit of original. With that in mind, I think I managed to find a pretty good set of similar fonts.

Here are the fonts I use to replace the core fonts. On the left, I provide an image of the original Microsoft core font. On the right, an image of the replacement font:

Andale Mono (Source Code Pro)



Arial (FreeSans)



Arial Black (Archivo Black)



Comic Sans MS (Patrick Hand)



Georgia (Merriweather)



Impact (Anton)



Times New Roman (Liberation Serif)



Trebuchet MS (Alegreya Sans)



Verdana (DejaVu Sans)



I skipped Webdings, because no one really uses Webdings. I also don't provide an alias for Courier New, although I suppose I could use Liberation Mono for that.

(A note on Comic Sans MS: This is a handwriting font, and not often used these days. Many people don't like it—and in many offices, its use is effectively banned. But my mom uses Comic Sans MS in her emails, and I like the "homey" touch that it provides when I read notes from my mom. I didn't want to lose that connection, so I found a suitable replacement.)

While Tahoma wasn't part of the core fonts, many websites and web applications rely on Tahoma. According to Wikipedia, the Wine project includes the free and open-source fonts Wine Tahoma Regular and Wine Tahoma Bold released under GNU Lesser General Public License designed to have identical metrics to the Tahoma font. So I could find the Wine Tahoma fonts and use those, but I found the Liberation Sans font is close enough:

Tahoma (Liberation Sans)



Microsoft later defined the ClearType Font Collection, as part of Windows Vista. These are sometimes referred to as the "C" fonts because every font name in the collection starts with the letter C. I don't have a use for most of these fonts, except Calibri. Microsoft set Calibri as the default font in Microsoft Office, so I often get documents from other that use the Calibri font. Also, many websites use Calibri as a first preference, so I wanted to have a replacement for it on my system. (Even my blog uses Calibri. The body font string for my blog is Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif.)

Calibri (Source Sans Pro)



I'd like to know how you set up your fonts. Do you use similar fonts, or something different? Let me know! If there's a better replacement out there, I'd like to hear about it.

18 comments:

  1. Michael CatanzaroMay 6, 2015 at 6:16 PM

    Maybe we could look into getting these fonts installed by default in Fedora, and aliased in Fedora's fontconfig (or better, upstream's fontconfig)?

    ReplyDelete
  2. Michael, that would be great! I think these fonts are pretty good stand-ins. Even if not perfect, they produce the same "feel" as the original fonts. And it's a good step for compatibility. Maybe it would motivate others to find (or build) metric-equivalent fonts for the core fonts.

    Also, I just saw a post from 2013 that mentioned the Carlito font as a metric equivalent to Calibri. It's licensed under the SIL Open Font License. However, I can't find an official home for this. The 2013 post links to a direct download from ChromeOS. I don't see it on ChromiumOS's website.

    ReplyDelete
    Replies
    1. Michael CatanzaroMay 7, 2015 at 9:34 AM

      FYI, the current aliases are in /etc/fonts/conf.d/30-metric-aliases.conf and 30-urw-aliases.conf.

      Delete
  3. Looks like Carlito is Lato, and Lato is available under OFL from Google Fonts. So I'll give this a try as a Calibri replacement.

    ReplyDelete
  4. After 20 minutes of poking around on my own, I finally read the last comment on the "A thank you to Google" blog post I linked to:

    These fonts are now packaged to Fedora and one can simply get them with yum. Package names are google-crosextra-carlito-fonts and google-crosextra-caladea-fonts

    Sure enough, this package is installed by default on my Fedora 22 beta. And there's a fontconfig file in /usr/share/fontconfig/conf.avail that aliases Calibri to Carlito. So you don't need to do anything special. Calibri is already aliased. And when I remove my font alias for Calibri, and load a specially-crafted page that uses 'font-family: Calibri, serif;' I see that I am getting a sans-serif font that looks a lot like Calibri.

    So Fedora already has this one fixed.

    ReplyDelete
  5. At least according to this page, Gelasio is a replacement for Georgia. Not released yet tho.
    https://ebensorkin.wordpress.com/2013/01/30/gelasio-samples/

    ReplyDelete
    Replies
    1. Thanks for the link! I found Gelasio on Google Code but got a 403 error every time I try to download a ttf file. So it seems like the author has not made this available yet. You said as much in your comment. Ah well.

      I do like Merriweather, however. It gives me the same look and "feel" of Georgia even if it is not metric compatible.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. See here for Gelasio:
      http://git.alpinelinux.org/cgit/aports/commit/?id=6a174e0dab2dae50b266f1fea69a066286c0ccaa

      The aliasing trick is wonderful, too bad it doesn't work on Chromium thanks to the "wise" decision of ignoring fontconfig substitutions.

      They only whitelist Liberation Sans and Liberation Serif, the latter being really ugly. FreeSerif, Nimbus Roman No9 or TeXGyre Termes would all have been better choices.

      Delete
  6. Check http://www.carrois.com/fira-4-1/ for Sans and Mono versions.

    ReplyDelete
  7. Thanks eloy. Do you alias Fira Sans as one of the core fonts? Which one?

    ReplyDelete
    Replies
    1. I use this font as basic gnome desktop font.

      Delete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Source Serif Pro is a good alternative for Georgia. FreeSerif and Nimbus Roman are close match for Times New Roman.

    - Rajeesh

    ReplyDelete
    Replies
    1. Hi Rajeesh! Source Serif Pro does look very much like Georgia, but I admit I miss the dropped numerals in Georgia/Merriweather. But maybe I should give this a try too, and see how it compares.

      Delete
  10. James, your blog is a true asset. I've been using Andale Mono for years as a coding font and your link to Source Code Pro is a welcome addition to my collection. Heck, this whole post is brilliant.

    Thanks!

    ReplyDelete
    Replies
    1. Thanks Larry! I do find Source Code Pro is a very nice programming font. I have that set as my default font for GNOME Terminal and GNOME gedit. It's very easy to tell the difference between l and 1 and I, and 0 and O, which means fewer mistakes. I'm not likely to mistype 0 as O for example, but in reading someone else's code and then referencing things, I introduce fewer bugs if I can easily distinguish each letter from other characters.

      I've gotten a lot of great feedback on this post, so I'm thinking about doing an updated post in a few weeks with samples of some of the other fonts folks have suggested. Also, it seems it's easier to spot font differences/similarities at larger font sizes, so I'll probably create new font images at a larger point size, but only a few letters from each: uppercase letters A I J L M W, the lowercase letters g i j l t, numbers, and special symbols $ &.

      Delete

Note: Only a member of this blog may post a comment.