Table of Contents

Method IsMonospace

Namespace
Alternet.Skia
Assembly
Alternet.UI.Common.dll

IsMonospace(SKFont, float)

Returns true if the SKFont appears to be monospaced. It first checks Typeface.IsFixedPitch if available, then measures glyph advance widths.

public static bool IsMonospace(SKFont font, float tolerance = 0.5)

Parameters

font SKFont

The SKFont to test (must not be null).

tolerance float

Maximum allowed difference (in device/pixel units) between widest and narrowest glyph to consider the font monospace. Default 0.5f.

Returns

bool