An example ugly Windows font

I’ve complained about Windows font rendering but was hard pressed to have a good example. Well here’s one, from a Bloomberg articleCapture.PNG

Look at how ugly that is! The kerning in “To” is wrong. The “m” and “r” and “u” and “n” are all broken, by which I mean literally broken like white pixels in the middle of the letter. The tail on the “9” has visible jaggies. I’m not just nitpicking, I find this really difficult to read.

The font is a web font, TiemposTextWeb, at 18px. Maybe it’s just a spectacularly bad choice? But Bloomberg is a big publication, clearly someone thought it was a good font. That sample is rendered in Chrome; it looks the same in Edge. I have ClearType turned on with more or less default settings in Windows 10; I used the tuner to pick a very slightly heavier rendering at some point but I don’t think that’s the problem.

It looks much better in the PDF specimen. Here’s some sloppily-made images of the PDF and then Chrome / webfont rendering the same text, to show the spindly nature of Windows’ rendering.

pdf.png

ttf.png

Another example

Another example, Gentium Basic, an SIL font popular because it has support for a lot of scripts. The lowercase “a” is entirely broken, even at 30px.

Capture.PNG

I mean that’s some fucking garbage right there. It looks a bit better if install a TTF and render it with Paint.  It still looks bad, but at least it’s not broken, just ugly-ass.

Capture.PNG

On the same page there’s a “Gentium Plus” that looks a little better still. It’s not great, but it’s at least not embarassing. So maybe font quality is part of the story, but something very bad is also happening in Windows’ font rendering.

Windows customizations

I’ve now set up a second Windows box. I was in a hurry and didn’t take notes, but from memory here are some of the specific tweaks I made in addition to installing normal application software.

I sure wish Windows had a clean way to store these customizations and copy them to a new machine. MacOS is much better; almost everything is localized to your home directory and Time Machine will help you set up a new Mac.

I thought I’d be clever and copy my roaming profile over to the new computer. That worked for some things like Discord and Slack. But lots of configurations are stored in other places. Cmder still stores its config files right in the program directory for instance, which seems like a good idea if you’re using it as a portable app but otherwise is not a good thing. And some applications settings are buried in the registry and I don’t know of an easy way to extract the ones you can safely copy over.

Windows 10: separate speaker and headphones

I have both headphones and speakers plugged into my motherboard’s analog output jacks. It’s a pretty standard Windows desktop setup, the motherboard does HD Audio which has 5 analog jacks which can be programmed to do different things like speakers, headphones, line-in.

Also pretty standard, my computer had the RealTek HD Audio Manager installed, an ASUS skinned one. This does a nice job of popping up a dialog when the user plugs in new speakers and asking them to configure it. Unfortunately it also seems to have a behavior where when I plug in headphones it automatically silences the speakers. In fact both analog outputs show up as a single “Speaker” device in Windows, there’s no way to use them independently.

In theory the Realtek driver has option settings to reconfigure this behavior, to let you use the rear and front jacks as separate devices. But my version didn’t have those settings, no “Playback Device” section at all.

Following some cargo cult advice I solved this problem by just uninstalling Realtek entirely. Goodbye 500 MB of stupid reverb effects I’ll never use. Turns out Windows 10 itself can manage the audio hardware with no problems. I did have to unplug and re-plug the devices for Windows to detect them, but now my speakers and headphones show up as separate sound devices.

Capture.PNG

While I’m here, a little theory on how this all works in Windows. Each sound device is an independent output channel for apps to play to. Most apps just play to the “Default App”, which you configure in the Sound control panel or with a program like SoundSwitch. But some apps let you choose a specific output device, particularly games, and you can use that to play different sounds simultaneously through different apps. There’s also a notion of a “Communications device” separate from the usual default, I think for VOIP apps like Skype to use a headset always.

I’m still confused about what drivers are involved. Device Manager tells me stuff is being managed by Microsoft’s Driver 10.0.14393.0, which I think is just Windows 10. But Sound tells me that there’s also a RealTek Controller which a RealTek Driver 6.0.1.7910. I wonder if Microsoft ships that, or if I didn’t uninstall that driver when I uninstalled the Realtek Audio Manager?

Update: this stopped working after I rebooted.

Garage door remote radio

Spent way too much time today learning about how radio garage door openers work. Good articles on Wikipedia: remotes and rolling codes.

Most garage door openers work on a radio signal in 300-400MHz. There are various identification / code systems in use to uniquely pair transmitters and receivers.

My San Francisco garage works by having the transmitter and receiver share a single 10-12 bit key that is programmed via DIP switches. Presumably they also have to agree on which frequency they speak. (Two gate controllers also work via DIP switches.) Note this kind of system is terribly insecure, it’s easy to build a universal opener that just sends all codes.

My Grass Valley garage has Intellicode, a rolling code. This works by the transmitter having a secret key. You put your receiver in “learning mode” and it memorizes the secret key. Then there’s a simple PRNG-like crypto protocol where the transmitter is generating one time passwords that the receiver recognizes. This is more secure than a fixed code, although there are attacks against it too.

There’s a variety of “learning remotes” that you can use to duplicate a garage door opener, to make a new transmitter. Fancy cars tend to have HomeLink systems. I just bought a Clicker battery powered remote.

HomeLink seems to work by first listening to a working transmitter, then copying it. Presumably it’s figuring out what frequency to use. And if it’s a fixed code, it learns the 10-12 bit code that otherwise you’d set with DIP switches. If there’s a rolling code you have to do an extra step of having the receiver now learn the HomeLink’s key.

The Clicker seems to work by me manually identifying which type of transmitter I’m trying to clone. It’s got a library of ~15 types, which presumably tells it what frequency to use and what kind of code it needs. Then there’s either physical DIP switches to set and memorize or for a rolling code, you have the receiver learn the Clicker’s key.

There’s also a new modern world of Internet-enabled garage door openers where you just tell it to open via a smartphone app. I’m told you can retrofit these as new receiver units wired into an existing working motor drive unit.

 

rsync to exFAT USB

Ran into a weird bug trying to rsync my music collection to a USB drive on a Linux box.

mkstemp function not implemented

This blog post has an explanation for the problem; rsync -a wants to set file owner, group, etc and exFAT doesn’t support those filesystem features. And apparently the Linux FUSE driver doesn’t just fail gracefully? Also not clear why it shows up as an error for mkstemp, except I imagine that libc function is also trying to set permissions.

Anyway trying the cargo cult solution which is not to use rsync -a, but instead just the options you really need, which are -rltD.

 rsync  –delete -rltDW –info=progress2

The -W is a bit of lagniappe, it’s supposed to help USB speeds. info=progress2 is a reasonable display for rsyncing 120GB of music files.

I’m seeing roughly 30±10MBytes/sec writing large files, . The destination is a USB 3.0 adapter for an SD Class 10 card. The card promises 80MB/sec reads and “somewhat slower write speeds”, so that seems reasonable.

 

Lightweight NTP clients for Unix

NTP is important, it sets your system clock. A proper Unix machine with an ordinary network connection should be within 10ms of true time. The problem is the traditional software we use to do this, ntpd, is old and complicated and has had a lot of security problems. It also does way more than your typical server needs, supporting obscure protocols and funky hardware you’ll never access.

I think a modern Unix machine just needs a simple network only time setter. Poll the time from ~4 NTP servers, discipline the clock to ~10ms, implement leap seconds correctly. That’s about it. I’m on the fence about client-only; if it’s not a big deal to be a simple server, that’d be better. I’m also ignorant about security, the historical crypto stuff in ntpd is pretty woolly.

A lot of other people think there should be a simpler time settings, there’s a bunch of alternatives now.

  • chrony is the best alternative I know of. It seems to do time correctly, and it has some clever accommodations for running in difficult environments like a VM or on a machine like a laptop that’s asleep a lot of time.
  • NTPSec, a big effort to first simplify the old ntpd code, then port it to a safe language like Rust or Go. The project has some problems but they are getting ambitious work done. Keep an eye on it.
  • systemd-timesyncd is everywhere now thanks to systemd. It’s too simple though, really just an SNTP client, and can’t discipline the clock nearly accurately enough to be useful for good time.
  • ntimed, see the blog. This project was looking promising but seems to have stalled out.
  • openntpd, the OpenBSD rewrite of an NTP daemon. It has a lot of problems including good clock discipline and leap seconds and is not really suitable.
  • ntpd! The venerable classic. Despite the problems the bugs are being fixed and it’s still the daemon I suspect powers most of the world’s Unix machines.

Chrony has a very useful comparison of chrony, ntp, and openntpd. The Performance numbers at the bottom are what’s most interesting to me (those numbers are microseconds).

End of the day, I think ntpd is still a decent choice. Chrony looks like the best alternative. I don’t have experience with it to comment on. I have no way of knowing if it’s more secure than ntpd. It’s also in C and has had some security problems.

34″ ultrawide monitors: Asus vs Acer

I’ve had occasion to try out two fancy gaming monitors recently; the Asus ROG Swift PG348Q and the Acer Predator X34 bmiphz. They are nearly identical. Both are great. Buy whichever one is cheaper. Last few times I’ve looked one has been $1100 and one has been $1200. If it’s a coin flip, I think the Acer X34 is slightly better.

Both monitors have identical panels and specs, as you can see in this comparison. They’re both 3440 x 1440 monitors in a 34″ package (109 ppi), they both support NVidia GSync, they’re both IPS panels. They both have an “overclock” feature to run up to 100 fps. I think there’s no meaningful difference in the display. This one review found slightly better color fidelity in the Asus but given it’s the same panel I think that’s probably individual item variance or testing error, not a real thing. They sure look the same to me. The difference is in the extra electronics and details.

For electronics, they both have speakers that can be driven via USB, but the Asus PG348Q has absolute garbage 2W speakers whereas the Acer X34 has merely awful 7W speakers. Also the Acer is 100% better in that it has 4 USB outputs, not just 2. The Asus has slightly nicer buttons and OSD menu UI but you will use those things once at setup and never again.

I like the Acer stand better; it came preassembled and doesn’t have an unusable cable management feature. Also it’s not some ugly asymmetric weirdo thing like the Asus. Both monitors have stupid decorative LED lights shining down that you will immediately turn off. The Acer monitor has the word “PREDATOR” prominently on the front bezel which is sort of sinister, but it’s easy enough to ignore it or put some tape over the branding.

They’re great monitors. The 34″ 21:9 form factor is the first monitor big enough I haven’t felt any need to have a second monitor. The screen quality looks very good to me and I haven’t missed my old iMac screen at all. But I don’t have exacting color fidelity requirements. I will say both the Asus and Acer screens look a bit hot to me, even after fiddling with color calibration. They also both have suspiciously garish default color settings and weird “gaming modes” I don’t understand.