Table of Contents

Struct FontQuery

Namespace
NetPdf
Assembly
NetPdf.dll

A request to find a font face. Family is the CSS-resolved family name (after generic-family expansion). The query maps directly onto the three CSS Fonts Module Level 4 §5.2 matching axes: StretchCss, Style, and WeightCss.

public readonly record struct FontQuery : IEquatable<FontQuery>
Implements
Inherited Members

Remarks

Italic vs oblique policy. The default SystemFontResolver treats Italic and Oblique as synonyms when matching against system fonts — CSS Fonts Module Level 4 §5.2 explicitly permits this: "User agents may treat italic and oblique as synonyms when matching." Custom IFontResolver implementations are free to distinguish them; the underlying parsed metadata preserves both flags.

Properties

Family

The CSS-resolved family name (case-insensitive ASCII match).

public required string Family { get; init; }

Property Value

string

Language

Optional BCP 47 language tag — reserved for future locale-aware matching.

public string? Language { get; init; }

Property Value

string

Script

Optional script tag (e.g. "Latn", "Arab") — reserved for future shaping integration.

public string? Script { get; init; }

Property Value

string

StretchCss

CSS stretch (font-stretch) in the range 1..9. 5 = normal width; 1 = ultra-condensed; 9 = ultra-expanded. Null means "unspecified" — the default SystemFontResolver treats null as 5 (normal width) per CSS Fonts Level 4 §5.2.3 default. Values outside 1..9 are clamped to that range by the default resolver; custom resolvers may apply a different policy.

public int? StretchCss { get; init; }

Property Value

int?

Style

The CSS font-style axis. Defaults to Normal.

public FontStyle Style { get; init; }

Property Value

FontStyle

WeightCss

CSS numeric weight in the range 1..1000. 400 = normal; 700 = bold. Values outside 1..1000 are not part of the public contract — resolvers may clamp or reject such values per their own policy.

public required int WeightCss { get; init; }

Property Value

int