2024-05-12 22:35:52 +02:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using MSDF_Test;
|
|
|
|
|
|
|
|
|
|
MSDF msdf = new ("T_RobotoBlack_FONT.png", 66, 3);
|
|
|
|
|
|
|
|
|
|
Console.Write("String: ");
|
|
|
|
|
string? str;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
str = Console.ReadLine();
|
|
|
|
|
}while(str is null);
|
|
|
|
|
Console.Write("Size: ");
|
|
|
|
|
string? sizeStr;
|
|
|
|
|
int size;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
sizeStr = Console.ReadLine();
|
|
|
|
|
}while(sizeStr is null || !int.TryParse(sizeStr, out size));
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Rendering...");
|
|
|
|
|
Bitmap render = msdf.Render(str, size);
|
2024-05-12 22:51:23 +02:00
|
|
|
|
#pragma warning disable CA1416
|
2024-05-12 22:35:52 +02:00
|
|
|
|
render.Save("render.png", ImageFormat.Png);
|
2024-05-12 22:51:23 +02:00
|
|
|
|
#pragma warning restore CA1416
|
2024-05-12 22:35:52 +02:00
|
|
|
|
Console.WriteLine("Done.");
|