diff -Nru libstring-tagged-terminal-perl-0.05/Build.PL libstring-tagged-terminal-perl-0.06/Build.PL --- libstring-tagged-terminal-perl-0.05/Build.PL 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/Build.PL 2023-02-06 15:34:04.000000000 +0000 @@ -16,7 +16,7 @@ 'perl' => '5.014', }, test_requires => { - 'Test::More' => '0.88', # done_testing + 'Test2::V0' => 0, }, configure_requires => { 'Module::Build' => '0.4004', # test_requires diff -Nru libstring-tagged-terminal-perl-0.05/Changes libstring-tagged-terminal-perl-0.06/Changes --- libstring-tagged-terminal-perl-0.05/Changes 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/Changes 2023-02-06 15:34:04.000000000 +0000 @@ -1,5 +1,11 @@ Revision history for String-Tagged-Terminal +0.06 2023-02-06 + [CHANGES] + * Support the new `sizepos` Formatting tag, implemented using + mintty-style SGR 73/74/75 + * Swap all unit tests from `Test::More` to `Test2::V0` + 0.05 2021-06-18 [CHANGES] * Style updates: use v5.14, package NAME VERSION; diff -Nru libstring-tagged-terminal-perl-0.05/debian/changelog libstring-tagged-terminal-perl-0.06/debian/changelog --- libstring-tagged-terminal-perl-0.05/debian/changelog 2022-11-20 22:34:41.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/debian/changelog 2023-02-10 19:33:08.000000000 +0000 @@ -1,3 +1,12 @@ +libstring-tagged-terminal-perl (0.06-1) unstable; urgency=medium + + * Import upstream version 0.06. + * Update test dependencies. + * Update years of upstream and packaging copyright. + * Declare compliance with Debian Policy 4.6.2. + + -- gregor herrmann Fri, 10 Feb 2023 20:33:08 +0100 + libstring-tagged-terminal-perl (0.05-2) unstable; urgency=medium * No-change source-only re-upload. diff -Nru libstring-tagged-terminal-perl-0.05/debian/control libstring-tagged-terminal-perl-0.06/debian/control --- libstring-tagged-terminal-perl-0.05/debian/control 2022-11-20 22:34:41.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/debian/control 2023-02-10 19:33:08.000000000 +0000 @@ -10,8 +10,8 @@ Build-Depends-Indep: libconvert-color-perl , libconvert-color-xterm-perl , libstring-tagged-perl , - libtest-simple-perl -Standards-Version: 4.6.1 + libtest2-suite-perl +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libstring-tagged-terminal-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libstring-tagged-terminal-perl.git Homepage: https://metacpan.org/release/String-Tagged-Terminal diff -Nru libstring-tagged-terminal-perl-0.05/debian/copyright libstring-tagged-terminal-perl-0.06/debian/copyright --- libstring-tagged-terminal-perl-0.05/debian/copyright 2022-11-20 22:34:41.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/debian/copyright 2023-02-10 19:33:08.000000000 +0000 @@ -4,11 +4,11 @@ Upstream-Name: String-Tagged-Terminal Files: * -Copyright: 2017-2021, Paul Evans +Copyright: 2017-2023, Paul Evans License: Artistic or GPL-1+ Files: debian/* -Copyright: 2022, gregor herrmann +Copyright: 2022-2023, gregor herrmann License: Artistic or GPL-1+ License: Artistic diff -Nru libstring-tagged-terminal-perl-0.05/examples/ex.pl libstring-tagged-terminal-perl-0.06/examples/ex.pl --- libstring-tagged-terminal-perl-0.05/examples/ex.pl 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/examples/ex.pl 2023-02-06 15:34:04.000000000 +0000 @@ -34,6 +34,10 @@ $st = String::Tagged::Terminal->new( "Attrs: " ); $st->append_tagged( $_, $_ => 1 ) ->append( " " ) for qw( bold italic under strike blink reverse altfont ); +$st->append_tagged( "super", baseline => "super" ) + ->append( "script "); +$st->append_tagged( "sub", baseline => "sub" ) + ->append( "script "); $st->say_to_terminal; print "\n"; diff -Nru libstring-tagged-terminal-perl-0.05/examples/random.pl libstring-tagged-terminal-perl-0.06/examples/random.pl --- libstring-tagged-terminal-perl-0.05/examples/random.pl 1970-01-01 00:00:00.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/examples/random.pl 2023-02-06 15:34:04.000000000 +0000 @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use v5.14; +use warnings; + +use String::Tagged::Terminal; + +my $st = String::Tagged::Terminal->new( "Random stuff: " ); + +foreach ( 1 .. 100 ) { + my $str = chr( 0x41 + rand 26 ) x ( 5 + rand 5 ); + $st->append_tagged( $str, fgindex => 1 + rand 6 ); + $st->append( " " ); +} + +$st->say_to_terminal; diff -Nru libstring-tagged-terminal-perl-0.05/lib/String/Tagged/Terminal/Win32Console.pm libstring-tagged-terminal-perl-0.06/lib/String/Tagged/Terminal/Win32Console.pm --- libstring-tagged-terminal-perl-0.05/lib/String/Tagged/Terminal/Win32Console.pm 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/lib/String/Tagged/Terminal/Win32Console.pm 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ # # (C) Paul Evans, 2017-2018 -- leonerd@leonerd.org.uk -package String::Tagged::Terminal::Win32Console 0.05; +package String::Tagged::Terminal::Win32Console 0.06; use v5.14; use warnings; diff -Nru libstring-tagged-terminal-perl-0.05/lib/String/Tagged/Terminal.pm libstring-tagged-terminal-perl-0.06/lib/String/Tagged/Terminal.pm --- libstring-tagged-terminal-perl-0.05/lib/String/Tagged/Terminal.pm 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/lib/String/Tagged/Terminal.pm 2023-02-06 15:34:04.000000000 +0000 @@ -1,9 +1,9 @@ # You may distribute under the terms of either the GNU General Public License # or the Artistic License (the same terms as Perl itself) # -# (C) Paul Evans, 2017-2021 -- leonerd@leonerd.org.uk +# (C) Paul Evans, 2017-2023 -- leonerd@leonerd.org.uk -package String::Tagged::Terminal 0.05; +package String::Tagged::Terminal 0.06; use v5.14; use warnings; @@ -21,13 +21,13 @@ =head1 SYNOPSIS - use String::Tagged::Terminal; + use String::Tagged::Terminal; - my $st = String::Tagged::Terminal->new - ->append( "Hello my name is " ) - ->append_tagged( $name, bold => 1, fgindex => 4 ); + my $st = String::Tagged::Terminal->new + ->append( "Hello my name is " ) + ->append_tagged( $name, bold => 1, fgindex => 4 ); - $st->say_to_terminal; + $st->say_to_terminal; =head1 DESCRIPTION @@ -64,6 +64,16 @@ $st->append_tagged( "text", fgindex => 1 + rand 6 ); +=head2 sizepos + +(experimental) + +This tag takes a value indicating an adjustment to the vertical positioning, +and possibly also size, in order to create subscript or superscript effects. + +Recognised values are C for subscript, and C for superscript. +These are implemented using the F-style C codes. + =cut =head1 CONSTRUCTORS @@ -92,7 +102,7 @@ return $class->clone( $orig, only_tags => [qw( - bold under italic strike blink reverse + bold under italic strike blink reverse sizepos monospace fg bg )], @@ -219,6 +229,24 @@ } } + { + if( defined $pen{sizepos} and !defined $tags{sizepos} ) { + push @sgr, 75; # reset + } + elsif( defined $pen{sizepos} and defined $tags{sizepos} and $pen{sizepos} eq $tags{sizepos} ) { + # Leave it + } + elsif( defined( my $val = $tags{sizepos} ) ) { + if( $val eq "sub" ) { + push @sgr, 74; + } + elsif( $val eq "super" ) { + push @sgr, 73; + } + $pen{sizepos} = $val; + } + } + if( @sgr and %pen ) { $ret .= "\e[" . join( ";", @sgr ) . "m"; } @@ -252,7 +280,7 @@ return String::Tagged->clone( $self, only_tags => [qw( - bold under italic strike blink reverse + bold under italic strike blink reverse sizepos altfont fgindex bgindex )], diff -Nru libstring-tagged-terminal-perl-0.05/LICENSE libstring-tagged-terminal-perl-0.06/LICENSE --- libstring-tagged-terminal-perl-0.05/LICENSE 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/LICENSE 2023-02-06 15:34:04.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2021 by Paul Evans . +This software is copyright (c) 2023 by Paul Evans . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2021 by Paul Evans . +This software is Copyright (c) 2023 by Paul Evans . This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2021 by Paul Evans . +This software is Copyright (c) 2023 by Paul Evans . This is free software, licensed under: @@ -292,21 +292,21 @@ - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through - textual modification. + textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright - Holder. + Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. + the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) + computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they - received it. + received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you @@ -373,7 +373,7 @@ 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End diff -Nru libstring-tagged-terminal-perl-0.05/MANIFEST libstring-tagged-terminal-perl-0.06/MANIFEST --- libstring-tagged-terminal-perl-0.05/MANIFEST 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/MANIFEST 2023-02-06 15:34:04.000000000 +0000 @@ -1,6 +1,7 @@ Build.PL Changes examples/ex.pl +examples/random.pl lib/String/Tagged/Terminal.pm lib/String/Tagged/Terminal/Win32Console.pm MANIFEST This list of files diff -Nru libstring-tagged-terminal-perl-0.05/META.json libstring-tagged-terminal-perl-0.06/META.json --- libstring-tagged-terminal-perl-0.05/META.json 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/META.json 2023-02-06 15:34:04.000000000 +0000 @@ -30,18 +30,18 @@ }, "test" : { "requires" : { - "Test::More" : "0.88" + "Test2::V0" : "0" } } }, "provides" : { "String::Tagged::Terminal" : { "file" : "lib/String/Tagged/Terminal.pm", - "version" : "0.05" + "version" : "0.06" }, "String::Tagged::Terminal::Win32Console" : { "file" : "lib/String/Tagged/Terminal/Win32Console.pm", - "version" : "0.05" + "version" : "0.06" } }, "release_status" : "stable", @@ -50,6 +50,6 @@ "http://dev.perl.org/licenses/" ] }, - "version" : "0.05", - "x_serialization_backend" : "JSON::PP version 4.05" + "version" : "0.06", + "x_serialization_backend" : "JSON::PP version 4.07" } diff -Nru libstring-tagged-terminal-perl-0.05/META.yml libstring-tagged-terminal-perl-0.06/META.yml --- libstring-tagged-terminal-perl-0.05/META.yml 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/META.yml 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ author: - 'Paul Evans ' build_requires: - Test::More: '0.88' + Test2::V0: '0' configure_requires: Module::Build: '0.4004' dynamic_config: 1 @@ -16,10 +16,10 @@ provides: String::Tagged::Terminal: file: lib/String/Tagged/Terminal.pm - version: '0.05' + version: '0.06' String::Tagged::Terminal::Win32Console: file: lib/String/Tagged/Terminal/Win32Console.pm - version: '0.05' + version: '0.06' requires: Convert::Color: '0' Convert::Color::XTerm: '0' @@ -28,5 +28,5 @@ perl: '5.014' resources: license: http://dev.perl.org/licenses/ -version: '0.05' +version: '0.06' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libstring-tagged-terminal-perl-0.05/README libstring-tagged-terminal-perl-0.06/README --- libstring-tagged-terminal-perl-0.05/README 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/README 2023-02-06 15:34:04.000000000 +0000 @@ -4,13 +4,13 @@ SYNOPSIS - use String::Tagged::Terminal; + use String::Tagged::Terminal; - my $st = String::Tagged::Terminal->new - ->append( "Hello my name is " ) - ->append_tagged( $name, bold => 1, fgindex => 4 ); + my $st = String::Tagged::Terminal->new + ->append( "Hello my name is " ) + ->append_tagged( $name, bold => 1, fgindex => 4 ); - $st->say_to_terminal; + $st->say_to_terminal; DESCRIPTION @@ -48,6 +48,17 @@ $st->append_tagged( "text", fgindex => 1 + rand 6 ); + sizepos + + (experimental) + + This tag takes a value indicating an adjustment to the vertical + positioning, and possibly also size, in order to create subscript or + superscript effects. + + Recognised values are sub for subscript, and super for superscript. + These are implemented using the mintty-style CSI 73/74/75 m codes. + CONSTRUCTORS new_from_formatting diff -Nru libstring-tagged-terminal-perl-0.05/t/00use.t libstring-tagged-terminal-perl-0.06/t/00use.t --- libstring-tagged-terminal-perl-0.05/t/00use.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/00use.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,9 +3,10 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; -use_ok( "String::Tagged::Terminal" ); -use_ok( "String::Tagged::Terminal::Win32Console" ) if $^O eq "MSWin32"; +require String::Tagged::Terminal; +require String::Tagged::Terminal::Win32Console if $^O eq "MSWin32"; +pass "Modules loaded"; done_testing; diff -Nru libstring-tagged-terminal-perl-0.05/t/01build.t libstring-tagged-terminal-perl-0.06/t/01build.t --- libstring-tagged-terminal-perl-0.05/t/01build.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/01build.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,20 +3,10 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; use String::Tagged::Terminal; -# A handy function for making test output a little neater -use B qw( perlstring ); -sub is_unqq -{ - my ( $got, $want, $name ) = @_; - - my $builder = Test::Builder->new; - return $builder->is_eq( perlstring( $got ), perlstring( $want ), $name ); -} - # unformatted { my $st = String::Tagged::Terminal->new @@ -33,7 +23,7 @@ ->append_tagged( "bold", bold => 1 ) ->append( " string" ); - is_unqq( $st->build_terminal, "A \e[1mbold\e[m string", + is( $st->build_terminal, "A \e[1mbold\e[m string", '->build_terminal on bold' ); $st = String::Tagged::Terminal->new @@ -41,7 +31,7 @@ ->append_tagged( "underlined", under => 1 ) ->append( " string" ); - is_unqq( $st->build_terminal, "An \e[4munderlined\e[m string", + is( $st->build_terminal, "An \e[4munderlined\e[m string", '->build_terminal on under' ); } @@ -54,7 +44,7 @@ ->append_tagged( "fancy", altfont => 2 ) ->append( " formatting" ); - is_unqq( $st->build_terminal, "Some \e[11mfixedwidth\e[m and \e[12mfancy\e[m formatting", + is( $st->build_terminal, "Some \e[11mfixedwidth\e[m and \e[12mfancy\e[m formatting", '->build_terminal on altfont' ); } @@ -64,28 +54,28 @@ ->append( "With " ) ->append_tagged( "colour", fgindex => 1 ); - is_unqq( $st->build_terminal, "With \e[31mcolour\e[m", + is( $st->build_terminal, "With \e[31mcolour\e[m", '->build_terminal on VGA8 colour' ); $st = String::Tagged::Terminal->new ->append( "With " ) ->append_tagged( "hi-colour", fgindex => 10 ); - is_unqq( $st->build_terminal, "With \e[92mhi-colour\e[m", + is( $st->build_terminal, "With \e[92mhi-colour\e[m", '->build_terminal on Hi16 colour' ); $st = String::Tagged::Terminal->new ->append( "With " ) ->append_tagged( "palette colour", fgindex => 50 ); - is_unqq( $st->build_terminal, "With \e[38:5:50mpalette colour\e[m", + is( $st->build_terminal, "With \e[38:5:50mpalette colour\e[m", '->build_terminal on xterm256 colour' ); $st = String::Tagged::Terminal->new ->append( "With " ) ->append_tagged( "noninteger", fgindex => 3.14159 ); - is_unqq( $st->build_terminal, "With \e[33mnoninteger\e[m", + is( $st->build_terminal, "With \e[33mnoninteger\e[m", '->build_terminal rounds to integer' ); } @@ -95,7 +85,7 @@ ->append( "Has trailing " ) ->append_tagged( "formatting", italic => 1 ); - is_unqq( $st->build_terminal, "Has trailing \e[3mformatting\e[m", + is( $st->build_terminal, "Has trailing \e[3mformatting\e[m", 'Trailing formatting is reset' ); } @@ -106,7 +96,7 @@ ->append_tagged( "G", fgindex => 2 ) ->append_tagged( "B", fgindex => 4 ); - is_unqq( $st->build_terminal, "\e[31mR\e[32mG\e[34mB\e[m", + is( $st->build_terminal, "\e[31mR\e[32mG\e[34mB\e[m", 'Neighbouring colour tags behave' ); } @@ -116,7 +106,7 @@ $st->apply_tag( 0, 3, under => 1 ); $st->apply_tag( 2, 3, fgindex => 2 ); - is_unqq( $st->build_terminal( no_color => 1 ), "\e[4mabc\e[mde", + is( $st->build_terminal( no_color => 1 ), "\e[4mabc\e[mde", 'no_color option surpresses fgindex but not under' ); } diff -Nru libstring-tagged-terminal-perl-0.05/t/10formatting.t libstring-tagged-terminal-perl-0.06/t/10formatting.t --- libstring-tagged-terminal-perl-0.05/t/10formatting.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/10formatting.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; use String::Tagged::Terminal; use Convert::Color; diff -Nru libstring-tagged-terminal-perl-0.05/t/20print.t libstring-tagged-terminal-perl-0.06/t/20print.t --- libstring-tagged-terminal-perl-0.05/t/20print.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/20print.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; use String::Tagged::Terminal; diff -Nru libstring-tagged-terminal-perl-0.05/t/30print-win32.t libstring-tagged-terminal-perl-0.06/t/30print-win32.t --- libstring-tagged-terminal-perl-0.05/t/30print-win32.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/30print-win32.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; BEGIN { $^O = "MSWin32"; } my ( $Attr, @Log ); @@ -32,7 +32,7 @@ undef @Log; $st->print_to_terminal; - is_deeply( \@Log, + is( \@Log, [ [ Attr => 7 ], [ Write => "some " ], @@ -53,7 +53,7 @@ undef @Log; $st->print_to_terminal; - is_deeply( \@Log, + is( \@Log, [ [ Attr => 7 ], [ Write => "output " ], @@ -74,7 +74,7 @@ undef @Log; $st->print_to_terminal; - is_deeply( \@Log, [ + is( \@Log, [ [ Attr => 7 ], [ Write => "with " ], [ Attr => 15 ], diff -Nru libstring-tagged-terminal-perl-0.05/t/99pod.t libstring-tagged-terminal-perl-0.06/t/99pod.t --- libstring-tagged-terminal-perl-0.05/t/99pod.t 2021-06-18 10:44:40.000000000 +0000 +++ libstring-tagged-terminal-perl-0.06/t/99pod.t 2023-02-06 15:34:04.000000000 +0000 @@ -3,7 +3,7 @@ use v5.14; use warnings; -use Test::More; +use Test2::V0; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;