C# 클래스 Duality.Resources.Font

상속: Resource
파일 보기 프로젝트 열기: BraveSirAndrew/duality 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
None ContentRef
SupportedChars string

Private Properties

프로퍼티 타입 설명
CreateInternalMaterial void
CreateInternalTexture void
Font System
GenerateResources void
GetFontFamily System.Drawing.FontFamily
InitDefaultContent void
LoadFontFamilyFromMemory System.Drawing.FontFamily
LoadOrCreatePixelData void
ProcessTextAdv void
ReleaseResources void
UpdateInternalFont void

공개 메소드들

메소드 설명
EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices ) : int

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.

EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, ColorRgba clr ) : int

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.

EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, float z = 0.0f ) : int

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.

EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, float z, ColorRgba clr, float angle = 0.0f, float scale = 1.0f ) : int

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.

FitText ( string text, float maxWidth, FitTextMode fitMode = FitTextMode.ByChar ) : string

Returns a text that is cropped to fit a maximum width using this Font.

Font ( string familyName, float emSize, FontStyle style = FontStyle.Regular ) : System

Creates a new Font based on a system font.

GetGlyphBitmap ( char glyph ) : Duality.Resources.Pixmap.Layer

Retrieves the rasterized System.Drawing.Bitmap for a single glyph.

GetGlyphData ( char glyph, GlyphData &data ) : bool

Retrieves information about a single glyph.

LoadCustomFamilyData ( string path = null ) : void

Replaces the Fonts custom font family with a new dataset that has been retrieved from file.

MeasureText ( string text ) : System.Vector2

Measures the size of a text rendered using this Font.

MeasureTextGlyph ( string text, int index ) : System.Drawing.Rect

Measures position and size of a specific glyph inside a text.

PickTextGlyph ( string text, float x, float y ) : int

Returns the index of the glyph that is located at a certain location within a text.

ReloadData ( ) : void

Reloads this Fonts internal data and rasterizes its glyphs.

RenderToBitmap ( string text, Image target, float x = 0.0f, float y = 0.0f ) : void

Renders a text to the specified target Image.

RenderToBitmap ( string text, Image target, float x, float y, ColorRgba clr ) : void

Renders a text to the specified target Image.

RenderToBitmap ( string text, Duality.Resources.Pixmap target, float x = 0.0f, float y = 0.0f ) : void

Renders a text to the specified target Duality.Resources.Pixmap Duality.Resources.Pixmap.Layer.

RenderToBitmap ( string text, Duality.Resources.Pixmap target, float x, float y, ColorRgba clr ) : void

Renders a text to the specified target Duality.Resources.Pixmap Duality.Resources.Pixmap.Layer.

SaveCustomFamilyData ( string path = null ) : void

Saves the Fonts custom font family to file.

UpdateKerningData ( ) : void

Updates this Fonts kerning sample data.

보호된 메소드들

메소드 설명
OnCopyTo ( Resource r, Duality provider ) : void
OnDisposing ( bool manually ) : void
OnLoaded ( ) : void

비공개 메소드들

메소드 설명
CreateInternalMaterial ( ) : void
CreateInternalTexture ( ) : void
Font ( ) : System
GenerateResources ( ) : void
GetFontFamily ( string name ) : FontFamily

Retrieves a System.Drawing.FontFamily by its name.

InitDefaultContent ( ) : void
LoadFontFamilyFromMemory ( byte memory ) : FontFamily

Loads a System.Drawing.FontFamily from memory.

LoadOrCreatePixelData ( int cols, int rows, TextRenderingHint textRenderingHint ) : void
ProcessTextAdv ( string text, int index, GlyphData &glyphData, System.Drawing.Rect &uvRect, float &glyphXAdv, float &glyphXOff ) : void
ReleaseResources ( ) : void
UpdateInternalFont ( ) : void

메소드 상세

EmitTextVertices() 공개 메소드

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.
public EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices ) : int
text string The text to render.
vertices Duality.Drawing.VertexC1P3T2 The set of vertices that is emitted. You can re-use the same array each frame.
리턴 int

EmitTextVertices() 공개 메소드

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.
public EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, ColorRgba clr ) : int
text string The text to render.
vertices Duality.Drawing.VertexC1P3T2 The set of vertices that is emitted. You can re-use the same array each frame.
x float An X-Offset applied to the position of each emitted vertex.
y float An Y-Offset applied to the position of each emitted vertex.
clr ColorRgba The color value that is applied to each emitted vertex.
리턴 int

EmitTextVertices() 공개 메소드

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.
public EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, float z = 0.0f ) : int
text string The text to render.
vertices Duality.Drawing.VertexC1P3T2 The set of vertices that is emitted. You can re-use the same array each frame.
x float An X-Offset applied to the position of each emitted vertex.
y float An Y-Offset applied to the position of each emitted vertex.
z float An Z-Offset applied to the position of each emitted vertex.
리턴 int

EmitTextVertices() 공개 메소드

Emits a set of vertices based on a text. To render this text, simply use that set of vertices combined with the Fonts Material.
public EmitTextVertices ( string text, Duality.Drawing.VertexC1P3T2 &vertices, float x, float y, float z, ColorRgba clr, float angle = 0.0f, float scale = 1.0f ) : int
text string The text to render.
vertices Duality.Drawing.VertexC1P3T2 The set of vertices that is emitted. You can re-use the same array each frame.
x float An X-Offset applied to the position of each emitted vertex.
y float An Y-Offset applied to the position of each emitted vertex.
z float An Z-Offset applied to the position of each emitted vertex.
clr ColorRgba The color value that is applied to each emitted vertex.
angle float An angle by which the text is rotated (before applying the offset).
scale float A factor by which the text is scaled (before applying the offset).
리턴 int

FitText() 공개 메소드

Returns a text that is cropped to fit a maximum width using this Font.
public FitText ( string text, float maxWidth, FitTextMode fitMode = FitTextMode.ByChar ) : string
text string The original text.
maxWidth float The maximum width it may occupy.
fitMode FitTextMode The mode by which the text fitting algorithm operates.
리턴 string

Font() 공개 메소드

Creates a new Font based on a system font.
public Font ( string familyName, float emSize, FontStyle style = FontStyle.Regular ) : System
familyName string The font family to use.
emSize float The Fonts .
style FontStyle The Fonts style.
리턴 System

GetGlyphBitmap() 공개 메소드

Retrieves the rasterized System.Drawing.Bitmap for a single glyph.
public GetGlyphBitmap ( char glyph ) : Duality.Resources.Pixmap.Layer
glyph char The glyph of which to retrieve the Bitmap.
리턴 Duality.Resources.Pixmap.Layer

GetGlyphData() 공개 메소드

Retrieves information about a single glyph.
public GetGlyphData ( char glyph, GlyphData &data ) : bool
glyph char The glyph to retrieve information about.
data GlyphData A struct holding the retrieved information.
리턴 bool

LoadCustomFamilyData() 공개 메소드

Replaces the Fonts custom font family with a new dataset that has been retrieved from file.
public LoadCustomFamilyData ( string path = null ) : void
path string The path of the file from which to retrieve the new font family data.
리턴 void

MeasureText() 공개 메소드

Measures the size of a text rendered using this Font.
public MeasureText ( string text ) : System.Vector2
text string The text to measure.
리턴 System.Vector2

MeasureTextGlyph() 공개 메소드

Measures position and size of a specific glyph inside a text.
public MeasureTextGlyph ( string text, int index ) : System.Drawing.Rect
text string The text that contains the glyph to measure.
index int The index of the glyph to measure.
리턴 System.Drawing.Rect

OnCopyTo() 보호된 메소드

protected OnCopyTo ( Resource r, Duality provider ) : void
r Resource
provider Duality
리턴 void

OnDisposing() 보호된 메소드

protected OnDisposing ( bool manually ) : void
manually bool
리턴 void

OnLoaded() 보호된 메소드

protected OnLoaded ( ) : void
리턴 void

PickTextGlyph() 공개 메소드

Returns the index of the glyph that is located at a certain location within a text.
public PickTextGlyph ( string text, float x, float y ) : int
text string The text from which to pick a glyph.
x float X-Coordinate of the position where to look for a glyph.
y float Y-Coordinate of the position where to look for a glyph.
리턴 int

ReloadData() 공개 메소드

Reloads this Fonts internal data and rasterizes its glyphs.
public ReloadData ( ) : void
리턴 void

RenderToBitmap() 공개 메소드

Renders a text to the specified target Image.
public RenderToBitmap ( string text, Image target, float x = 0.0f, float y = 0.0f ) : void
text string
target Image
x float
y float
리턴 void

RenderToBitmap() 공개 메소드

Renders a text to the specified target Image.
public RenderToBitmap ( string text, Image target, float x, float y, ColorRgba clr ) : void
text string
target Image
x float
y float
clr ColorRgba
리턴 void

RenderToBitmap() 공개 메소드

Renders a text to the specified target Duality.Resources.Pixmap Duality.Resources.Pixmap.Layer.
public RenderToBitmap ( string text, Duality.Resources.Pixmap target, float x = 0.0f, float y = 0.0f ) : void
text string
target Duality.Resources.Pixmap
x float
y float
리턴 void

RenderToBitmap() 공개 메소드

Renders a text to the specified target Duality.Resources.Pixmap Duality.Resources.Pixmap.Layer.
public RenderToBitmap ( string text, Duality.Resources.Pixmap target, float x, float y, ColorRgba clr ) : void
text string
target Duality.Resources.Pixmap
x float
y float
clr ColorRgba
리턴 void

SaveCustomFamilyData() 공개 메소드

Saves the Fonts custom font family to file.
public SaveCustomFamilyData ( string path = null ) : void
path string The path of the file to which to save the font family data.
리턴 void

UpdateKerningData() 공개 메소드

Updates this Fonts kerning sample data.
public UpdateKerningData ( ) : void
리턴 void

프로퍼티 상세

None 공개적으로 정적으로 프로퍼티

Refers to a null reference Font.
public static ContentRef None
리턴 ContentRef

SupportedChars 공개적으로 정적으로 프로퍼티

A string containing all characters that are supported by Duality.
public static string SupportedChars
리턴 string