Is there an algorithm to bold an outline font? One of my friend got a pretty pretty Chinese hand-writing font. However, the font has no bold version, since it is handwritten. And I would like to help generate a bold one automatically by code.

I searched the Internet but didn't find any materials about it. My friend told me that his Kindle could "bold" that font automatically by setting "contrast". So I tried to firstly convert the outline font to bitmap, then change the contrast of the glyphs one by one, and finally output a bitmap "bolded" font. Everything went well except the processed font is aliased, i.e. looks blocky, since that the bitmaps is binary images, i.e. there are no gray pixels. But I can't find a popular font type that supports bitmap plus gray pixels.

So, is there an algorithm to bold an outline font? What is it?
The best way to do proper outlines, is unfortunately, also the hardest. It involves calculating an offset curve, usually from the medial axis or straight skeletons, which are non-trivial to calculate. Once you have those, you can calculate the distance of any point from the input object and decide whether to draw the outline or bolding, or not.

A simpler way to do it, which doesn't look quite as nice, is to use a MinMax filter. This is a sliding 2D box filter that calculates either the minimum or maximum value within the box at each input pixel. If you have black text on a white background, you can use the min filter to generate an outline. Use the max if it's white text on a black background. Other shapes, such as a circular area will produce different results that may be better for some fonts. In most cases, you'll end up either rounding off or squaring off corners as the size of the filter increases.