Changeset 4231
- Timestamp:
- 2003-05-06T15:57:22+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/translate.pl
r4227 r4231 191 191 # special case for russian images - fonts expect text to be koi8-r encoded 192 192 if ($language_symbol eq "ru") { 193 $text = &unicode::unicode2koi8r(&unicode::utf82unicode($text)); 193 $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "koi8_r"); 194 } 195 # special case for Kazakh images (can also handle Russian) - encode to match Kazakh font 196 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 197 $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "kazakh"); 194 198 } 195 199 … … 204 208 if ($language_symbol eq "ru") { 205 209 $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir"; 206 $options .= " -foundry cronyx -fontname helvetica"; 207 } else { 210 $options .= " -foundry cronyx -fontname helvetica -fontweight bold"; 211 } 212 # special case for Kazakh images (can also handle Russian) 213 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 214 $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir"; 215 $options .= " -foundry 2rebels -fontname \"helv kaz\" -fontweight bold"; 216 } 217 else { 208 218 $options .= " -fontsize 12 -height 20 -whitespace -image_dir $image_dir"; 209 219 } … … 224 234 $options .= " -foundry cronyx -fontname helvetica"; 225 235 } 236 # special case for Kazakh images (can also handle Russian) 237 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 238 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 239 } 226 240 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 227 241 … … 231 245 # special case for russian images 232 246 if ($language_symbol eq "ru") { 233 $options .= " -foundry cronyx -fontname helvetica"; 247 $options .= " -foundry cronyx -fontname helvetica"; 248 } 249 # special case for Kazakh images (can also handle Russian) 250 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 251 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 234 252 } 235 253 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`; … … 239 257 &process_width_macro ($fullfilename, $image_name, \$image_macros); 240 258 259 } elsif ($image_type eq "document_button") { 260 261 # generate on and off images 262 my $options = "-text \"$text\" -filenamestem $image_name"; 263 $options .= " -fixed_width -whitespace -image_dir $image_dir"; 264 # special case for russian images 265 if ($language_symbol eq "ru") { 266 $options .= " -fontsize 8 -foundry cronyx -fontname helvetica"; 267 } 268 # special case for Kazakh images (can also handle Russian) 269 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 270 $options .= " -fontsize 8 -foundry 2rebels -fontname \"helv kaz\""; 271 } 272 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 273 274 # get width of new images and edit width macro 275 # my $fullfilename = &util::filename_cat ($image_dir, "${image_name}on.gif"); 276 # &process_width_macro ($fullfilename, $image_name, \$image_macros); 277 241 278 } elsif ($image_type eq "collector_bar_button") { 242 279 243 # unescape any newline characters in the text244 280 $text =~ s/\\n/\n/g; 281 if ($text !~ /\n/) { 282 # Format the text so it is centered, one word per line 283 local @textparts = split(/[ \t\n]+/, $text); 284 local $maxlength = 0; 285 for ($i = 0; $i < scalar(@textparts); $i++) { 286 if (length($textparts[$i]) > $maxlength) { 287 $maxlength = length($textparts[$i]); 288 } 289 } 290 $text = ""; 291 for ($i = 0; $i < scalar(@textparts); $i++) { 292 if (length($textparts[$i]) < $maxlength) { 293 $text .= ' ' x ((($maxlength - length($textparts[$i])) / 2) + 1); 294 } 295 $text .= $textparts[$i] . "\n"; 296 } 297 } 245 298 246 299 # generate on and off images (yellow) … … 250 303 if ($language_symbol eq "ru") { 251 304 $options .= " -foundry cronyx -fontname helvetica"; 305 } 306 # special case for Kazakh images (can also handle Russian) 307 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 308 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 252 309 } 253 310 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; … … 261 318 $options .= " -foundry cronyx -fontname helvetica"; 262 319 } 320 # special case for Kazakh images (can also handle Russian) 321 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 322 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 323 } 263 324 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 264 325 … … 271 332 $options .= " -foundry cronyx -fontname helvetica"; 272 333 } 273 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 274 334 # special case for Kazakh images (can also handle Russian) 335 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 336 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 337 } 338 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 275 339 # delete the unused dark image 276 if (-e util::filename_cat($image_dir, "nc$image_name" . "on.gif")) { 277 unlink(util::filename_cat($image_dir, "nc$image_name" . "on.gif")); 278 } 279 280 } elsif ($image_type eq "document_button") { 281 282 # generate on and off images 283 my $options = "-text \"$text\" -filenamestem $image_name"; 284 $options .= " -fixed_width -whitespace -image_dir $image_dir"; 285 if ($language_symbol eq "ru") { 286 $options .= " -fontsize 8 -foundry cronyx -fontname helvetica"; 287 } 288 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 289 290 # get width of new images and edit width macro 291 # my $fullfilename = &util::filename_cat ($image_dir, "${image_name}on.gif"); 292 # &process_width_macro ($fullfilename, $image_name, \$image_macros); 340 unlink(util::filename_cat($image_dir, "nc$image_name" . "on.gif")); 293 341 294 342 } elsif ($image_type eq "green_bar_left_aligned") { … … 298 346 my $options = "-text \"$text\" -filename ${image_name}.gif -dont_center"; 299 347 $options .= " -width 537 -width_space 15 -image_dir $image_dir"; 300 if ($language_symbol eq "ru") { 301 $options .= " -foundry cronyx -fontname helvetica"; 348 # special case for russian images 349 if ($language_symbol eq "ru") { 350 $options .= " -foundry cronyx -fontname helvetica"; 351 } 352 # special case for Kazakh images (can also handle Russian) 353 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 354 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 302 355 } 303 356 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`; … … 316 369 if ($language_symbol eq "ru") { 317 370 $options .= " -foundry cronyx -fontname helvetica"; 371 } 372 # special case for Kazakh images (can also handle Russian) 373 elsif ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 374 $options .= " -foundry 2rebels -fontname \"helv kaz\""; 318 375 } 319 376 `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon-1.2.pl $options`;
Note:
See TracChangeset
for help on using the changeset viewer.