Proper implementation of WEEK special.

This commit is contained in:
David F. Skoll
2008-11-14 17:02:51 -05:00
parent e87d33de50
commit 56ebedb9de
3 changed files with 16 additions and 6 deletions

View File

@@ -757,7 +757,7 @@ proc FillCalWindow {} {
set stuff [string trimleft $stuff]
set stuff [string trimright $stuff]
set label [expr $firstWkday + $day - 1]
.cal.l$label configure -text "$day (W$stuff)"
.cal.l$label configure -text "$day $stuff"
continue
}
"SHADE" {

View File

@@ -891,6 +891,7 @@ int DoQueuedPs(void)
int fnoff;
char buffer[512];
char const *size, *extra;
char const *s;
int num, r, g, b, phase, fontsize, moonsize;
unsigned char c;
@@ -959,12 +960,21 @@ int DoQueuedPs(void)
break;
case SPECIAL_WEEK: /* Week number */
num = sscanf(e->entry+fnoff, "%d", &phase);
if (num == 1) {
printf("gsave Border Border moveto /EntryFont findfont EntrySize 1.2 div scalefont setfont ( (W %d)) show grestore\n",
phase);
printf("gsave Border Border moveto /EntryFont findfont EntrySize 1.2 div scalefont setfont (");
s = e->entry+fnoff;
while(*s && isspace(*s)) {
s++;
}
while(*s) {
if (*s == '\\' || *s == '(' || *s == ')') {
PutChar('\\');
}
PutChar(*s);
s++;
}
printf(") show grestore\n");
break;
case SPECIAL_MOON: /* Moon phase */
num = sscanf(e->entry+fnoff, "%d %d %d", &phase, &moonsize,
&fontsize);

View File

@@ -483,7 +483,7 @@ sub draw_day_cell
my $shade = $shades->[$day];
my $week = '';
if (exists($weeks->{$day})) {
$week = ' (W' . $weeks->{$day} . ')';
$week = ' ' . $weeks->{$day};
}
my $class;
if ($Options{'nostyle'}) {