mirror of
https://github.com/sayyadirfanali/Myna.git
synced 2026-01-17 00:56:40 +01:00
46 lines
1.2 KiB
Perl
Executable File
46 lines
1.2 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
my $symbols = [
|
|
{ "pos" => 200, "sym" => "->" },
|
|
{ "pos" => 400, "sym" => "=>" },
|
|
{ "pos" => 600, "sym" => "~>" },
|
|
{ "pos" => 800, "sym" => "<>" },
|
|
{ "pos" => 1000, "sym" => "=~" },
|
|
{ "pos" => 1200, "sym" => "<\$>" },
|
|
{ "pos" => 1400, "sym" => "<*>" },
|
|
{ "pos" => 1600, "sym" => ">>=" },
|
|
];
|
|
|
|
my $fonts = [
|
|
{ "pos" => 100, "name" => "Cascadia-Mono-Regular" },
|
|
{ "pos" => 200, "name" => "Source-Code-Pro-Regular" },
|
|
{ "pos" => 300, "name" => "Dejavu-Sans-Mono" },
|
|
{ "pos" => 400, "name" => "Jetbrains-Mono" },
|
|
{ "pos" => 500, "name" => "Iosevka" },
|
|
{ "pos" => 600, "name" => "Ubuntu-Mono" },
|
|
{ "pos" => 700, "name" => "Fira-Mono-Regular" },
|
|
{ "pos" => 800, "name" => "Liberation-Mono" },
|
|
{ "pos" => 900, "name" => "Roboto-Mono" }
|
|
];
|
|
|
|
sub f {
|
|
my ($x, $s) = @_;
|
|
return join(" ",
|
|
"-pointsize 48",
|
|
"-fill black",
|
|
(map { "-font \"$_->{name}\" -annotate +$x+$_->{pos} \"$s\"" } $fonts->@*),
|
|
"-fill crimson -font \"Myna\" -annotate +$x+1020 \"$s\"",
|
|
);
|
|
}
|
|
|
|
system (join(" ",
|
|
"magick",
|
|
"-size 2000x1200 xc:#fefefe",
|
|
"-gravity northwest",
|
|
join (' ', map { f($_->{pos}, $_->{sym}) } $symbols->@*),
|
|
$ARGV[0]
|
|
));
|