From 505057bf787c2582cc1e4d3e17f2ea6c93ab53bd Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 12 Apr 2017 16:36:35 +0200 Subject: [PATCH] latin: minor code rewrite of long lines --- writing-latn.inc.pl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/writing-latn.inc.pl b/writing-latn.inc.pl index ec1b5a0..0ca90ae 100644 --- a/writing-latn.inc.pl +++ b/writing-latn.inc.pl @@ -7,9 +7,12 @@ my $U = 0; # optional unicode alternatives sub disptap { my $code = shift; - $code =~ m/\A(-?)(\d)(\d)/ or return $code; - return $1 . chr(0x1F031 + ($2 * 7) + $3) if $U; # offset from domino tile horizontal-00-00 - return $1 . join(' ', '·' x $2, '·' x $3); + my ($prefix, @dots) = $code =~ m/\A(-?)(\d)(\d)/ or return $code; + if ($U) { + # unicode glyph alternative as DOMINO TILE HORIZONTAL-0a-0b + return $prefix . chr(0x1F031 + ($dots[0] * 7) + $dots[1]); + } + return $prefix . join(' ', map { '·' x $_ } @dots); } sub dispbar { @@ -39,7 +42,10 @@ sub dispbar { 'Lowercase' => [qw{ a b c d e f g h i j k l m n o p q r s t u v w x y z }], 'Sütterlin' => [qw{ a b c d e f g h i j k l m n o p q r ſ s t u v w x y z }], 'Old Roman Cursive' => [ - map { m/^(-?)(\w.*)/ ? $1.'' : $_ } + map { + !m/^(-?)(\w.+)/ ? $_ : + $1.'' + } "m2,4 c1,2 8,9 8,9 M2,15 6,9", "m2,4 c0,0 3,-2 4,1 1,2 0,9 3,9 1,-0 2,-1 2,-1 m-6,-2 c-5,4 -0,6 1,3", "m4,7 4,-2 m-4,4 c0,0 -2,7 3,6", @@ -415,8 +421,10 @@ sub dispbar { 'Chromacons' => [ # Colour Alphabet by Paul Green-Armytage (2010) map { - sprintf !$_ ? '%2$s' : '%s', - split(/:/), chr(8195); + sprintf('%s', + !!$_ && sprintf(' style="background:#%s" title="%s"', split /:/), + chr(8195), # em space + ); } qw{ F0A3FF:Amethyst 0075DC:Blue 993F00:Caramel 4C005C:Damson 191919:Ebony -- 2.30.0