I got a question from a user of my font
Anonymous Pro, which contains embedded bitmaps for some sizes. They appear in certain circumstances (for instance, they can be enabled by turning off font smoothing in Terminal on macOS).
This user wants to use Anonymous Pro on his website and display the bitmaps, but he hasn't been able to make that happen. As far as I know, it's not possible with modern browsers to disable antialiasing via CSS or other means from the server side. I'm wondering if anyone can confirm this.
Comments
The gasp table determines how rasterisation is applied at ppem sizes/ranges. You can set to grid-fitting only, but that won’t necessarily mean that you get the embedded bitmaps.
As Mark suggests, you can make a vector-based "pixel" font which will render correctly if the font size is set to a multiple of the pixels per em. You can see a demo of this in the introductory sentence on my home page. The catch is, that since most web browsers artificially embolden fonts by default (up to a certain px size), this creates a dark halo effect on the text which can be mostly eliminated through the non-standard CSS feature font-smooth (you'll need to use the vendor-prefixed properties).
The first line for Firefox and the second line for Safari and Chrome:
Embedded bitmaps are a legacy of early TrueType, an alternative to delta hinting for small ppems on low res 1-bit displays. It is rare to find fonts that have them nowadays, so it's not surprising there is little support for them in modern apps and operating systems, including web browsers.
In the end, I think the solution in this user's situation is a faux pixel font, plus the setting to reduce font smoothing, as @Justin Penner mentions.
Turns out, it's easier than I remembered to make such a font starting from a legacy-format bitmap font using BitFonter 3, an app produced by FontLab about 15 years ago, which is what I used to create the embedded bitmaps in Anonymous Pro back then in the first place. I keep an older Mac laptop around for running apps like this that are no longer supported on modern Macs. I just had to remember how to use it (BitFonter 3, that is).