Skip to main content

GraphicsCache.GetFont(Font, FontStyle) Method

Gets a font object with the specified settings.

Namespace: DevExpress.Utils.Drawing

Assembly: DevExpress.Utils.v24.1.dll

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

Declaration

public Font GetFont(
    Font font,
    FontStyle fontStyle
)

Parameters

Name Type Description
font Font

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

Type Description
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