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.
파일 보기 프로젝트 열기: borisblizzard/arcreator

공개 메소드들

메소드 설명
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