Changeset 2673

Show
Ignore:
Timestamp:
04/24/08 06:41:41
Author:
miyagawa
Message:

change fonts etc.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • yapcasia2008/misc/nameplate-svg.pl

    r2666 r2673  
    22use strict; 
    33use warnings; 
     4use utf8; 
    45use Encode; 
    56use SVG; 
     
    910 
    1011Locale::Country::rename_country('tw' => 'Taiwan'); 
     12Locale::Country::rename_country('kr' => 'Korea'); 
    1113 
    1214my $base_file = "namecard_2x5.svg"; 
     
    2224 
    2325my $font = '"M+ 1c"'; 
     26#my $font = 'Helvetica'; 
    2427 
    2528my @users; 
     
    3942 
    4043    for my $ref (@chunk) { 
    41         $svg->text(x => $ox + 50, y => $oy + 60, style => { 'font-family' => $font, 'font-weight' => 'bold', 'color' => 'black', 'font-size' => 24 })->cdata(get_name($ref)); 
    42         $svg->text(x => $ox + 50, y => $oy + 80, style => { 'font-family' => $font, 'color' => 'black', 'font-size' => 12 })->cdata(($ref->{pm_group} ? "$ref->{pm_group} / " : "") . code2country($ref->{country})); 
     44        my $name = get_name($ref); 
     45        my $size = length($name) > 20 ? 18  
     46                 : length($name) > 16 ? 20  
     47                 : 24; 
     48        $svg->text(x => $ox + 40, y => $oy + 55, style => { 'font-family' => $font, 'font-weight' => 'bold', 'color' => 'black', 'font-size' => $size })->cdata($name); 
     49        $svg->text(x => $ox + 40, y => $oy + 75, style => { 'font-family' => $font, 'color' => 'black', 'font-size' => 11 })->cdata(($ref->{pm_group} ? "$ref->{pm_group} / " : "") . code2country($ref->{country})); 
     50        if ($ref->{company}) { 
     51            $svg->text(x => $ox + 40, y => $oy + 90, style => { 'font-family' => $font, color => 'black', 'font-size' => 11 })->cdata( decode_utf8($ref->{company}) ); 
     52        } 
    4353 
    4454        my $role = $ref->{has_talk} ? 'SPEAKER' : 
     
    4656 
    4757        if ($role) { 
    48             $svg->text(x => $ox + 50, y => $oy + 120, style => { 'font-family' => $font, 'font-weight' => 'bold', color => 'black', 'font-size' => 16 })->cdata($role); 
     58            $svg->text(x => $ox + 40, y => $oy + 126, style => { 'font-family' => $font, 'font-weight' => 'bold', color => 'black', 'font-size' => 16 })->cdata($role); 
    4959        } 
    5060 
    51         $svg->text(x => $ox + 50, y => $oy + 140, style => { 'font-family' => $font, color => 'black', 'font-size' => 10 })->cdata($ref->{user_id}); 
     61        $svg->text(x => $ox + 266, y => $oy + 16, style => { 'font-family' => $font, color => 'black', 'font-size' => 10 })->cdata($ref->{user_id}); 
    5262 
    5363        $ox = $ox == 0 ? 296 : 0; 
     
    5868    open my $out, ">:utf8", $outfile or die "$outfile: $!"; 
    5969    print $out $svg->xmlify; 
     70    warn $outfile, "\n"; 
    6071} 
    6172