diff --git a/lib/Bio/Graphics/GDWrapper.pm b/lib/Bio/Graphics/GDWrapper.pm deleted file mode 100644 index 6726fa4..0000000 --- a/lib/Bio/Graphics/GDWrapper.pm +++ /dev/null @@ -1,37 +0,0 @@ -package Bio::Graphics::GDWrapper; - -use base 'GD::Image'; -use Memoize 'memoize'; - -#memoize('_match_font'); - -sub new { - my $self = shift; - my $gd = shift; - return bless $gd,ref $self || $self; -} - -# print with a truetype string -sub string { - my $self = shift; - my ($font,$x,$y,$string,$color) = @_; - return $self->SUPER::string(@_) if $self->isa('GD::SVG'); - my $fontface = $self->_match_font($font); - my ($fontsize) = $fontface =~ /-(\d+)/; - $self->stringFT($color,$fontface,$fontsize,0,$x,$y+$fontsize+1,$string); -} - -# find a truetype match for a built-in font -sub _match_font { - my $self = shift; - my $font = shift; - return $font unless ref $font && $font->isa('GD::Font'); - $self->useFontConfig(1); - my $height = $font->height-4; - my $style = $font eq GD->gdMediumBoldFont ? 'bold' - :$font eq GD->gdGiantFont ? 'bold' - :'normal'; - return "Helvetica-$height:$style"; -} - -1; diff --git a/lib/Bio/Graphics/Panel.pm b/lib/Bio/Graphics/Panel.pm index 6318188..895cc9c 100755 --- a/lib/Bio/Graphics/Panel.pm +++ b/lib/Bio/Graphics/Panel.pm @@ -3,7 +3,6 @@ package Bio::Graphics::Panel; use strict; use Bio::Graphics::Glyph::Factory; use Bio::Graphics::Feature; -use Bio::Graphics::GDWrapper; # KEYLABELFONT must be treated as string until image_class is established use constant KEYLABELFONT => 'gdMediumBoldFont'; @@ -54,7 +53,6 @@ sub new { my $empty_track_style = $options{-empty_tracks} || 'key'; my $autopad = defined $options{-auto_pad} ? $options{-auto_pad} : 1; my $truecolor = $options{-truecolor} || 0; - my $truetype = $options{-truetype} || 0; my $image_class = ($options{-image_class} && $options{-image_class} =~ /SVG/) ? 'GD::SVG' : $options{-image_class} || 'GD'; # Allow users to specify GD::SVG using SVG @@ -106,7 +104,6 @@ sub new { autopad => $autopad, all_callbacks => $allcallbacks, truecolor => $truecolor, - truetype => $truetype, flip => $flip, linkrule => $linkrule, titlerule => $titlerule, @@ -163,12 +160,6 @@ sub flip { $self->{flip} = shift if @_; $g; } -sub truetype { - my $self = shift; - my $g = $self->{truetype}; - $self->{truetype} = shift if @_; - $g; -} # values of empty_track_style are: # "suppress" -- suppress empty tracks entirely (default) @@ -534,9 +525,7 @@ sub gd { } $self->{translations} = \%translation_table; - $self->{gd} = $gd->isa('GD::SVG') ? $gd - : $self->truetype ? Bio::Graphics::GDWrapper->new($gd) - : $gd; + $self->{gd} = $gd; eval {$gd->alphaBlending(0)}; if ($self->bgcolor) {