C# Класс ARCed.Helpers.FontHelper

Static class for loading and creating Fonts in memory without the need to have them installed.
In order for a memory font to be drawn on a control, it must be rendered with GDI+, so "SetCompatibleTextRenderingDefault" must be set for the application, or "UseCompatibleTextRendering" for individual controls.
Показать файл Открыть проект

Открытые методы

Метод Описание
AddFileFont ( string filename ) : void

Adds a private memory font from a file

AddFont ( Stream stream ) : void

Adds a private memory font from a stream

The stream will be closed automatically after the font is loaded

AddResourceFont ( byte bytes ) : void

Adds a font from an array of bytes

AddResourceFont ( string resourceName ) : void

Adds a private memory font from an embedded resource

GetFont ( string familyName, float size, FontStyle style ) : Font

Creates and returns a font, first checking memorized fonts.

GetMemoryFont ( string familyName, float size, FontStyle style ) : Font

Finds and creates a font from a font family previously loaded into memory

IsInstalled ( string fontName ) : bool

Checks if a font is installed on the machine and returns the result

LoadUserFonts ( ) : void

Loads all TrueType fonts found in the application's "Fonts" folder into memory.

This method also loads resource fonts embedded into the application.

Описание методов

AddFileFont() публичный статический Метод

Adds a private memory font from a file
public static AddFileFont ( string filename ) : void
filename string The path of the file
Результат void

AddFont() публичный статический Метод

Adds a private memory font from a stream
The stream will be closed automatically after the font is loaded
public static AddFont ( Stream stream ) : void
stream Stream The stream to load the font from
Результат void

AddResourceFont() публичный статический Метод

Adds a font from an array of bytes
public static AddResourceFont ( byte bytes ) : void
bytes byte Array of bytes to read
Результат void

AddResourceFont() публичный статический Метод

Adds a private memory font from an embedded resource
public static AddResourceFont ( string resourceName ) : void
resourceName string The full names, including namespaces, of the resource file
Результат void

GetFont() публичный статический Метод

Creates and returns a font, first checking memorized fonts.
public static GetFont ( string familyName, float size, FontStyle style ) : Font
familyName string Name of the font family
size float Size of the font
style FontStyle Style to apply to the font
Результат System.Drawing.Font

GetMemoryFont() публичный статический Метод

Finds and creates a font from a font family previously loaded into memory
public static GetMemoryFont ( string familyName, float size, FontStyle style ) : Font
familyName string Name of the font family
size float Size of the font
style FontStyle Style to apply to the font
Результат System.Drawing.Font

IsInstalled() публичный статический Метод

Checks if a font is installed on the machine and returns the result
public static IsInstalled ( string fontName ) : bool
fontName string The names of the font to check for
Результат bool

LoadUserFonts() публичный статический Метод

Loads all TrueType fonts found in the application's "Fonts" folder into memory.
This method also loads resource fonts embedded into the application.
public static LoadUserFonts ( ) : void
Результат void