Enum FontHinting
How glyph outlines are fitted to the pixel grid before rasterizing.
public enum FontHinting
Fields
Full = 2The font's own TrueType instructions, run by Egami's interpreter for HintingTarget (in ClearType compatibility mode, as Windows runs them for ClearType), at a whole number of pixels per em, up to 256, under scale-and-translate transforms with equal x and y scales. Faces without instructions, CFF faces, variable faces and sizes the gasp table leaves unhinted fall back to Light.
Light = 1Vertical only, after a light autohinter: the scale is nudged so the x-height lands on a whole pixel; the baseline, x-height and cap-height zones (from a CFF font's blue zones, else measured from the font's own flat glyphs) snap to whole pixels while they are under 3/4 pixel tall; each glyph's horizontal stems between them sit on whole pixels with their height kept; other points follow. x values and advances never move. Applies up to 48 pixels per em under scale-and-translate transforms.
None = 0Outlines are drawn as designed, at their exact positions.
Examples
// Small text for a screen: light hinting (vertical only), quarter-pixel origins (the default) and, for an RGB display
// the image will not leave, LCD edging.
var screen = new Font(face, 13) { Hinting = FontHinting.Light, Edging = FontEdging.Lcd };
using (RasterCanvas<Rgba8> canvas = image.CreateCanvas(new CanvasOptions { PixelGeometry = PixelGeometry.RgbHorizontal }))
{
canvas.DrawText("Crisp caption", new Vector2(8, 24), screen, Rgba8.Black);
// A face matched for bold italic it lacks is emboldened and slanted, unless AllowSynthesis is off.
var synthetic = new Font(face, 13) { Synthesis = FontSynthesis.Bold | FontSynthesis.Italic };
canvas.DrawText("Synthetic bold italic", new Vector2(8, 48), synthetic, Rgba8.Black);
}