Change IAnsiConsole to render IRenderable

This makes it possible for encoders to output better representation
of the actual objects instead of working with chopped up segments.

* IAnsiConsole.Write now takes an IRenderable instead of segments
* Calculating cell width does no longer require a render context
* Removed RenderContext.LegacyConsole
* Removed RenderContext.Encoding
* Added Capabilities.Unicode
This commit is contained in:
Patrik Svensson
2021-03-24 23:09:24 +01:00
committed by Phil Scott
parent 2ba6da3514
commit 20650f1e7e
75 changed files with 492 additions and 553 deletions

View File

@ -28,7 +28,7 @@ namespace Spectre.Console.Rendering
}
var height = lines.Count;
var width = lines.Max(l => Segment.CellCount(context, l));
var width = lines.Max(l => Segment.CellCount(l));
return new SegmentShape(width, height);
}
@ -44,7 +44,7 @@ namespace Spectre.Console.Rendering
{
foreach (var line in lines)
{
var length = Segment.CellCount(context, line);
var length = Segment.CellCount(line);
var missing = Width - length;
if (missing > 0)
{