Changeset 5499


Ignore:
Timestamp:
2003-09-12T11:55:17+12:00 (21 years ago)
Author:
mdewsnip
Message:

Updated stuff for Thai image generation, using the Microsoft BrowalliaUPC font.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/translate.pl

    r5484 r5499  
    203203    $fontchoice = " -foundry cronyx -fontname helvetica";
    204204    }
     205    # special case for Thai images
     206    elsif ($language_symbol eq "th") {
     207    $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "windows_874");
     208    $fontchoice = " -foundry monotype -fontname BrowalliaUPC -fontregistry tis620";
     209    }
    205210    # special case for Ukrainian images - font is windows_1251 encoded
    206211    elsif ($language_symbol eq "uk") {
     
    208213    $fontchoice = " -foundry rfx -fontname serene";
    209214    }
    210     # special case for Thai images
    211     # elsif ($language_symbol eq "th") {
    212     # $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "thai");
    213     # }
    214215
    215216    # edit image macros
     
    231232        $options .= " -fontsize 10 -fontweight bold";
    232233    }
     234    # special case for Thai images
     235    elsif ($language_symbol eq "th") {
     236        $options .= " -fontsize 20 -fontweight bold";  # Browallia
     237    }
    233238    # special case for Ukrainian images
    234239    elsif ($language_symbol eq "uk") {
    235240        $options .= " -fontsize 10";
    236241    }
    237     # elsif ($language_symbol eq "th") {
    238         # $options .= " -fontsize 30 -fontweight bold";
    239         # $options .= " -foundry 2rebels -fontname \"DB ThaiText\"";
    240         # $options .= " -fontsize 24";
    241         # $options .= " -foundry monotype -fontname \"Courier ProportionalThai\"";
    242     # }
    243242    else {
    244243        $options .= " -fontsize 12";
     
    250249    # &process_width_macro ($fullfilename, $image_name, \$image_macros);
    251250
    252     } elsif ($image_type eq "nav_bar_button") {
    253    
     251    }
     252    elsif ($image_type eq "nav_bar_button") {
     253
    254254    # generate on and off images
    255255    my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir";
     
    259259    # special case for Thai images
    260260    if ($language_symbol eq "th") {
    261         # $options .= " -fontsize 30";
    262         # $options .= " -foundry 2rebels -fontname \"DB ThaiText\" -fontweight bold";
    263         # $options .= " -fontsize 24";
    264         # $options .= " -foundry monotype -fontname \"Courier ProportionalThai\"";
     261        $options .= " -fontsize 18 -fontweight bold";  # Browallia
    265262    }
    266263    else {
     
    271268
    272269    # generate green image
    273     $options = "-text \"$text\" -filename ${image_name}gr.gif -image_dir $image_dir";
    274     $options .= $fontchoice;
    275 
    276     `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`;
     270    $options = "-text \"$text\" -filenamestem ${image_name}gr -image_dir $image_dir";
     271    $options .= " -height 17 -fixed_width -width 87";
     272    $options .= " -bgcolor \"#96c19b\"";
     273    $options .= $fontchoice;
     274
     275    # special case for Thai images
     276    if ($language_symbol eq "th") {
     277        $options .= " -fontsize 18 -fontweight bold";  # Browallia
     278    }
     279    else {
     280        $options .= " -fontsize 17";
     281    }
     282
     283    `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
     284
     285    # delete the unused light image
     286    unlink(util::filename_cat($image_dir, "${image_name}gr" . "of.gif"));
     287
     288    # rename the dark image
     289    &util::mv(util::filename_cat($image_dir, "${image_name}gr" . "on.gif"),
     290        util::filename_cat($image_dir, "$image_name" . "gr.gif"));
    277291
    278292    # get width of new images and edit width macro
     
    280294    &process_width_macro ($fullfilename, $image_name, \$image_macros);
    281295
    282     } elsif ($image_type eq "document_button") {
     296    }
     297    elsif ($image_type eq "document_button") {
    283298
    284299    # generate on and off images
     
    295310        $options .= " -fontsize 8";
    296311    }
     312    # special case for Thai images
     313    elsif ($language_symbol eq "th") {
     314        $options .= " -fontsize 22 -fontweight bold";  # Browallia
     315    }
    297316    # special case for Ukrainian images
    298317    elsif ($language_symbol eq "uk") {
     
    305324    # &process_width_macro ($fullfilename, $image_name, \$image_macros);
    306325
    307     } elsif ($image_type eq "collector_bar_button") {
     326    }
     327    elsif ($image_type eq "collector_bar_button") {
    308328
    309329    $text =~ s/\\n/\n/g;
     
    352372    unlink(util::filename_cat($image_dir, "nc$image_name" . "on.gif"));
    353373
    354     } elsif ($image_type eq "green_bar_left_aligned") {
     374    }
     375    elsif ($image_type eq "green_bar_left_aligned") {
    355376
    356377    # generate green bar image (we're assuming these bars are always 537
     
    360381    $options .= $fontchoice;
    361382
     383    # special case for Thai images
     384    if ($language_symbol eq "th") {
     385        $options .= " -fontsize 18 -fontweight bold";  # Browallia
     386    }
     387
    362388    `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`;
    363389
    364     } elsif ($image_type eq "green_title") {
     390    }
     391    elsif ($image_type eq "green_title") {
    365392   
    366393    # read the width if it is specified in $image_macros
     
    371398    my $options = "-text \"$text\" -filename ${image_name}.gif -image_dir $image_dir";
    372399    $options .= " -width $width -height 57 -stripe_alignment right -text_alignment right";
    373     $options .= " -fontsize 26 -fontweight bold";
    374400        $options .= $fontchoice;
     401
     402        # special case for Thai images
     403        if ($language_symbol eq "th") {
     404        $options .= " -fontsize 50 -fontweight bold";  # Browallia
     405    }
     406        else {
     407        $options .= " -fontsize 26 -fontweight bold";
     408    }
    375409
    376410    `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon-1.2.pl $options`;
     
    381415    # &process_width_macro ($fullfilename, $image_name, \$image_macros);
    382416
    383     } elsif ($image_type eq "hand_made") {
    384    
     417    }
     418    elsif ($image_type eq "hand_made") {
     419
    385420    $hand_made ++;
    386421
    387     } else {
     422    }
     423    else {
    388424   
    389425    print STDERR "WARNING (translate.pl): unknown image type found ($image_type)\n";
Note: See TracChangeset for help on using the changeset viewer.