From 16499a59e8c124cedc7cc499a3ebfaeb714e1f44 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 23 Apr 2017 20:59:28 +0200 Subject: [PATCH] writing: common method to display (univer) legend --- Shiar_Sheet/FormatChar.pm | 17 +++++++++++++++++ apl.plp | 14 ++------------ writing.plp | 15 ++------------- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Shiar_Sheet/FormatChar.pm b/Shiar_Sheet/FormatChar.pm index 0a8a50a..6772dfc 100644 --- a/Shiar_Sheet/FormatChar.pm +++ b/Shiar_Sheet/FormatChar.pm @@ -274,5 +274,22 @@ sub print { } } +sub legend { + my @classes = ( + ["X l5" => 'unicode 1.1'], + ["X l4" => '20th century'], + ["X l3" => 'in 6.0 (2010)'], + ["X l2" => 'recent assignments'], + ["X l1" => 'proposed'], + ["ex" => 'irregular'], + ); + + return ( + '
', + (map { sprintf '
%s', @{$_} } @classes), + '
', + ); +} + 1; diff --git a/apl.plp b/apl.plp index ba51a11..9ca9970 100644 --- a/apl.plp +++ b/apl.plp @@ -80,16 +80,6 @@ for my $op (@ops) { :> -
- -
- -
unicode 1.1 - 20th century - in 6.0 (2010) - recent assignments - proposed - irregular -
-
+<: +say for '
', $glyphs->legend; diff --git a/writing.plp b/writing.plp index ee2d825..2f08da6 100644 --- a/writing.plp +++ b/writing.plp @@ -56,18 +56,7 @@ for ( } @table]); } -:> +say "\n"; -
- -
- -
unicode 1.1 - 20th century - in 6.0 (2010) - recent assignments - proposed - irregular -
-
+say for '
', $glyphs->legend; -- 2.30.0