ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/block-graphics-to-ascii
Revision: 1.3
Committed: Tue Jan 10 04:51:14 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
CVS Tags: rel-7_3, rel-7_2, rel-7_1, rel-7_0, before_dynamic_fontidx, rel-7_6, rel-7_5, rel-7_8, rel-7_9, rel-7_7, rel-9_14, rel-7_4, rel-9_11, rel-9_10, rel-8_1, rel-9_12, rel-8_5a, rel-7_3a, rel-8_2, rel-8_9, rel-8_8, dynamic_fontidx, rel-8_0, rel-8_4, rel-9_0, rel-8_3, rxvt-unicode-rel-9_15, rel-8_6, rel-8_7, rel-9_09, rel-9_02, rel-9_01, rel-9_06, rel-9_07, rel-9_05
Changes since 1.2: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #! perl
2    
3 root 1.3 # simple example that uses the add_lines hook to filter unicode and vt100 line/box graphics
4    
5 root 1.2 # ─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏
6     my $rep_unicode = "--||--||--||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--||"
7     # ═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲ ╳╴╵╶╷╸╹╺╻╼╽╾╿▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟
8     . "=|+++++++++++++++++++++++++++++++/\\X-|-|-|-|-|-|#____#######|||||###~###########";
9    
10     # ↑↓→←█▚ ☃HIJKLMNOPQRSTUVWXYZ[\ ]^ ◆▒␉␌␍␊°±␤␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥π≠£·
11     my $rep_acs = "↑↓<>#\\☃HIJKLMNOPQRSTUVWXYZ[\\]^ ◆#␉␌␍␊°±␤␋+++++⎺⎻-⎼⎽++++!<>π≠£·";
12 root 1.1
13     sub on_add_lines {
14 root 1.2 my ($self, $str) = @_;
15    
16     $str =~ s/([\x{2500}-\x{259f}])/substr $rep_unicode, (ord $1) - 0x2500, 1/ge;
17    
18     $str =~ s/([\x41-\x7e])/substr $rep_acs, (ord $1) - 0x41, 1/ge
19     if $self->cur_charset eq "0";
20 root 1.1
21 root 1.2 $self->scr_add_lines ($str);
22 root 1.1
23     1
24     }
25