Skip to content

Commit 94567b0

Browse files
Adds two new layout modes for FigletText
Now supports fitting (kerning) as well as smushing (both universal and from font rules). Closes #1448
1 parent b18ccb1 commit 94567b0

16 files changed

Lines changed: 2801 additions & 37 deletions

src/Sandbox/Program.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Spectre.Console;
2+
3+
RenderFigletWithPanel(FigletLayoutMode.FullSize);
4+
RenderFigletWithPanel(FigletLayoutMode.Fitted);
5+
RenderFigletWithPanel(FigletLayoutMode.Smushed);
6+
7+
return;
8+
9+
static void RenderFigletWithPanel(FigletLayoutMode mode)
10+
{
11+
AnsiConsole.Write(
12+
new Panel(
13+
new FigletText("Hello from Spectre.Console").LayoutMode(mode))
14+
.Header(mode switch
15+
{
16+
FigletLayoutMode.FullSize => "FullSize [i](default)[/]",
17+
FigletLayoutMode.Fitted => "Fitted",
18+
FigletLayoutMode.Smushed => "Smushed",
19+
_ => throw new InvalidOperationException(),
20+
})
21+
.BorderColor(Color.Yellow));
22+
}

src/Sandbox/Sandbox.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\Spectre.Console\Spectre.Console.csproj" />
12+
</ItemGroup>
13+
14+
</Project>

0 commit comments

Comments
 (0)