Table of Contents

Method TextStyleWithFont

Namespace
BitMiracle.Docotic.Pdf.Layout
Assembly
BitMiracle.Docotic.Pdf.Layout.dll

TextStyleWithFont(SystemFont, FontEmbedMode?)

Creates a text style based on a font from the system font collection.

public TextStyle TextStyleWithFont(SystemFont font, FontEmbedMode? embedMode = null)

Parameters

font SystemFont

The description of the font.

embedMode FontEmbedMode?

The preferred font embed mode. Can be null.

Returns

TextStyle

The text style associated with the font.

Remarks

When embedMode is null the library embeds used glyphs for TrueType/OpenType fonts, does not embed built-in PDF fonts, and embeds all glyphs for Type1 and CFF fonts.

Read the Fonts and colors section of the C# PDF generation quick start guide for examples of using text styles.

Exceptions

ArgumentNullException

font is null.

UnsupportedFontException

Unable to load font. Make sure that the font is installed in the system font collection or can be loaded using the current IFontLoader.

TextStyleWithFont(FileInfo, FontEmbedMode?)

Creates a text style based on a font from file.

public TextStyle TextStyleWithFont(FileInfo file, FontEmbedMode? embedMode = null)

Parameters

file FileInfo

The font file.

embedMode FontEmbedMode?

The preferred font embed mode. Can be null.

Returns

TextStyle

The text style associated with the font.

Remarks

When embedMode is null the library embeds used glyphs for TrueType/OpenType fonts, does not embed built-in PDF fonts, and embeds all glyphs for Type1 and CFF fonts.

Read the Fonts and colors section of the C# PDF generation quick start guide for examples of using text styles.

Exceptions

ArgumentNullException

file is null.

TextStyleWithFont(Stream, FontEmbedMode?)

Creates a text style based on a font from stream.

public TextStyle TextStyleWithFont(Stream stream, FontEmbedMode? embedMode = null)

Parameters

stream Stream

The font stream.

embedMode FontEmbedMode?

The preferred font embed mode. Can be null.

Returns

TextStyle

The text style associated with the font.

Remarks

Caller of the method is responsible for disposing of the stream.

When embedMode is null the library embeds used glyphs for TrueType/OpenType fonts, does not embed built-in PDF fonts, and embeds all glyphs for Type1 and CFF fonts.

Read the Fonts and colors section of the C# PDF generation quick start guide for examples of using text styles.

Exceptions

ArgumentNullException

stream is null.