PDFAnsiTrueTypeFont¶
Namespace: O2S.Components.PDF4NET.Graphics
Defines an ANSI TrueType font.
Inheritance Object → PDFFont → PDFTrueTypeFont → PDFAnsiTrueTypeFont
Remarks
An ANSI TrueType font supports only the Windows 1252 encoding, Unicode characters cannot be displayed.
Constructors¶
PDFAnsiTrueTypeFont(String, Double, Boolean)¶
Initializes a new PDFTrueTypeFont 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.
PDFAnsiTrueTypeFont(String, Int32, Double, Boolean)¶
Initializes a new PDFTrueTypeFont 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.
PDFAnsiTrueTypeFont(Stream, Double, Boolean)¶
Initializes a new PDFTrueTypeFont object.
Parameters
stream Stream
TrueType font stream
size Double
Font size.
embed Boolean
If true, the font will be embedded in the PDF file.
PDFAnsiTrueTypeFont(Stream, Int32, Double, Boolean)¶
Initializes a new PDFTrueTypeFont 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.
PDFAnsiTrueTypeFont(PDFAnsiTrueTypeFont)¶
Initializes a new PDFAnsiTrueTypeFont object.
Parameters
font PDFAnsiTrueTypeFont
Source TrueType font.
PDFAnsiTrueTypeFont(PDFAnsiTrueTypeFont, Double)¶
Initializes a new PDFAnsiTrueTypeFont object.
Parameters
font PDFAnsiTrueTypeFont
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.
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.