I have an idea, that I can have a font size like 16×32, then downscale it for various sizes. Unfortunately, a downscaling algorithm has to be picked, and bilinear leads to some inconsistency:
At the top there are some vertical lines being inconsistently downscaled into sharp and blurry, straight and bent.
At the middle, there is a sample of () being downscaled 2x horizontally.
At the bottom, a sample text in 16×32 Custom Font is downscaled to 8×16. Note how T, i, j and l have blurry vertical lines. Yet, when I shift the text one pixel left, the vertical lines switch their roles:
A gaussian blur applied beforehand leads to this blurry, but more consistent downscaling
What is the best way to downscale a bitmap font? Is it possible to somehow use hinting on a bitmap font?
Here is the sentence unshifted, which is what you should scale from, as many algorithms, like bilinear, are sensitive to pixel shifts:
Edit: I found out there is also a filter called a triangle filter; its scaling looks like this:
Compared to bilinear, which looks like this:
The triangle filter seems to give decent results, compared to the blurry Gaussian blur with scaling, or the highly inconsistent bilinear.
Also, there is an assumption in the scaling I want: each character is scaled individually to a size where width and height are both integers.