Table of Contents

Class FontFaceReference

Namespace
SharpDX.DirectWrite
Assembly
SharpDX.Direct2D1.dll
[Guid("5E7FA7CA-DDE3-424C-89F0-9FCD6FED58CD")]
public class FontFaceReference : ComObject
Inheritance
FontFaceReference

Constructors

FontFaceReference(nint)

public FontFaceReference(nint nativePtr)

Parameters

nativePtr nint

Properties

FileSize

Get the total size of the font face in bytes.

public long FileSize { get; }

Property Value

long

FileTime

Get the last modified date.

public long FileTime { get; }

Property Value

long

FontFaceIndex

Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face, the return value is zero.

public int FontFaceIndex { get; }

Property Value

int

FontFile

Obtains the font file representing a font face.

public FontFile FontFile { get; }

Property Value

FontFile

LocalFileSize

Get the local size of the font face in bytes, which will always be less than or equal to GetFullSize. If the locality is remote, this value is zero. If full, this value will equal GetFileSize.

public long LocalFileSize { get; }

Property Value

long

Locality

Get the locality of this font face reference.

public Locality Locality { get; }

Property Value

Locality

Remarks

You can always successfully create a font face from a fully local font. Attempting to create a font face on a remote or partially local font may fail with DWRITE_E_REMOTEFONT. This function may change between calls depending on background downloads and whether cached data expires.

Simulations

Obtains the algorithmic style simulation flags of a font face.

public FontSimulations Simulations { get; }

Property Value

FontSimulations

Methods

CreateFontFace(out FontFace3)

Creates a font face from the reference for use with layout, shaping, or rendering.

public void CreateFontFace(out FontFace3 fontFace)

Parameters

fontFace FontFace3

Newly created font face object, or nullptr in the case of failure.

Remarks

This function can fail with DWRITE_E_REMOTEFONT if the font is not local.

CreateFontFaceWithSimulations(FontSimulations, out FontFace3)

Creates a font face with alternate font simulations, for example, to explicitly simulate a bold font face out of a regular variant.

public void CreateFontFaceWithSimulations(FontSimulations fontFaceSimulationFlags, out FontFace3 fontFace)

Parameters

fontFaceSimulationFlags FontSimulations

Font face simulation flags for algorithmic emboldening and italicization.

fontFace FontFace3

Newly created font face object, or nullptr in the case of failure.

Remarks

This function can fail with DWRITE_E_REMOTEFONT if the font is not local.

EnqueueCharacterDownloadRequest(string, int)

Adds a request to the font download queue (FontDownloadQueue).

public void EnqueueCharacterDownloadRequest(string characters, int characterCount)

Parameters

characters string

No documentation.

characterCount int

No documentation.

Remarks

Downloading a character involves downloading every glyph it depends on directly or indirectly, via font tables (cmap, GSUB, COLR, glyf).

EnqueueFileFragmentDownloadRequest(long, long)

Adds a request to the font download queue (FontDownloadQueue).

public void EnqueueFileFragmentDownloadRequest(long fileOffset, long fragmentSize)

Parameters

fileOffset long

No documentation.

fragmentSize long

No documentation.

EnqueueFontDownloadRequest()

Adds a request to the font download queue (FontDownloadQueue).

public void EnqueueFontDownloadRequest()

EnqueueGlyphDownloadRequest(short[], int)

Adds a request to the font download queue (FontDownloadQueue).

public void EnqueueGlyphDownloadRequest(short[] glyphIndices, int glyphCount)

Parameters

glyphIndices short[]

No documentation.

glyphCount int

No documentation.

Remarks

Downloading a glyph involves downloading any other glyphs it depends on from the font tables (GSUB, COLR, glyf).

Equals(FontFaceReference)

No documentation.

public RawBool Equals(FontFaceReference fontFaceReference)

Parameters

fontFaceReference FontFaceReference

No documentation.

Returns

RawBool

No documentation.

Operators

explicit operator FontFaceReference(nint)

public static explicit operator FontFaceReference(nint nativePtr)

Parameters

nativePtr nint

Returns

FontFaceReference