diff --git a/rem2pdf/bin/rem2pdf.in b/rem2pdf/bin/rem2pdf.in index 62e61624..037a8197 100644 --- a/rem2pdf/bin/rem2pdf.in +++ b/rem2pdf/bin/rem2pdf.in @@ -28,6 +28,8 @@ my $media_to_size = { "10x14" => [ 720, 1008], }; +my $help = 0; + my $settings = { landscape => 0, numbers_on_left => 0, @@ -93,6 +95,7 @@ Options: --margin-bottom=S Specify bottom margin size in 1/72nds of an inch --margin-left=S Specify left margin size in 1/72nds of an inch --margin-right=S Specify right margin size in 1/72nds of an inch +--help Display this help EOF } @@ -118,12 +121,18 @@ my $ret = GetOptions('landscape|l' => \$settings->{landscape}, 'margin-bottom=f' => \$settings->{margin_bottom}, 'margin-left=f' => \$settings->{margin_left}, 'margin-right=f' => \$settings->{margin_right}, + 'help' => \$help ); if (!$ret) { usage(); exit(1); } +if ($help) { + usage(); + exit(0); +} + if ($settings->{width} <= 0 || $settings->{height} <= 0) { my $size = $media_to_size->{ucfirst($settings->{media})}; diff --git a/rem2pdf/lib/Remind/PDF.pm b/rem2pdf/lib/Remind/PDF.pm index 7c20cc31..49651307 100644 --- a/rem2pdf/lib/Remind/PDF.pm +++ b/rem2pdf/lib/Remind/PDF.pm @@ -553,11 +553,11 @@ sub draw_small_calendar $j = $col; } my $day = $self->{daynames}->[$j]; - my $l = substr($day, 0, 1); + my $l = substr(Encode::decode('UTF-8', $day), 0, 1); $layout = Pango::Cairo::create_layout($cr); $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px'); $layout->set_font_description($desc); - $layout->set_text(Encode::decode('UTF-8', $l)); + $layout->set_text($l); $cr->save(); $cr->move_to($x + $col*$wid, $y); Pango::Cairo::show_layout($cr, $layout);