-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
type:improvementImprovementImprovement
Description
If I output chinese words,the grid will broken,I think the problem is in the character calculation of Chinese characters.
My code is like this:
static void Main(string[] args)
{
var headerThickness = new LineThickness(LineWidth.Double, LineWidth.Single);
Console.WriteLine("outpt Chinese");
var doc = new Document(
new Span("Order #") { Color = Yellow }, "Id", "\n",
new Span("Customer: ") { Color = Yellow }, "Name",
new Grid
{
Color = Gray,
Columns = { GridLength.Char(10), GridLength.Char(20), GridLength.Char(70) },
Children = {
new Cell("Id") { Stroke = headerThickness ,TextAlign =TextAlign.Center},
new Cell("Name") { Stroke = headerThickness ,TextAlign =TextAlign.Center},
new Cell("Assembly") { Stroke = headerThickness,TextAlign =TextAlign.Center },
new[] {
new Cell("AAAAA"),
new Cell("这里是中文,有错误!"),
new Cell("BBBBBBBBBBBBBBBBBBBBBBBB"),
}
}
}
);
ConsoleRenderer.RenderDocument(doc);
Console.WriteLine("outpt English");
doc = new Document(
new Span("Order #") { Color = Yellow }, "Id", "\n",
new Span("Customer: ") { Color = Yellow }, "Name",
new Grid
{
Color = Gray,
Columns = { GridLength.Char(10), GridLength.Char(20), GridLength.Char(70) },
Children = {
new Cell("Id") { Stroke = headerThickness ,TextAlign =TextAlign.Center},
new Cell("Name") { Stroke = headerThickness ,TextAlign =TextAlign.Center},
new Cell("Assembly") { Stroke = headerThickness,TextAlign =TextAlign.Center },
new[] {
new Cell("AAAAA"),
new Cell("This is English,And it is OK"),
new Cell("BBBBBBBBBBBBBBBBBBBBBBBB"),
}
}
}
);
ConsoleRenderer.RenderDocument(doc);
}Metadata
Metadata
Assignees
Labels
type:improvementImprovementImprovement
