Skip to content

PDFUnicodeTrueTypeFont

Namespace: O2S.Components.PDF4NET.Graphics

Defines an Unicode TrueType font.

public class PDFUnicodeTrueTypeFont : PDFTrueTypeFont

Inheritance ObjectPDFFontPDFTrueTypeFontPDFUnicodeTrueTypeFont

Remarks

An Unicde TrueType font can display all Unicode characters.

Constructors

PDFUnicodeTrueTypeFont(String, Double, Boolean)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(string path, double size, bool embed)

Parameters

path String
Path to TrueType font file.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.


PDFUnicodeTrueTypeFont(String, Double, Boolean, PDFTrueTypeFontFeatures)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(string path, double size, bool embed, PDFTrueTypeFontFeatures fontFeatures)

Parameters

path String
Path to TrueType font file.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.

fontFeatures PDFTrueTypeFontFeatures
Optional font features to be loaded from the font file


PDFUnicodeTrueTypeFont(String, Int32, Double, Boolean)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(string path, int index, double size, bool embed)

Parameters

path String
Path to TrueType font collection file.

index Int32
TrueType font index in the collection.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.


PDFUnicodeTrueTypeFont(String, Int32, Double, Boolean, PDFTrueTypeFontFeatures)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(string path, int index, double size, bool embed, PDFTrueTypeFontFeatures fontFeatures)

Parameters

path String
Path to TrueType font collection file.

index Int32
TrueType font index in the collection.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.

fontFeatures PDFTrueTypeFontFeatures
Optional font features to be loaded from the font file


PDFUnicodeTrueTypeFont(Stream, Double, Boolean)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(Stream stream, double size, bool embed)

Parameters

stream Stream
TrueType font stream

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.


PDFUnicodeTrueTypeFont(Stream, Double, Boolean, PDFTrueTypeFontFeatures)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(Stream stream, double size, bool embed, PDFTrueTypeFontFeatures fontFeatures)

Parameters

stream Stream
TrueType font stream

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.

fontFeatures PDFTrueTypeFontFeatures
Optional font features to be loaded from the font file


PDFUnicodeTrueTypeFont(Stream, Int32, Double, Boolean)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(Stream stream, int index, double size, bool embed)

Parameters

stream Stream
TrueType collection stream.

index Int32
TrueType font index in the collection.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.


PDFUnicodeTrueTypeFont(Stream, Int32, Double, Boolean, PDFTrueTypeFontFeatures)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(Stream stream, int index, double size, bool embed, PDFTrueTypeFontFeatures fontFeatures)

Parameters

stream Stream
TrueType collection stream.

index Int32
TrueType font index in the collection.

size Double
Font size.

embed Boolean
If true, the font will be embedded in the PDF file.

fontFeatures PDFTrueTypeFontFeatures
Optional font features to be loaded from the font file


PDFUnicodeTrueTypeFont(PDFUnicodeTrueTypeFont)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(PDFUnicodeTrueTypeFont font)

Parameters

font PDFUnicodeTrueTypeFont
Source TrueType font.


PDFUnicodeTrueTypeFont(PDFUnicodeTrueTypeFont, Double)

Initializes a new PDFUnicodeTrueTypeFont object.

public PDFUnicodeTrueTypeFont(PDFUnicodeTrueTypeFont font, double size)

Parameters

font PDFUnicodeTrueTypeFont
Source TrueType font.

size Double
Size of the new font.


Properties

Bold

Gets or sets a value indicating whether the font is bold.

public bool Bold { get; set; }

Property Value

Boolean
True if the font has a bold appearance.

Remarks

This property has no effect if the font is embedded.


CharacterSpacing

Gets or sets the character spacing to be used by this font.

public double CharacterSpacing { get; set; }

Property Value

Double
Character spacing in unscaled text units.


CosFont

Gets the COS font dictionary.

public PDFCosDictionary CosFont { get; }

Property Value

PDFCosDictionary


EnableFontSubset

Gets or sets a value indicating whether this font must be subset or not.

public bool EnableFontSubset { get; set; }

Property Value

Boolean
True if the font data should be subset in order to reduce the final font size, false if the whole font file should be embedded in the PDF file. Default is true.


EnableTextCopy

Gets or sets a value indicating whether the font supports text copy/paste operations.

public bool EnableTextCopy { get; set; }

Property Value

Boolean
If true the text drawn with the font can be selected, copied and pasted correctly in another applications. If false the copy/paste operations will generate garbage.

Remarks

This property must be set before drawing any text using the font otherwise the results are undefined.


FontFeatures

Gets the font features used for font creation.

public PDFTrueTypeFontFeatures FontFeatures { get; }

Property Value

PDFTrueTypeFontFeatures
A PDFTrueTypeFontFeatures object specifying the font features that were loaded when the font was created.

Remarks

After the font has been created, this property allows to enable/disable later on font features that were enabled during font creation. Features that were disabled during font creation cannot be enabled later.


HorizontalScaling

Gets or sets the text horizontal scaling to be used by this font.

public double HorizontalScaling { get; set; }

Property Value

Double
Percentage of the normal width of the glyphs, with 100 being the normal width.

Remarks

The horizontal scaling property adjusts the width of glyphs by stretching or compressing them in the horizontal direction.


Italic

Gets or sets a value indicating whether the font is italic.

public bool Italic { get; set; }

Property Value

Boolean
True if the font has an italic appearance.

Remarks

This property has no effect if the font is embedded.


Metrics

Gets the font metrics.

public PDFFontMetrics Metrics { get; }

Property Value

PDFFontMetrics
A PDFFontMetrics that represents the metrics of the font.


Name

Gets the name of this font.

public string Name { get; }

Property Value

String
The name of the font as it appears in the font file.


Size

Gets or sets the font size.

public double Size { get; set; }

Property Value

Double
The font size in PDF points.


Strikethrough

Gets or sets a value indicating whether the font is strikethrough.

public bool Strikethrough { get; set; }

Property Value

Boolean
If true, then the font has a strikethrough appearance.


StrikethroughOffset

Gets or sets the strikethrough offset.

public double StrikethroughOffset { get; set; }

Property Value

Double
Offset from text baseline for drawing the strikethrough.

Remarks

The offset is given in PDF points. 0 means default strikethrough offset.


TextRenderingMode

Gets or sets the text rendering mode.

public PDFTextRenderingMode TextRenderingMode { get; set; }

Property Value

PDFTextRenderingMode
A PDFTextRenderingMode specifying how the text is rendered using this font.


Underline

Gets or sets a value indicating whether the font is underlined.

public bool Underline { get; set; }

Property Value

Boolean
If true, then the font has an underlined appearance.