In weekly calendars, draw moon phases smaller and in days without moon

phases, don't leave a big gap at the top.
This commit is contained in:
Dianne Skoll
2025-11-02 21:28:44 -05:00
parent f6ab660c5e
commit 6661f32faf
2 changed files with 17 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ my $settings = {
title_url => '',
title_size => 14,
header_size => 12,
daynum_size => 14,
daynum_size => -1,
entry_size => 8,
border_size => 4,
@@ -526,7 +526,9 @@ Specify the size of the header font in 1/72ndths of an inch. The default is 14.
=item --daynum-size=I<n>
Specify the size of the day number font in 1/72ndths of an inch. The
default is 14.
default is 14 for monthly calendars or 10 for weekly calendars. (Weekly
calendars don't have day numbers in the calendar boxes, but this setting
is used to scale the size of moon phase indicators.)
=item --entry-size=I<n>

View File

@@ -468,6 +468,9 @@ sub render
{
my ($self, $cr, $settings, $index, $total) = @_;
if ($settings->{daynum_size} < 0) {
$settings->{daynum_size} = 14;
}
if ($settings->{svg} || $settings->{eps}) {
if ($index > 1) {
if ($index == 2) {
@@ -1111,6 +1114,9 @@ Remind::PDF::Weekly - render a weekly calendar
sub render
{
my ($self, $cr, $settings, $index, $total) = @_;
if ($settings->{daynum_size} < 0) {
$settings->{daynum_size} = 10;
}
if ($settings->{svg} || $settings->{eps}) {
if ($index > $settings->{weeks_per_page}) {
if ($index == $settings->{weeks_per_page}+1) {
@@ -1262,7 +1268,13 @@ sub draw_entries
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
my $so_far = $box->[1] + $h + $settings->{border_size};
my $so_far = $box->[1] + $settings->{border_size};
foreach my $entry (@{$self->{entries}->[$i]}) {
if ($entry->isa('Remind::PDF::Entry::moon')) {
$so_far = $box->[1] + $h + $settings->{border_size};
last;
}
}
my $box_height = $box->[3] - $box->[1];
my $done = 0;