Table of Contents

Enum FontEdging

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

How a glyph's edges are turned into pixels.

public enum FontEdging

Fields

Alias = 1

One bit per pixel: a pixel is covered when its centre is inside the outline (nonzero rule).

Antialias = 0

Grayscale antialiasing: each pixel covered by the share of its area inside the outline.

Lcd = 2

Subpixel (LCD) antialiasing: coverage at three times the resolution along the canvas's pixel geometry, low-pass filtered and blended per color channel. Drawn only onto an opaque 8-bit RGB target with a known pixel geometry and a solid source-over paint; anything else falls back to Antialias with one diagnostic per canvas. Never for color glyphs.

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);
}