Takes a string of text and returns an array of graphical glyph data for rendering.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Rendering2D.Fonts TextConverter
Namespace: DeltaEngine.Rendering2D.Fonts
Assembly: DeltaEngine.Rendering2D.Fonts (in DeltaEngine.Rendering2D.Fonts.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The TextConverter type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TextConverter | Initializes a new instance of the TextConverter class |
Methods
Name | Description | |
---|---|---|
GetRenderableGlyphs |
Properties
Name | Description | |
---|---|---|
MaxTextPixelSize |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void GetGlyphs() { var fontData = new FontDescription(ContentLoader.Load<Font>("Verdana12").Data); var textConverter = new TextConverter(fontData.GlyphDictionary, fontData.PixelLineHeight); var glyphs = textConverter.GetRenderableGlyphs(" ", HorizontalAlignment.Center); Assert.AreEqual(4, glyphs.Length); }
[Test, CloseAfterFirstFrame] public void GetGlyphsRightAligned() { var fontData = new FontDescription(ContentLoader.Load<Font>("Verdana12").Data); var textConverter = new TextConverter(fontData.GlyphDictionary, fontData.PixelLineHeight); var glyphs = textConverter.GetRenderableGlyphs("A a a aaa", HorizontalAlignment.Right); Assert.AreEqual(9, glyphs.Length); }
See Also