Table of Contents

Method FindClosestWeight

Namespace
Velvet
Assembly
Velvet.Docs.dll

FindClosestWeight(VelvetFontWeight)

Picks the entry CSS's font matching algorithm picks for requested among the entries of normal width: an exact weight if one is registered; otherwise, for a request from 400 to 500, the lightest entry from the request up to 500, then the heaviest below the request, then the lightest above 500; for a request under 400, the heaviest at or below it, then the lightest above; for a request over 500, the lightest at or above it, then the heaviest below. Of two entries at one weight, the later is picked. Returns null when the family has no entries.

public VelvetFontWeightEntry? FindClosestWeight(VelvetFontWeight requested)

Parameters

requested VelvetFontWeight

Returns

VelvetFontWeightEntry