Adding Fonts to Groff

Published at 08:28 on 2 May 2018

Because I’ve had a strange fixation on how to do it (it’s not really practical, given the many limitations and deficiencies of the program), here’s how to add fonts to Groff. Note that when I write “Groff” here, I mean Groff with the PostScript output option.

  1. Obtain Ghostscript and Fontforge. You will need both in order to add fonts (and if you don’t have Ghostscript, Groff’s usefulness is severely compromised, as per the first link in this article).
  2. Determine the location of your installation of Groff’s textmap file. Typically this will be in a location like /usr/share/groff/version/font/devps/generate/textmap.
  3. Create a directory to hold the Groff fonts and font metrics files you will be generating.
  4. Create a devps subdirectory to this directory. All the files you create should be in this subdirectory.
  5. Open each font in Fontforge. Note that a typical font family contains four fonts: a normal font, an italic font, a bold font, and a bold italic font. You will have to do the steps below for each of the four fonts in each font family you wish to use.
  6. Perform the editing steps in the list immediately below on each font.
  7. Close Fontforge, if desired.
  8. For each type 42 font you generated, extract an AFM file:
    printafm name.t42 > name.afm
  9. Think of a name you wish to call the font on the Groff side. The Groff convention is to have families of fonts that end in “R,” “I,” “B,” and “BI” (for roman, italic, bold, and bold italic variants). E.g. “BaskervilleR,” “BaskervilleI,” “BaskervilleB,” and “BaskervilleBI.”
  10. For each AFM file, generate a Groff font metrics file (replace textmap-path with the location of the textmap file you determined in step 2 and groff-font-name with the name you came up with in the previous step). If the font is not italic, type:
    afmtodit -i0 -m name.afm textmap-path groff-font-name
    If it is italic, type:
    afmtodit -i50 name.afm textmap-path groff-font-name
  11. If your font contained ligatures, verify the ligatures line in your Groff metrics file is present and contains all ligatures.
  12. Create a download file in the font directory by following the final list of instructions below.

Editing steps in Fontforge:

  1. Disable all Apple Mac features, as they are broken in Fontforge: Go to File > Preferences > Mac, delete all entries in the Features tab, then verify the list in the Mapping tab is empty as well. You should only have to do this once for each editing session.
  2. Open the font file you wish to add to Groff. You will typically have to know where your system keeps fonts in order to do this. This of course varies from system to system.
  3. Clean up the ligature substitution tables. Modern font files can have complex ligature substitution rules, which tend to confuse Groff. The only thing Groff can support is a single liga table. Select Element > Font Info > Lookups and examine the GSUB tab. If there’s any more than one liga entry, you will have to delete the all but one. If there’s any clig, alig, or dlig entries, they will have to be deleted. Then edit the single remaining liga table and make sure it does what you want. Note that since Groff only supports the fi, ff, fl, ffi, and ffl ligatures, these should be the only ones listed in your table.
  4. Correct the names of your ligature glyphs. Some fonts use ligature names like “f_i,” “f_l,” “f_f_i,” etc. These will confuse Groff. Only names that exactly mirror the character sequence to be replaced by the ligatures (e.g “fi,” “fl,” “ffi,” etc.) are supported. To do this you must locate the ligatures in the glyphs list (they start at Unicode codepoint FB00), click on the glyph of the appropriate ligature, then use the dialog in Element > Glyph Info to set the name of the glyph.
  5. Save the font (using File > Save) as a .sfd file. This step is optional, but can be useful if you forget or botch one of the editing steps listed above.
  6. Generate a type 42 font using File > Generate Fonts. Click on the “Options” button and make sure “TrueType Hints,” “PS Glyph Names,” “OpenType,” “Dummy DSIG,” and “Lookup Names” are checked. No other boxes should be checked. Fontforge may complain about some things being slightly amiss when you try to generate the font. In my experience it has usually been safe to ignore the warnings and just generate the font file.

Steps to create the download file:

  1. Start by copying the download file from the existing fonts storage area to the Groff font directory you have created (it will typically be in a file like /usr/share/groff/version/font/devps/download).
  2. For each font file you added, you will have to add a line to the download file. Each line in the file contains the “internalname” value from the Groff font metrics file and the name of the type 42 font file, separated by one or more tab characters.

And that’s “all” you need to do. If you set the GROFF_FONT_PATH environment variable to point to the font directory you created, you should now be able to use those fonts in Groff. The font names you use in Groff will match the names of the Groff font metrics files.

(Updated 16 May 2016 with corrected instructions for running afmtodit.)

Well, That Sure Was No Surprise

Published at 14:52 on 1 May 2018

The culprit for the failing aftermarket back-up camera in my truck was the solderless quick-connectors I used (per the recommendation of the camera manufacturer) to wire the camera to power.

This was so much not a surprise that I didn’t even bother to do any troubleshooting to pinpoint the culprit. I simply removed the solderless connectors, cut and stripped the wires in question, twisted them together, soldered them, and taped them.

Then I started my truck and put it into reverse. Bam! Fixed.

This has been consistent with the (crap) performance of virtually every solderless quick-connector I have tried in the past forty years, which is why I felt so confident attempting this repair without further troubleshooting. For some reason, I was willing to give them a try again when I installed that camera. Lesson learned: never again.

A soldered connection firmly and securely bonds two connectors together at the atomic level. Assuming copper wires, the molten solder actually partially dissolves the surface of the copper conductors before it solidifies, resulting in one seamless conductor (transitioning from copper to solder back to copper) that is virtually immune from oxidation or vibration induced failure. Nothing else even remotely comes close to this reliability, except a seamless connector with no splices whatsoever.

I am convinced that the only reason quick-connectors exist is: a) manufacturers who want to cut corners on their assembly lines in order to pad their profits, or b) people, usually do-it-yourselfers, who don’t know how do solder and who are unwilling to learn how.

Liberals and the Center Preach False Equivalence, Too

Published at 08:54 on 1 May 2018

Remember all the heat that Trump caught (and rightly so) for proclaiming there were “some very fine people on both sides” of a fascist rally and the associated counterprotest?

Well, it turns out that liberals and centrists are guilty of false equivalence, too, and when referring to the very same event. There’s been a lawsuit filed in Charlottesville that makes no distinction between fascists and those who showed up solely to oppose fascists.

With “friends” like this, who needs enemies?

Roses Are Red, Violets Are… Yellow?

Published at 07:51 on 29 April 2018

It doesn’t jibe with the traditional poem, but in this part of the world, violets are commonly neither blue nor violet in color. Our two most common species have yellow flowers.

Evergreen Violet, Viola sempervirens

The Evergreen Violet, Viola sempervirens, lives up to its name by having evergreen foliage; its rounded leaves persist through the winter months. It is a short plant, seldom more than 10 cm (4″) tall. All of its leaves and flowers are borne singly on stems arising from underground rhizomes; it has no above-ground stems that bear both leaves and flowers. It is commonly found on the floor of coniferous forests.

Stream Violet, Viola glabella

The Stream Violet, Viola glabella, is often found along streams and in other areas wetter than the Evergreen Violet prefers. It is usually more than 20 cm (8″) tall, bearing both flowers and leaves from above-ground stems. All above-ground parts of this violet die back in winter. This violet’s leaves are thinner and brighter green than the Evergreen Violet’s, and they come to a point at the end. The Stream Violet is most common in deciduous forests.

Like all violets, both of the above have edible flowers and young leaves. Of the two, I prefer the Evergreen Violet, because its flowers often taste delightfully of wintergreen.

The flowers being the reproductive part of a plant, one should not attempt to make a harvest of edible flowers of any sort unless a) the flowers are numerous, and b) the area they are being harvested from is lightly-used. Item (b) means that I do not snack on violets here on the Island much, because most of our wild areas simply get too many visitors to support the ethical harvesting of flowers. I concentrate my snacking on violet blossoms to the times when I take hikes in less used areas on the Olympic Peninsula.

Garden pansies and Johnny-jump-ups are also in genus Viola and are also edible.

Saudi Reforms: A House Built on Sand

Published at 20:14 on 28 April 2018

The recent reforms in Saudi Arabia are like a house built on sand; they are fated not to last.

That’s because of all reformist measures enacted by governments, the recent ones in Saudi Arabia are some of the closest to pure reformism and the furthest from revolutionary change, and ultimately only revolution is capable of effecting lasting change. Absent enough popular passion to inspire at least some faint thoughts of revolt, a reform is nothing but a dictate from above that can be easily undone by an opposing and contrary dictate from above.

Lasting reforms in open societies are indeed a real thing, but they are almost never pure reformism. They are driven by popular demand and backed by an implicit, though often unstated, threat of at least widespread disruption and at worst (in the eyes of the ruling elite) outright revolution if not granted. The reforms are granted by the elite under popular pressure not to erode elite rule, but to preserve it, and the implicit threat from below serves to keep the reforms in place.

In contrast, what’s happening in Saudi Arabia seems to be coming almost entirely as a result of the dictates of a reform-minded king. They could be easily undone the next time a more conservative king ascends to the throne, and in all likelihood will be.

Now, if when that hypothetical king undoes the reforms there is unrest, and then the reforms are reinstated, then they will cease to be a house built upon sand. But only then.

A Strange Book

Published at 07:33 on 28 April 2018

So, a week or so ago, I was passing through the campus of the University of Washington when I noticed two brand-new copies of a book sitting on a bench outside. It was a novel, not a textbook, so evidently someone had been passing them out as free samples, and two takers had decided to leave them. Being a chance to get a brand-new book for free, and the book not obviously being a political or religious sect’s recruiting text, I decided to take one.

The book was Wild Animus by Rich Shapero. It’s a somewhat strange (and not entirely realistic) tale about an LSD-using graduate student who takes his hallucinations a little too seriously, eventually to the point of perishing near the summit of Alaska’s Mt. Wrangell.

Two articles on the book may be found here and here.

It turns out that free distribution is evidently the main way the book passes into the hands of the public, and that college campuses are one of the typical venues for such distribution. Apparently it’s written by a somewhat eccentric high-tech millionaire who has decided it’s a good value for his money to pay significant sums having copies of his stories printed, and then to distribute them for free.

I can’t quite share the resentment of the reviews of some of its readers. It’s something of a trippy tale, which turned out to be just about the perfect thing for me to have read during my recent camping trip, on which I did not take any cannabis. The book provided a conveniently drug-free means of entering into a somewhat trippy state of mind.

Having read it, I will now sneak it into the nearest Little Free Library. I will almost certainly not be the first person to sneak a copy of this work into one!

Nature Posts

Published at 13:31 on 27 April 2018

I’ve been making these to a another blog that I own, because part of my reason for making them is to sort of toot my own horn as to my knowledge of things natural, in the hopes of someday making a living sharing that knowledge.

I often make political posts here, and I prefer to keep business and politics at least somewhat separate, which is why I’ve started putting my nature posts somewhere else specifically devoted to them.

However, I’m something of a cheapskate, and have been unwilling to pay for hosting that second blog, which means it contains ads. I’m not terribly happy about that latter point, and wish to provide a way for people to read my nature posts without being subjected to advertising.

This site is ad-free, because I’m paying to host it, so I’ve decided to post nature stuff on both blogs, thus giving folks a way to read those posts ad-free here.

If you only want to read the nature posts, and you wish to read them ad-free, you can bookmark this link.

That I’ve linked the two blogs here (and may even link them from the other site, as well) makes it possible for a prospective customer to learn my politics and possibly discriminate against me for being politically radical. So be it. I’m not interested in living in the closet; moreover, anyone small-minded enough to so discriminate probably is small-minded enough to not be the best person to deal with, anyhow.

Marine Push

Published at 13:16 on 27 April 2018

Here comes the marine layer.

I’ve been out of town camping the past several days, taking advantage of the warm, dry weather while it lasts. I just got back home before noon today.

Of course, the warm weather didn’t last. It never does, particularly this early in the season. I awoke in the early morning hours and could tell that the humidity had risen. When the sun rose, there was a damp chill to the air, and the morning sunshine did not quickly warm things like it had the past few days, particularly on Thursday.

In fact, I was lucky this morning, having camped in one of the few areas that stayed clear overnight. While leaving, I could see that tatters of clouds were clinging to some of the ridges. A few miles later, I was met by the sight of a wall of low marine overcast, which had not yet totally pervaded the area where I had been, but which was evidently fated to soon do so. Most of the remaining drive back home was in overcast conditions.

This is a common pattern during our warmer months. A surface low offshore interferes with the normal onshore flow: typically, heating inland will cause lower air pressure (warm air being less dense than cold) which in turn serves to draw the cool air inland, moderating our temperatures. When there’s a surface low offshore, it keeps the air pressure there lower than inland, even though it’s often really starting to warm up under clear skies. Our natural air conditioning turns off for a few days.

If the same pattern happens during the winter months, we typically don’t get so extraordinarily warm, because there’s simply not enough hours of sunlight to heat things up at low levels. Instead, the clear skies overnight help things cool down on the long winter nights (by enabling the radiation of long-wave infrared, which clouds tend to reflect, out to space). It may be getting warmer and warmer aloft, but at the surface it stays quite cool. This inverts the normal order of things, which is that temperatures get cooler as one gets higher, and so is called a temperature inversion.

If the pattern starts when the ground is wet (as it often is, in the winter), the air at the surface tends to quickly become saturated, and we get a prolonged period of fog, low clouds, and cool to cold temperatures at the surface. We also get poor air quality, since the cold, stagnant air at the surface doesn’t let pollutants dissipate easily.

But back to the warmer months. The warm, dry weather is enabled, to reiterate, by a surface low offshore. When that low moves east over land, its effect is reversed: the low pressure area is over the area of warm air, and the tendency for warmer air to be less dense is amplified. Not only that, it’s usually abnormally warm inland, further amplifying the onshore trend. Marine air assertively floods inland, sometimes vigorously enough to prompt small craft advisories in the Strait of Juan de Fuca.

With the cool, moist air comes low clouds and sometimes fog and drizzle. This is the marine push. The heat wave is over.

The Answer Is No

Published at 00:22 on 24 April 2018

Marcon can’t bargain with Trump.

He thinks he can, but he can’t. Orange Julius Caesar will say whatever Marcon most wants to hear at the moment, then just change his tune and pander to his base after the visit ends. Marcon will end up looking like the fool he was for thinking otherwise.

After all, even members of Trump’s own cabinet have trouble working with him, because Trump’s line on what he wants keeps continually changing. Trump’s own well-demonstrated personal flaws make cutting any sort of lasting deal highly improbable.

It’s somewhat surprising a reasonably intelligent person like Marcon could think his effort will end up otherwise. I guess in some sense he has to make a good faith effort to try and save the doomed Iran deal; it would look really bad for him to just write Trump off from the get-go. It’s one of those pointless formalities that must be gone through.

On a different matter, so much for the idea that Rand Paul might act as something other than Trump’s dutiful lapdog. The lapdog might yap a lot and even let out the occasional growl, but it’s always the smallest and most pathetic dogs that are the most vocal.

Antifa Is Winning

Published at 06:51 on 23 April 2018

Even an Establishment paper like the Washington Post basically admits as such when they write paragraphs like:

Participation and enthusiasm appear to have slowed since. Several street rallies have been sparsely populated by white supremacists — but overwhelmingly attended by counterprotesters — and by the time Spencer ended his college speaking tour, few supporters were coming to his speeches.

You see, fascists (and that’s all “alt-right” is: rebranded fascism) aren’t interested in participating in the dialogue of an open society. They want to destroy open society and replace it with a totalitarian fascist dictatorship.

Fascists’ public appearances aren’t about debate, they’re about projecting an image of force and power, and attracting support based on that alone. Outnumbering fascists, shouting them down, shutting their events down, firing them from their jobs, disowning them from families and sometimes beating them up undercuts and subverts that message of force and power, replacing it with an image of weakness and powerlessness.

It may make nice liberals queasy and even pity the poor roughed-up fascists, but liberals aren’t the target group the fascists want to recruit from, anyhow. There really is a paradox of tolerance, and acting on this fact really does appear to work.