C# Class QuickFont.QFont

Datei anzeigen Open project: swax/QuickFont Class Usage Examples

Public Properties

Property Type Description
VertexBuffers QVertexBuffer[]

Public Methods

Method Description
Begin ( ) : void
CreateTextureFontFiles ( Font font, string newFontName ) : void
CreateTextureFontFiles ( Font font, string newFontName, QFontBuilderConfiguration config ) : void
CreateTextureFontFiles ( string fileName, float size, FontStyle style, QFontBuilderConfiguration config, string newFontName ) : void
CreateTextureFontFiles ( string fileName, float size, FontStyle style, string newFontName ) : void
CreateTextureFontFiles ( string fileName, float size, QFontBuilderConfiguration config, string newFontName ) : void
CreateTextureFontFiles ( string fileName, float size, string newFontName ) : void
DrawVBOs ( ) : void
End ( ) : void
FromQFontFile ( string filePath ) : QFont
FromQFontFile ( string filePath, QFontLoaderConfiguration loaderConfig ) : QFont
FromQFontFile ( string filePath, float downSampleFactor ) : QFont
FromQFontFile ( string filePath, float downSampleFactor, QFontLoaderConfiguration loaderConfig ) : QFont
LoadVBOs ( ) : void
Measure ( ProcessedText processedText ) : SizeF

Measures the actual width and height of the block of text

Measure ( string text, QFontAlignment alignment = QFontAlignment.Left ) : SizeF
Measure ( string text, SizeF maxSize, QFontAlignment alignment ) : SizeF

Measures the actual width and height of the block of text.

PopOptions ( ) : void
Print ( ProcessedText processedText ) : void

Prints text as previously processed with a boundary and alignment.

Print ( ProcessedText processedText, System.Vector2 position ) : void
Print ( string text, QFontAlignment alignment = QFontAlignment.Left ) : void
Print ( string text, SizeF maxSize, QFontAlignment alignment ) : void

Prints text inside the given bounds.

Print ( string text, SizeF maxSize, QFontAlignment alignment, System.Vector2 position ) : void
Print ( string text, System.Vector2 position, QFontAlignment alignment = QFontAlignment.Left ) : void
PrintToVBO ( string text, QFontAlignment alignment, Vector3 position, Color color, SizeF maxSize ) : void
PrintToVBO ( string text, Vector3 position, Color color, QFontAlignment alignment = QFontAlignment.Left ) : void
ProcessText ( string text, SizeF maxSize, QFontAlignment alignment ) : ProcessedText

Creates node list object associated with the text.

PushOptions ( ) : void

Creates a clone of the current font options and pushes it onto the stack

PushOptions ( QFontRenderOptions newOptions ) : void

Pushes the specified QFont options onto the options stack

QFont ( Font font ) : System
QFont ( Font font, QFontBuilderConfiguration config ) : System
QFont ( string fileName, float size ) : System
QFont ( string fileName, float size, FontStyle style ) : System
QFont ( string fileName, float size, FontStyle style, QFontBuilderConfiguration config ) : System
QFont ( string fileName, float size, QFontBuilderConfiguration config ) : System
RefreshViewport ( ) : void

Invalidates the internally cached viewport, causing it to be reread the next time it is required. This should be called if the viewport and text is to be rendered to the new viewport.

RenderGlyph ( float x, float y, char c, bool isDropShadow ) : void
ResetVBOs ( ) : void

Private Methods

Method Description
BuildFont ( Font font, QFontBuilderConfiguration config, string saveName ) : QFontData
CrumbledWord ( TextNode node ) : bool
InitVBOs ( ) : void
JustifyLine ( TextNode node, float targetLength ) : void

Computes the length of the next line, and whether the line is valid for justification.

LockToPixel ( System.Vector2 input ) : System.Vector2
MeasureNextlineLength ( string text ) : float
OrthogonalTransform ( float &fontScale ) : TransformViewport

When TransformToOrthogProjection is enabled, we need to get the current orthogonal transformation, the font scale, and ensure that the projection is actually orthogonal

PrintOrMeasure ( ProcessedText processedText, bool measureOnly ) : SizeF
PrintOrMeasure ( string text, QFontAlignment alignment, bool measureOnly ) : SizeF
QFont ( ) : System
QFont ( QFontData fontData ) : System
RenderDropShadow ( float x, float y, char c, QFontGlyph nonShadowGlyph ) : void
RenderWord ( float x, float y, TextNode node ) : void
SkipTrailingSpace ( TextNode node, float lengthSoFar, float boundWidth ) : bool

Checks whether to skip trailing space on line because the next word does not fit. We only check one space - the assumption is that if there is more than one, it is a deliberate attempt to insert spaces.

TextNodeLineLength ( TextNode node, float maxLength ) : float

Computes the length of the next line, and whether the line is valid for justification.

TransformMeasureFromViewport ( SizeF input ) : SizeF
TransformPositionToViewport ( Vector2 input ) : Vector2
TransformWidthToViewport ( float input ) : float

Method Details

Begin() public static method

public static Begin ( ) : void
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( Font font, string newFontName ) : void
font System.Drawing.Font
newFontName string
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( Font font, string newFontName, QFontBuilderConfiguration config ) : void
font System.Drawing.Font
newFontName string
config QFontBuilderConfiguration
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( string fileName, float size, FontStyle style, QFontBuilderConfiguration config, string newFontName ) : void
fileName string
size float
style FontStyle
config QFontBuilderConfiguration
newFontName string
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( string fileName, float size, FontStyle style, string newFontName ) : void
fileName string
size float
style FontStyle
newFontName string
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( string fileName, float size, QFontBuilderConfiguration config, string newFontName ) : void
fileName string
size float
config QFontBuilderConfiguration
newFontName string
return void

CreateTextureFontFiles() public static method

public static CreateTextureFontFiles ( string fileName, float size, string newFontName ) : void
fileName string
size float
newFontName string
return void

DrawVBOs() public method

public DrawVBOs ( ) : void
return void

End() public static method

public static End ( ) : void
return void

FromQFontFile() public static method

public static FromQFontFile ( string filePath ) : QFont
filePath string
return QFont

FromQFontFile() public static method

public static FromQFontFile ( string filePath, QFontLoaderConfiguration loaderConfig ) : QFont
filePath string
loaderConfig QFontLoaderConfiguration
return QFont

FromQFontFile() public static method

public static FromQFontFile ( string filePath, float downSampleFactor ) : QFont
filePath string
downSampleFactor float
return QFont

FromQFontFile() public static method

public static FromQFontFile ( string filePath, float downSampleFactor, QFontLoaderConfiguration loaderConfig ) : QFont
filePath string
downSampleFactor float
loaderConfig QFontLoaderConfiguration
return QFont

LoadVBOs() public method

public LoadVBOs ( ) : void
return void

Measure() public method

Measures the actual width and height of the block of text
public Measure ( ProcessedText processedText ) : SizeF
processedText ProcessedText
return System.Drawing.SizeF

Measure() public method

public Measure ( string text, QFontAlignment alignment = QFontAlignment.Left ) : SizeF
text string
alignment QFontAlignment
return System.Drawing.SizeF

Measure() public method

Measures the actual width and height of the block of text.
public Measure ( string text, SizeF maxSize, QFontAlignment alignment ) : SizeF
text string
maxSize System.Drawing.SizeF
alignment QFontAlignment
return System.Drawing.SizeF

PopOptions() public method

public PopOptions ( ) : void
return void

Print() public method

Prints text as previously processed with a boundary and alignment.
public Print ( ProcessedText processedText ) : void
processedText ProcessedText
return void

Print() public method

public Print ( ProcessedText processedText, System.Vector2 position ) : void
processedText ProcessedText
position System.Vector2
return void

Print() public method

public Print ( string text, QFontAlignment alignment = QFontAlignment.Left ) : void
text string
alignment QFontAlignment
return void

Print() public method

Prints text inside the given bounds.
public Print ( string text, SizeF maxSize, QFontAlignment alignment ) : void
text string
maxSize System.Drawing.SizeF
alignment QFontAlignment
return void

Print() public method

public Print ( string text, SizeF maxSize, QFontAlignment alignment, System.Vector2 position ) : void
text string
maxSize System.Drawing.SizeF
alignment QFontAlignment
position System.Vector2
return void

Print() public method

public Print ( string text, System.Vector2 position, QFontAlignment alignment = QFontAlignment.Left ) : void
text string
position System.Vector2
alignment QFontAlignment
return void

PrintToVBO() public method

public PrintToVBO ( string text, QFontAlignment alignment, Vector3 position, Color color, SizeF maxSize ) : void
text string
alignment QFontAlignment
position Vector3
color Color
maxSize System.Drawing.SizeF
return void

PrintToVBO() public method

public PrintToVBO ( string text, Vector3 position, Color color, QFontAlignment alignment = QFontAlignment.Left ) : void
text string
position Vector3
color Color
alignment QFontAlignment
return void

ProcessText() public method

Creates node list object associated with the text.
public ProcessText ( string text, SizeF maxSize, QFontAlignment alignment ) : ProcessedText
text string
maxSize System.Drawing.SizeF
alignment QFontAlignment
return ProcessedText

PushOptions() public method

Creates a clone of the current font options and pushes it onto the stack
public PushOptions ( ) : void
return void

PushOptions() public method

Pushes the specified QFont options onto the options stack
public PushOptions ( QFontRenderOptions newOptions ) : void
newOptions QFontRenderOptions
return void

QFont() public method

public QFont ( Font font ) : System
font System.Drawing.Font
return System

QFont() public method

public QFont ( Font font, QFontBuilderConfiguration config ) : System
font System.Drawing.Font
config QFontBuilderConfiguration
return System

QFont() public method

public QFont ( string fileName, float size ) : System
fileName string
size float
return System

QFont() public method

public QFont ( string fileName, float size, FontStyle style ) : System
fileName string
size float
style FontStyle
return System

QFont() public method

public QFont ( string fileName, float size, FontStyle style, QFontBuilderConfiguration config ) : System
fileName string
size float
style FontStyle
config QFontBuilderConfiguration
return System

QFont() public method

public QFont ( string fileName, float size, QFontBuilderConfiguration config ) : System
fileName string
size float
config QFontBuilderConfiguration
return System

RefreshViewport() public static method

Invalidates the internally cached viewport, causing it to be reread the next time it is required. This should be called if the viewport and text is to be rendered to the new viewport.
public static RefreshViewport ( ) : void
return void

RenderGlyph() public method

public RenderGlyph ( float x, float y, char c, bool isDropShadow ) : void
x float
y float
c char
isDropShadow bool
return void

ResetVBOs() public method

public ResetVBOs ( ) : void
return void

Property Details

VertexBuffers public_oe property

public QVertexBuffer[] VertexBuffers
return QVertexBuffer[]