PeachDrawing.Core

PeachDrawing.Core.RenderContext

RenderContext.AddFontFromBytes(string, ReadOnlyMemory<byte>, FontFaceDescriptors) Method

Adds a font whose file bytes the caller already holds under fontFamilyName (TrueType, OpenType, WOFF or WOFF2, recognised by content), without going through a URL: the way to use a font embedded in a document being imported.

public System.Threading.Tasks.ValueTask<bool> AddFontFromBytes(string fontFamilyName, System.ReadOnlyMemory<byte> data, PeachDrawing.Core.FontFaceDescriptors descriptors=default(PeachDrawing.Core.FontFaceDescriptors));

Parameters

fontFamilyName System.String

the family name to register the font under

data System.ReadOnlyMemory<System.Byte>

the font file

descriptors FontFaceDescriptors

the weight, width and style the font is declared for

Returns

System.Threading.Tasks.ValueTask<System.Boolean>
true when the font was added