3 # Perl extension to resize the terminal.
7 # Get existing fontset, something like:
8 # xft:DejaVu Sans Mono:pixelsize=12:aspect=0.9,xft:AR PL Uming HK
9 my $fontset = $self->{term}->resource("font");
10 my @fonts = split /,/, $fontset;
13 # Split into individual font definitions.
14 foreach my $font (@fonts) {
15 if ($font =~ /:pixelsize=(\d+)/) {
19 # Rewrite the font definition to be resized.
20 if ($cmd =~ /:bigger/) { $adjusted++ }
21 elsif ($cmd =~ /:smaller/) { $adjusted-- }
23 $adjusted = 1 if $adjusted < 1;
24 $font =~ s/:pixelsize=$size/:pixelsize=$adjusted/;
30 # Set the new fontset. Just putting the resource doesn't work so
31 # use an escape sequence.
32 $fontset = join(",", @new);
33 $self->{term}->cmd_parse("\033]50;$fontset\007");