TextConverterTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering2D.Fonts.Tests TextConverterTests

Namespace: DeltaEngine.Rendering2D.Fonts.Tests
Assembly: DeltaEngine.Rendering2D.Fonts.Tests (in DeltaEngine.Rendering2D.Fonts.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class TextConverterTests : TestWithMocksOrVisually

The TextConverterTests type exposes the following members.

Constructors

  NameDescription
Public methodTextConverterTests
Initializes a new instance of the TextConverterTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodGetGlyphs
Public methodGetGlyphsRightAligned
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
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