Datum, optische Verfeinerungen

This commit is contained in:
Astro 2007-11-05 02:53:51 +00:00
parent 18c667b5d3
commit 48ea57dfb5
1 changed files with 14 additions and 4 deletions

View File

@ -44,6 +44,12 @@ class Symbol
end
end
class Fixnum
def rjust(*a)
to_s.rjust(*a)
end
end
class Builder
def self.print
puts '<?xml version="1.0" encoding="utf-8"?>'
@ -81,8 +87,8 @@ class BadgeMaker
@fo.block('text-align' => 'right',
'margin-right' => '1cm') {
@fo.external_graphic('src' => 'url("chaosknoten.jpg")',
'content-width' => '4cm',
'content-height' => '3cm')
'content-width' => '3cm',
'content-height' => '2.75cm')
}
}
@fo.flow('font-size' => '2.5cm',
@ -106,7 +112,8 @@ Builder.print { |fo|
fo.region_body('margin' => '1cm 1cm 1cm 1cm',
'display-align' => 'center')
fo.region_after('extent' => '4cm',
'margin-bottom' => '1cm')
'display-align' => 'after',
'margin-bottom' => '1.5cm')
}
}
@ -114,7 +121,10 @@ Builder.print { |fo|
name = namen1.any_one + ' ' + namen2.any_one
datum = ((rand * 29).to_i + 1).to_s + '.' +
((rand * 12).to_i + 1).to_s + '.' +
((rand * 5).to_i + 2008).to_s
((rand * 5).to_i + 2008).to_s + ' um ' +
(rand * 24).to_i.rjust(2, '0') + ':' +
(rand * 60).to_i.rjust(2, '0') + ':' +
(rand * 60).to_i.rjust(2, '0')
text = case (rand * 5).to_i
when 0
"Hat am #{datum} #{name} angerufen"