Breaks a string into a list of lines each of which is a list of characters.
Also converts tabs to spaces and converts unsupported characters to question marks.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Rendering2D.Fonts TextParser
Namespace: DeltaEngine.Rendering2D.Fonts
Assembly: DeltaEngine.Rendering2D.Fonts (in DeltaEngine.Rendering2D.Fonts.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The TextParser type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TextParser | Initializes a new instance of the TextParser class |
Methods
Name | Description | |
---|---|---|
GetLines |
Remarks
Examples
[Test] public void ParseEmptyText() { var lines = parser.GetLines(GetSpaces(0)); Assert.AreEqual(0, lines.Count); }
[Test] public void ParseSingleTextLine() { var lines = parser.GetLines(GetSpaces(3)); Assert.AreEqual(1, lines.Count); Assert.AreEqual(GetSpaces(3), new string(lines[0].ToArray())); }
[Test] public void ParseMultipleTextLines() { var lines = parser.GetLines(GetSpaces(1) + Environment.NewLine + GetSpaces(2)); Assert.AreEqual(2, lines.Count); Assert.AreEqual(GetSpaces(1), new string(lines[0].ToArray())); Assert.AreEqual(GetSpaces(2), new string(lines[1].ToArray())); }
See Also