PDFType3Font¶
Namespace: O2S.Components.PDF4NET.Graphics
Defines a Type3 font.
Inheritance Object → PDFFont → PDFType3Font
Constructors¶
PDFType3Font()¶
Initializes a new PDFType3Font object.
PDFType3Font(String)¶
Initializes a new PDFType3Font object.
Parameters
name String
The font name.
PDFType3Font(PDFTrueTypeFont)¶
Initializes a new PDFType3Font object.
Parameters
font PDFTrueTypeFont
Source TrueType font.
Properties¶
Bold¶
Gets or sets a value indicating whether the font is bold.
Property Value
Boolean
If true, then the font has a bold appearance.
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
FirstChar¶
Gets or sets the first char in the font.
Property Value
Byte
The code of first character available in the font.
FontBBox¶
Gets or sets the font bbox.
Property Value
PDFStandardRectangle
The smallest rectangle that encloses all the glyphs in the font.
FontMatrix¶
Gets or sets the font matrix.
Property Value
PDFMatrix
The matrix that maps the glyph space to text space.
Remarks
common practice is to define glyphs in terms of a 1000-unit glyph coordinate system, in which case the font matrix is [0.001 0 0 0.001 0 0].
Glyphs¶
Gets the font glyphs.
Property Value
PDFType3GlyphCollection
The collection of font glyphs.
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
If true, then the font has an italic appearance.
LastChar¶
Gets or sets the last char in the font.
Property Value
Byte
The code of last character available in the font.
Metrics¶
Gets the font metrics.
Property Value
PDFFontMetrics
A PDFFontMetrics that represents the metrics of the font.
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.
Widths¶
Gets or sets the character widths.
Property Value
Double[]
An array of values that represent the character widths in glyph space.
Remarks
The number of elements in this array must be equal to PDFType3Font.LastChar - PDFType3Font.FirstChar + 1.
Methods¶
CreateGlyphFromUnicodeCodePoint(Byte, Int32)¶
Creates a PDFType3Glyph from the given code point and associates it with the given character code in this font.
Parameters
characterCode Byte
The character code in this font that is associated with the glyph image
codePoint Int32
Source code point for which the glyph image is extracted from the TrueType font
Remarks
This method can be used only if the PDFType3Font object has been created from a PDFTrueTypeFont object.
CreateGlyphFromUnicodeCodePoint(Byte, Int32, Boolean)¶
Creates a PDFType3Glyph from the given code point and associates it with the given character code in this font.
Parameters
characterCode Byte
The character code in this font that is associated with the glyph image
codePoint Int32
Source code point for which the glyph image is extracted from the TrueType font
coloredGlyph Boolean
True if the glyph contains color information, no if the glyph is painted using current fill color
Remarks
This method can be used only if the PDFType3Font object has been created from a PDFTrueTypeFont object.
EnableTextCopy()¶
This method sets up the proper structures to support text copy operations when character codes have been mapped to Unicode codepoints.
GetCharWidth(Char)¶
Gets the width of the given character when drawn with this font object.
Parameters
charCode Char
the char to get its width
Returns
Double
This method returns a float value that represents the width, in
unscaled glyph units, of the given character.
Remarks
To scale this value to font's current size, divide it by 1000 and multiply it by font size. For example, if font size is 20pt, then the width, in points, of a character for this font is 20 * GetCharWidth( charCode ) / 1000.