Substitute Property

Definition

Namespace Broadside.Fonts
Assembly Broadside.dll

Gets the font program the CIDFont is drawn with when it has no usable embedded program, found by the engine's font resolvers (UseFontResolver(IFontResolver), the operating system's fonts); null when it has a usable embedded program or no resolver has one.

public FontSubstitute? Substitute { get; }

Returns

Remarks

ISO 32000-2 §9.7.4, as Substitute: the resolvers are asked for the CIDFont by name, with its CIDFont type, character collection and descriptor facts (FontQuery), then for the most similar Standard 14 font. A substitute standing in for another font records an information diagnostic naming both; when nothing is found, an information diagnostic says so (never thrown in strict mode: which fonts a machine has is not a deviation of the file).

GetGlyphId(Int32) then selects the substitute's glyph: a CID-keyed CFF substitute by its charset; otherwise the CID's Unicode value from the collection's CID-to-Unicode table (§9.10.2, Adobe-Japan1-UCS2 and the like, through CidToUnicode) looked up in the substitute's Unicode "cmap"; and for an Exact substitute of a CIDFontType2 without such a table (Adobe-Identity), the CID as the glyph id, since an Identity CIDFont's CIDs are the glyph ids of the font it was made from. When none of these reaches a glyph and the CIDs have no Unicode table (Adobe-Identity), ReadGlyph(ReadOnlySpan<Byte>) takes the code's single character from the Type 0 font's ToUnicode CMap and looks it up in the substitute's Unicode "cmap". Text keeps the CIDFont's own widths.