Back to Devexpress

GraphicsCache.GetFont(Font, FontStyle) Method

windowsforms-devexpress-dot-utils-dot-drawing-dot-graphicscache-dot-getfont-x28-system-dot-drawing-dot-font-system-dot-drawing-dot-fontstyle-x29.md

latest2.7 KB
Original Source

GraphicsCache.GetFont(Font, FontStyle) Method

Gets a font object with the specified settings.

Namespace : DevExpress.Utils.Drawing

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public Font GetFont(
    Font font,
    FontStyle fontStyle
)
vb
Public Function GetFont(
    font As Font,
    fontStyle As FontStyle
) As Font

Parameters

NameTypeDescription
fontFont

A Font object whose settings specify the desired font’s typeface and size.

| | fontStyle | FontStyle |

A bitwise combination of Font enumeration values specifying the desired font style.

|

Returns

TypeDescription
Font

A Font object representing a font with the specified settings.

|

Remarks

The following cases may take place:

  • the method returns the font object which was passed as the parameter if its style matches the font style specified;
  • if the specified font object’s style doesn’t match the font style specified, the method searches for a font with the desired settings in the internal fonts hashtable. If found, the font is returned;
  • if the internal fonts hashtable doesn’t contain the desired font, a new font object is created, customized to meet the desired settings, added to the hashtable and then returned.

See Also

GetGradientBrush

GetPen

GetSolidBrush(Color)

GraphicsCache Class

GraphicsCache Members

DevExpress.Utils.Drawing Namespace