/[Frey]/trunk/lib/Frey/Cairo.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Cairo.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 829 by dpavlin, Sat Dec 13 12:58:32 2008 UTC revision 833 by dpavlin, Sat Dec 13 16:52:50 2008 UTC
# Line 64  sub as_markup { Line 64  sub as_markup {
64                  die 'need Cairo with FreeType support and Font::FreeType';                  die 'need Cairo with FreeType support and Font::FreeType';
65          }          }
66    
67          # my $ttf_path = '/usr/share/fonts/truetype/ttf-inconsolata/Inconsolata.otf';          my @fonts = (
68          my $ttf_path = '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf';                  '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf',
69          unless (-r $ttf_path) {                  '/usr/share/fonts/truetype/ttf-inconsolata/Inconsolata.otf',
70                  die 'Can\'t find font ttf_path';                  '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
71            );
72    
73            my $ttf_path;
74            foreach my $font ( @fonts ) {
75                    $ttf_path ||= $font if -e $font;
76          }          }
77            die "Can't find font $ttf_path" unless -r $ttf_path;
78    
79          my $ft_face = Font::FreeType->new->face($ttf_path);          my $ft_face = Font::FreeType->new->face($ttf_path);
80          my $cr_face = Cairo::FtFontFace->create($ft_face);          my $cr_face = Cairo::FtFontFace->create($ft_face);

Legend:
Removed from v.829  
changed lines
  Added in v.833

  ViewVC Help
Powered by ViewVC 1.1.26