Changeset 5484 for trunk/gsdl
- Timestamp:
- 2003-09-10T13:24:11+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/translate.pl
r4231 r5484 186 186 187 187 my $origtext = $text; 188 188 189 $text =~ s/&(\d{3,4});/chr($1)/ge; 189 190 $text =~ s/&([^;]*);/$rmap{$1}/g; 190 191 191 # special case for russian images - fonts expect text to be koi8-r encoded 192 if ($language_symbol eq "ru") { 192 # Default font is set by the individual scripts (flash_button-1.2.pl etc), usually lucida 193 my $fontchoice = ""; 194 195 # special case for Kazakh images (can also handle Russian) - encode to match Kazakh font 196 if ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 197 $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "kazakh"); 198 $fontchoice = " -foundry 2rebels -fontname \"helv kaz\""; 199 } 200 # special case for Russian images - font is koi8-r encoded 201 elsif ($language_symbol eq "ru") { 193 202 $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"); 198 } 203 $fontchoice = " -foundry cronyx -fontname helvetica"; 204 } 205 # special case for Ukrainian images - font is windows_1251 encoded 206 elsif ($language_symbol eq "uk") { 207 $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "windows_1251"); 208 $fontchoice = " -foundry rfx -fontname serene"; 209 } 210 # special case for Thai images 211 # elsif ($language_symbol eq "th") { 212 # $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "thai"); 213 # } 199 214 200 215 # edit image macros … … 202 217 203 218 if ($image_type eq "top_nav_button") { 204 219 205 220 # generate images 206 my $options = "-text \"$text\" -filenamestem $image_name"; 207 # special case for russian images 208 if ($language_symbol eq "ru") { 209 $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir"; 210 $options .= " -foundry cronyx -fontname helvetica -fontweight bold"; 211 } 221 my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir"; 222 $options .= " -height 20 -whitespace"; 223 $options .= $fontchoice; 224 212 225 # 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 } 226 if ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 227 $options .= " -fontsize 10 -fontweight bold"; 228 } 229 # special case for Russian images 230 elsif ($language_symbol eq "ru") { 231 $options .= " -fontsize 10 -fontweight bold"; 232 } 233 # special case for Ukrainian images 234 elsif ($language_symbol eq "uk") { 235 $options .= " -fontsize 10"; 236 } 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 # } 217 243 else { 218 $options .= " -fontsize 12 -height 20 -whitespace -image_dir $image_dir";244 $options .= " -fontsize 12"; 219 245 } 220 246 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; … … 227 253 228 254 # generate on and off images 229 my $options = "-text \"$text\" -filenamestem $image_name"; 230 $options .= " -fontsize 17 -height 17 -fixed_width -width 87"; 231 $options .= " -image_dir $image_dir"; 232 # special case for russian images 233 if ($language_symbol eq "ru") { 234 $options .= " -foundry cronyx -fontname helvetica"; 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 } 255 my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir"; 256 $options .= " -height 17 -fixed_width -width 87"; 257 $options .= $fontchoice; 258 259 # special case for Thai images 260 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\""; 265 } 266 else { 267 $options .= " -fontsize 17"; 268 } 269 240 270 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 241 271 242 272 # generate green image 243 $options = "-text \"$text\" -filename ${image_name}gr.gif"; 244 $options .= " -image_dir $image_dir"; 245 # special case for russian images 246 if ($language_symbol eq "ru") { 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\""; 252 } 273 $options = "-text \"$text\" -filename ${image_name}gr.gif -image_dir $image_dir"; 274 $options .= $fontchoice; 275 253 276 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`; 254 277 … … 260 283 261 284 # 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 } 285 my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir"; 286 $options .= " -fixed_width -whitespace"; 287 $options .= $fontchoice; 288 268 289 # 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\""; 290 if ($language_symbol eq "kz") { # || $language_symbol eq "ru") { 291 $options .= " -fontsize 8"; 292 } 293 # special case for Russian images 294 elsif ($language_symbol eq "ru") { 295 $options .= " -fontsize 8"; 296 } 297 # special case for Ukrainian images 298 elsif ($language_symbol eq "uk") { 299 $options .= " -fontsize 8"; 271 300 } 272 301 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; … … 300 329 my $options = "-text \"$text\" -filenamestem yc$image_name -image_dir $image_dir"; 301 330 $options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13"; 302 # special case for russian images 303 if ($language_symbol eq "ru") { 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\""; 309 } 331 $options .= $fontchoice; 332 310 333 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 311 334 … … 314 337 $options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13"; 315 338 $options .= " -bgcolor \"#96c19b\""; 316 # special case for russian images 317 if ($language_symbol eq "ru") { 318 $options .= " -foundry cronyx -fontname helvetica"; 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 } 339 $options .= $fontchoice; 340 324 341 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 325 342 … … 328 345 $options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13"; 329 346 $options .= " -bgcolor \"#7E7E7E\" -fontcolor \"#a0a0a0\""; 330 # special case for russian images 331 if ($language_symbol eq "ru") { 332 $options .= " -foundry cronyx -fontname helvetica"; 333 } 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`; 347 $options .= $fontchoice; 348 349 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`; 350 339 351 # delete the unused dark image 340 352 unlink(util::filename_cat($image_dir, "nc$image_name" . "on.gif")); … … 344 356 # generate green bar image (we're assuming these bars are always 537 345 357 # pixels and are never stretched by excess text 346 my $options = "-text \"$text\" -filename ${image_name}.gif -dont_center"; 347 $options .= " -width 537 -width_space 15 -image_dir $image_dir"; 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\""; 355 } 358 my $options = "-text \"$text\" -filename ${image_name}.gif -image_dir $image_dir"; 359 $options .= " -dont_center -width 537 -width_space 15"; 360 $options .= $fontchoice; 361 356 362 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`; 357 363 358 364 } elsif ($image_type eq "green_title") { 359 365 360 366 # read the width if it is specified in $image_macros 361 367 my ($width) = $image_macros =~ /_width${image_name}x?_\s*[^\{]*\{(\d+)\}/; … … 366 372 $options .= " -width $width -height 57 -stripe_alignment right -text_alignment right"; 367 373 $options .= " -fontsize 26 -fontweight bold"; 368 # special case for russian images 369 if ($language_symbol eq "ru") { 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\""; 375 } 374 $options .= $fontchoice; 375 376 376 `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon-1.2.pl $options`; 377 377
Note:
See TracChangeset
for help on using the changeset viewer.