[Bioperl-l] Bio::Graphics::Panel and utf-8 chars in labels

Lincoln Stein lincoln.stein at gmail.com
Mon Jun 7 16:14:41 UTC 2010


Unfortunately, Bio::Graphics doesn't take advantage of TrueType capabilities
in GD. There were too many problems associated with installation.

This could be added in some sort of generic fashion (invoke the truetype
calls if GD supports it, and fallback to bitmap characters if not), but will
require a lot of detailed changes to the source code. If anybody would like
to volunteer to do this, I can explain the process.

Lincoln

On Mon, Jun 7, 2010 at 11:04 AM, Adam Sjøgren <adsj at novozymes.com> wrote:

> Does an easy way exist to use unicode/utf-8 characters in labels on
> tracks with Bio::Graphics::Panel?
>
> A script like this:
>
> = = =
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use utf8;
>
> use Bio::Graphics::Panel;
> use Bio::SeqFeature::Generic;
> use File::Slurp;
>
> my $label='α-glucosidase';
>
> my $panel=Bio::Graphics::Panel->new(-width=>400, -length=>200);
> my $feature=Bio::SeqFeature::Generic->new(-start=>1, -end=>100,
> -primary_tag=>'source');
> $panel->add_track($feature, -label=>$label);
>
> write_file('panel.png', $panel->png);
> = = =
>
> Gives me a panel.png that very much looks like the label was interpreted
> as something like, say, latin1, which makes sense from a quick search in
> the GD pod - it refers to stringFT() for using unicode characters, and a
> quick ack for stringFT() in Bio/Graphics/ only shows hits in
> DrawTransmembrane.
>
> This makes me guess the answer is no, but I thought I'd ask anyway, in
> case I overlooked something.
>
>
>  Best regards,
>
>     Adam
>
> --
>                                                          Adam Sjøgren
>                                                    adsj at novozymes.com
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




-- 
Lincoln D. Stein
Director, Informatics and Biocomputing Platform
Ontario Institute for Cancer Research
101 College St., Suite 800
Toronto, ON, Canada M5G0A3
416 673-8514
Assistant: Renata Musa <Renata.Musa at oicr.on.ca>




More information about the Bioperl-l mailing list