Namespace: DeltaEngine.Rendering2D.Fonts.Tests
Assembly: DeltaEngine.Rendering2D.Fonts.Tests (in DeltaEngine.Rendering2D.Fonts.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Rendering2D.Fonts.Tests (in DeltaEngine.Rendering2D.Fonts.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test, CloseAfterFirstFrame] public void GetGlyphDrawAreaAndUVs() { var fontData = new FontDescription(ContentLoader.Load<Font>("Verdana12").Data); fontData.Generate("", HorizontalAlignment.Center); Assert.AreEqual(0, fontData.Glyphs.Length); fontData.Generate("\n", HorizontalAlignment.Center); Assert.AreEqual(0, fontData.Glyphs.Length); fontData.Generate(" ", HorizontalAlignment.Center); Assert.AreEqual(1, fontData.Glyphs.Length); GlyphDrawData glyphA = fontData.Glyphs[0]; Assert.AreEqual(glyphA.UV, Rectangle.BuildUVRectangle(new Rectangle(0, 0, 1, 16), new Size(128, 128))); Assert.AreEqual(new Rectangle(0, 0, 1, 16), glyphA.DrawArea); }
See Also