10 |
sub new ($$) { |
sub new ($$) { |
11 |
my $self = bless {style_sheets => []}, shift; |
my $self = bless {style_sheets => []}, shift; |
12 |
$self->{document} = shift; |
$self->{document} = shift; |
13 |
|
|
14 |
|
## Device dependent font size parameters |
15 |
|
my @scale = (3/5, 3/4, 8/9, 1, 6/5, 3/2, 2/1, 3/1); ## From css3-fonts |
16 |
|
$self->{font_size}->[$_] = 16 * $scale[$_] for 0..$#scale; |
17 |
|
## TODO: Provide better default |
18 |
|
$self->{get_smaller_font_size} = sub ($$) { |
19 |
|
#my ($self, $original_px) = @_; |
20 |
|
return $_[1] / 1.1; |
21 |
|
}; |
22 |
|
## TODO: Provide better default |
23 |
|
$self->{get_larger_font_size} = sub ($$) { |
24 |
|
#my ($self, $original_px) = @_; |
25 |
|
return $_[1] * 1.1; |
26 |
|
}; |
27 |
|
|
28 |
return $self; |
return $self; |
29 |
} # new |
} # new |
30 |
|
|