PeachDrawing.PDF.PdfRenderContext
PdfRenderContext.AddFont Method
| Overloads | |
|---|---|
| AddFont(Stream, string) | Adds a font to the context so pages can draw with it. TrueType, OpenType, WOFF and WOFF2 are recognized by their content. |
| AddFont(Stream, string, FontFaceDescriptors, IReadOnlyList<RuneInterval>) | Adds a font to the context like AddFont(Stream, string), restricting which weights, widths and styles it is matched for and which characters it supplies. |
PdfRenderContext.AddFont(Stream, string) Method
Adds a font to the context so pages can draw with it. TrueType, OpenType, WOFF and WOFF2 are recognized by their content.
public System.Threading.Tasks.ValueTask AddFont(System.IO.Stream stream, string? fontFamilyName);
Parameters
stream System.IO.Stream
the font file; it is read to the end, and not closed
fontFamilyName System.String
the family name to register it under, or null to take the name from the font file
Returns
System.Threading.Tasks.ValueTask
a task that completes when the font has been added
PdfRenderContext.AddFont(Stream, string, FontFaceDescriptors, IReadOnlyList<RuneInterval>) Method
Adds a font to the context like AddFont(Stream, string), restricting which weights, widths and styles it is matched for and which characters it supplies.
public System.Threading.Tasks.ValueTask AddFont(System.IO.Stream stream, string? fontFamilyName, PeachDrawing.Core.FontFaceDescriptors descriptors, System.Collections.Generic.IReadOnlyList<PeachDrawing.Text.RuneInterval>? unicodeRanges=null);
Parameters
stream System.IO.Stream
the font file; it is read to the end, and not closed
fontFamilyName System.String
the family name to register it under, or null to take the name from the font file
descriptors FontFaceDescriptors
the weight, width, slant and style ranges the font is declared for
unicodeRanges System.Collections.Generic.IReadOnlyList<RuneInterval>
the characters the font supplies, or null for all it has
Returns
System.Threading.Tasks.ValueTask
a task that completes when the font has been added