Why is it you can’t convert a TrueType font to PostScript or the other way around?

This is one of those outrageous assertions you find very frequently in the intarwebs: “You just can convert this TTF font to PostScript” or the same thing backwards. Someone with technical knowledge explains why it is not possible to obtain a remotely decent result and then another pundit repeats the same stupid assertion.

The technical reality of it all is this: PostScript fonts use quadratic equations to describe shapes (“splines”), while TrueType fonts use cubic equations to describe splines. Furthermore, hinting is very different. PostScript fonts use generalized hinting subroutines that need an external hinter to produce properly shaped output at the required sizes (is there still people old enough to remember and have used Adobe Type Manager anywhere that are not professional typographers or typesetters?). On the other hand, TrueType hints are full blown self shape-modifying programs, the font modifies itself at the given output sizes and the external hinter influence on final output is minimal if any — I’m not touching subpixel rendering here, just in case someone engages keyboard before brain in the, very unlikely, comments.

A brief analogy: A PostScript font is like an Arabian racehorse. Beautiful and very fast but to win it requires a jockey who can read the animal’s quirks and needs to take it first in a race. A TrueType font is like a Formula 1 race car. The car is a fully computerized machine where the pilot’s role is to keep it on the road and make sure it doesn’t splat onto a wall or chrash with another car while trying to go as fast as possible. The computers and the technical team take care of the rest remotely.

To convert a PostScript font to a TrueType font just by using Fontforge, FontLab, etc., or the other way around, is like taking an Arabian racehorse, putting it in a meat grinder and expect to obtain a Formula 1 race car in the other end. QED.

Advertisements

Courier 15 CPI crawls back from the woodwork

Earlier this week I was contacted by Alan G. Isaac asking me about the whereabouts of the Courier 15 CPU aka Courier Dot 15 fonts I made several years back. The old website at Tripod is gone and I’ve redirected my energies to other interests in the meantime.

I’ve digged up the fonts from old backups and I’ll repost them all in this blog. Let’s see if I’m game to start hacking fonts again. 🙂

fcr15cpi.zip
fcr15cpi_otf.zip

NOTE: I managed to delete the file by mistake several weeks ago. It is restored now and I’ve added an OTF version to boot.

How to fix the new MS fonts in POSIXy systems

OK, you’ve got your new computer preinstalled with MS Vista and/or MS Office 2007. You didn’t waste time to install your favorite GNU/Linux distribution or BSD flavor and took the time to comb down that Windows partition for goodies the license and Title 17 of the US Copyright law may warrant you to use. That is, unless George of the Bush hasn’t killed it already with the help of his friends in the US Congress, each and every one of whom make Sarah Palin look like a Nobel Prize Winner, ten years in a row.

You find those nice fonts with names starting with “C”, Calibri, Cambria, Candara, Consolas, Constantia and Corbel. Diligently you copy them into your $HOME/.fonts directory and run the magic command fc-cache -r -v in a terminal emulator window, go to the font settings application for your preferred desktop environment and change the monospaced font to Consolas (new font from MS, several years in development, it has to be the ultimate coding font, right?). Open a new terminal or a text editor and you discover it is hideous! Blocky, blurry and bold although you made a point of not using bold in the settings, Something you learned the hard way after having written The Great American Novel, a thousand pages worth, printed it in Comic Sans Bold 10 points to save paper and sent it to your prospective editor, who answered back thanking you heartily for all the toilet paper supplies you sent along the other day.

The problem is that the MS “C” fonts are hinted in such way that they don’t work well if you don’t use subpixel rendering and as far as I can see there is no real traditional hinting in them worth a cent. Even after you fiddle with the LCD-type settings there is no improvement, because most GNU/Linux distros default to use the patented bytecode interpreter, which works just fine with traditional truetype hints, instead of the patent unencumbered autohinter (in typical “Bite me!” attitude). Even those distros that give you the choice to use one or the other, such as Debian, have for the most part managed to bastardize the code resulting in Freetype working as it shouldn’t. And all downstream distributions, including Ubuntu, receive the same turd.

But don’t fret! There are ways to work around the ugliness. We can create a $HOME/.fonts.conf like this:


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Use the Autohinter -->
  <match target="font">
    <test name="family">
        <string>Calibri</string>
        <string>Cambria</string>
        <string>Cambria Math</string>
        <string>Candara</string>
        ;<string>Consolas</string>
        <string>Constantia</string>
        <string>Corbel</string>
     </test>
        <edit name="autohint" mode="assign"><bool>true</bool></edit>
  </match>
</fontconfig>

That ought to fix the ugliness, although results will vary depending on how bastardized is the Freetype library in your system. Of course you can add more configurations to the file as long as you respect the XML syntax. Do be careful if using KDE(3/4) because the KDE font configuration tools love to eat users .fonts.conf files raw and spit them out in pieces.

Las nuevas fuentes de impresión «Liberation»

Red Hat News | Liberation Fonts

RedHat a puesto a disposición del público en general un juego de fuentes de impresión llamadas «Liberation». El juego consiste de tres familas: Serif, Sans y Mono, que son métricamente equivalentes a Times New Roman, Arial y Courier New respectivamente. Estas fuentes de impresión están licenciadas bajo los mismos términos de las fuentes de impresión PostScript que URW++ donó hace ya 14 años al proyecto Ghostscript y que se han vuelto ubicuas en todas las distribuciones de GNU/Linux (GPL sin infectabilidad de documentos que las incluyan).

Mi opinión es que ¡son realmente bonitas! Me gustan y para usarlas, he escrito un archivo de configuración de fontconfig que pueden guardar como o incluir en ~/.fonts.conf. No olviden copiar las fuentes de impresión al directorio ~/.fonts y correr fc-cache -f -v ~/.fonts desde un terminal.