C# 클래스 QuickFont.QFontRenderOptions

파일 보기 프로젝트 열기: swax/QuickFont 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CharacterSpacing float
Colour Color
DropShadowActive bool
DropShadowOffset System.Vector2
DropShadowOpacity float
JustifyCapContract float
JustifyCapExpand float
JustifyContractionPenalty float
LineSpacing float
LockToPixel bool
LockToPixelRatio float
Monospacing QFontMonospacing
TransformToViewport TransformViewport?
UseDefaultBlendFunction bool
WordSpacing float
WordWrap bool

공개 메소드들

메소드 설명
CreateClone ( ) : QFontRenderOptions

메소드 상세

CreateClone() 공개 메소드

public CreateClone ( ) : QFontRenderOptions
리턴 QFontRenderOptions

프로퍼티 상세

CharacterSpacing 공개적으로 프로퍼티

Spacing between characters in units of average glyph width
public float CharacterSpacing
리턴 float

Colour 공개적으로 프로퍼티

The font colour
public Color Colour
리턴 Color

DropShadowActive 공개적으로 프로퍼티

Whether to draw a drop-shadow. Note: this requires the QFont to have been loaded with a drop shadow to take effect.
public bool DropShadowActive
리턴 bool

DropShadowOffset 공개적으로 프로퍼티

Offset of the shadow from the font glyphs in units of average glyph width
public Vector2,System DropShadowOffset
리턴 System.Vector2

DropShadowOpacity 공개적으로 프로퍼티

Opacity of drop shadows
public float DropShadowOpacity
리턴 float

JustifyCapContract 공개적으로 프로퍼티

Total justification cap as a fraction of the boundary width.
public float JustifyCapContract
리턴 float

JustifyCapExpand 공개적으로 프로퍼티

Total justification cap as a fraction of the boundary width.
public float JustifyCapExpand
리턴 float

JustifyContractionPenalty 공개적으로 프로퍼티

By what factor justification is penalized for being negative. (e.g. if this is set to 3, then a contraction will only happen over an expansion if it is 3 of fewer times smaller than the expansion).
public float JustifyContractionPenalty
리턴 float

LineSpacing 공개적으로 프로퍼티

Line spacing in units of max glyph width
public float LineSpacing
리턴 float

LockToPixel 공개적으로 프로퍼티

Locks the position to a particular pixel, allowing the text to be rendered pixel-perfectly. You need to turn this off if you wish to move text around the screen smoothly by fractions of a pixel.
public bool LockToPixel
리턴 bool

LockToPixelRatio 공개적으로 프로퍼티

Only applies when LockToPixel is true: This is used to transition smoothly between being locked to pixels and not
public float LockToPixelRatio
리턴 float

Monospacing 공개적으로 프로퍼티

Whether to render the font in monospaced mode. If set to "Natural", then monospacing will be used if the font loaded font was detected to be monospaced.
public QFontMonospacing Monospacing
리턴 QFontMonospacing

TransformToViewport 공개적으로 프로퍼티

This is intended as a means of rendering text pixel-perfectly at a fixed display size (size on screen) independent of the screen resolution. Ordinarily it is possible to render pixel-perfect text by calling QFont.Begin() / QFont.End(); however, this means working in a coordinate system corresponding to the current screen resolution. If the screen resolution changes, then the display size of the font will change accordingly which may not be desirable. Many games/applications prefer to use a fixed orthog coordinate system that is independent of screen resolution (e.g. 1000x1000) so that when the screen resolution changes, everything is still the same size on screen, it simply has higher definition - which is what this setting supports. One option is simply not to call QFont.Begin() / QFont.End(). This works; however, it becomes impossible to assure that glyphs are rendered pixel-perfectly. Instead they will be scaled in hardware. In most cases this looks fine; however, if you are a perfectionist, you may prefer to use this option to assure pixel perfection. Setting this option does two things: Rendering to a specified position is transformed Measurements are transformed So for example, suppose the screen resolution is 1024x768, but you wish to run orthog mode at 1000x1000. If you set: myFont.Options.TransformToViewport = new Viewport(0,0,1000,1000); Then, if you render at position 500,500: QFont.Begin(); myFont.Options.LockToPixel = true; myFont.Print("Hello",new Vector2(500,500)); QFont.End(); This will be printed pixel-pefectly at pixel position 512, 384. Additionally the font will be measured in terms of your 500x500 coordinate system. The only issue is that if you change the resolution, the size of your font will change. You can get around this by loading a font size that is proportional to the screen resolution. This makes sense: if you want a font to be rendered pixel-perfectly at a higher resolution, it will need to be a larger font. At present this needs to be doen manually. E.g: float fontScale = (float)Height / 800; compyFontSmall = new QFont("Data/comfy.ttf", 14 * fontScale);
public TransformViewport? TransformToViewport
리턴 TransformViewport?

UseDefaultBlendFunction 공개적으로 프로퍼티

Whether to always set : GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.DstAlpha); before rendering text.
public bool UseDefaultBlendFunction
리턴 bool

WordSpacing 공개적으로 프로퍼티

Spacing between words in units of average glyph width
public float WordSpacing
리턴 float

WordWrap 공개적으로 프로퍼티

Wrap word to next line if max width hit
public bool WordWrap
리턴 bool