Namespace: PdfSharp.Drawing
Defines an object used to draw text.
public sealed class XFont
Gets the XFontFamily object associated with this XFont object.
public XFontFamily FontFamily { get; }
WRONG: Gets the face name of this Font object. Indeed, it returns the font family name.
public string Name { get; }
Indicates, whether this font was created from an existing document.
Intended to avoid unnecessary adding of new Fonts to the document when filling existing AcroForms.
public bool FromDocument { get; }
Gets or sets the name this Font is referenced by in an existing document
public string DocumentFontName { get; internal set; }
Gets the em-size of this font measured in the unit of this font object.
public double Size { get; }
Gets style information for this Font object.
public XFontStyleEx Style { get; }
Indicates whether this XFont object is bold.
public bool Bold { get; }
Indicates whether this XFont object is italic.
public bool Italic { get; }
Indicates whether this XFont object is stroke out.
public bool Strikeout { get; }
Indicates whether this XFont object is underlined.
public bool Underline { get; }
Gets the PDF options of the font.
public XPdfFontOptions PdfOptions { get; }
Gets the cell space for the font. The CellSpace is the line spacing, the sum of CellAscent and CellDescent and optionally some extra space.
public int CellSpace { get; internal set; }
Gets the cell ascent, the area above the base line that is used by the font.
public int CellAscent { get; internal set; }
Gets the cell descent, the area below the base line that is used by the font.
public int CellDescent { get; internal set; }
Gets the font metrics.
public XFontMetrics Metrics { get; }
XFontMetrics
The metrics.
Gets the line spacing of this font.
public int Height { get; }
Initializes a new instance of the XFont class.
public XFont(string familyName, double emSize)
familyName
String
Name of the font family.
emSize
Double
The em size.
Initializes a new instance of the XFont class.
public XFont(string familyName, double emSize, XFontStyleEx style)
familyName
String
Name of the font family.
emSize
Double
The em size.
style
XFontStyleEx
The font style.
Initializes a new instance of the XFont class.
public XFont(string familyName, double emSize, XFontStyleEx style, XPdfFontOptions pdfOptions)
familyName
String
Name of the font family.
emSize
Double
The em size.
style
XFontStyleEx
The font style.
pdfOptions
XPdfFontOptions
Additional PDF options.
Not yet implemented.
Initializes a new instance of the XFont class. Not yet implemented.
public XFont(string familyName, double emSize, XFontStyle style, XFontWeight weight, XFontStretch fontStretch, XPdfFontOptions pdfOptions, Nullable<XStyleSimulations> styleSimulations)
familyName
String
Name of the family.
emSize
Double
The em size.
style
XFontStyle
The style.
weight
XFontWeight
The weight.
fontStretch
XFontStretch
The font stretch.
pdfOptions
XPdfFontOptions
The PDF options.
styleSimulations
Nullable<XStyleSimulations>
The style simulations.
NotImplementedException
XFont
Not yet implemented.
Initializes a new instance of the XFont class. Not yet implemented.
public XFont(XTypeface typeface, double emSize, XPdfFontOptions pdfOptions, Nullable<XStyleSimulations> styleSimulations)
typeface
XTypeface
The typeface.
emSize
Double
The em size.
pdfOptions
XPdfFontOptions
The PDF options.
styleSimulations
Nullable<XStyleSimulations>
The style simulations.
NotImplementedException
XFont
Returns the line spacing, in pixels, of this font. The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of the character itself.
public double GetHeight()
Use GetHeight() without parameter.
Returns the line spacing, in the current unit of a specified Graphics object, of this font. The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of
public double GetHeight(XGraphics graphics)
graphics
XGraphics
Gets the sorted list of characters supported by this font.
public IReadOnlyList<int> GetSupportedCharacters()
IReadOnlyList<Int32>
The list of characters supported by this font, sorted in ascending order
Remarks:
The returned list may contain surrogates and/or surrogate pairs, so calling applications should use Char.ConvertFromUtf32(Int32) to convert such values to a valid string.