PDFUnicodeTrueTypeFont¶
Namespace: O2S.Components.PDF4NET.Graphics
Defines an Unicode TrueType font.
Inheritance Object → PDFFont → PDFTrueTypeFont → PDFUnicodeTrueTypeFont
Remarks
An Unicde TrueType font can display all Unicode characters.
Constructors¶
PDFUnicodeTrueTypeFont(String, Double, Boolean)¶
Initializes a new PDFUnicodeTrueTypeFont object.
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.
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.
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.
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.
Parameters
font PDFUnicodeTrueTypeFont
Source TrueType font.
PDFUnicodeTrueTypeFont(PDFUnicodeTrueTypeFont, Double)¶
Initializes a new PDFUnicodeTrueTypeFont object.
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.
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.
Property Value
Double
Character spacing in unscaled text units.
CosFont¶
Gets the COS font dictionary.
Property Value
EnableFontSubset¶
Gets or sets a value indicating whether this font must be subset or not.
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.
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.
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.
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.
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.
Property Value
PDFFontMetrics
A PDFFontMetrics that represents the metrics of the font.
Name¶
Gets the name of this font.
Property Value
String
The name of the font as it appears in the font file.
Size¶
Gets or sets the font size.
Property Value
Double
The font size in PDF points.
Strikethrough¶
Gets or sets a value indicating whether the font is strikethrough.
Property Value
Boolean
If true, then the font has a strikethrough appearance.
StrikethroughOffset¶
Gets or sets the strikethrough offset.
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.
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.
Property Value
Boolean
If true, then the font has an underlined appearance.