Changeset 2236
- Timestamp:
- 2001-04-01T13:18:22+12:00 (23 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gimp/flash_button.pl
r1469 r2236 41 41 use parsargv; 42 42 use util; 43 use unicode; 44 43 45 44 46 # set trace level to watch functions as they are executed … … 51 53 my ($cfg_file, $width, $height, $text, $filenamestem, $fixed_width, 52 54 $width_space, $whitespace, $dont_center, $bgcolor, $fontcolor, 53 $fontsize, $fo ntname, $fontweight, $fontslant, $fontwidth,55 $fontsize, $foundry, $fontname, $fontweight, $fontslant, $fontwidth, 54 56 $fontspacing, $image_dir); 55 57 … … 79 81 print STDERR " -fontcolor hex_value text color [$black]\n"; 80 82 print STDERR " -fontsize number font point size [10]\n"; 83 print STDERR " -foundry string [*]\n"; 81 84 print STDERR " -fontname string [lucida]\n"; 82 85 print STDERR " -fontweight string [medium]\n"; … … 99 102 $fontcolor = $black; 100 103 $fontsize = 10; 104 $foundry = "*"; 101 105 $fontname = "lucida"; 102 106 $fontweight = "medium"; … … 122 126 "fontcolor/#[0-9A-Fa-f]{6}/$black", \$fontcolor, 123 127 'fontsize/^\d+$/10', \$fontsize, 128 'foundry/.*/*', \$foundry, 124 129 'fontname/.*/lucida', \$fontname, 125 130 'fontweight/.*/medium', \$fontweight, … … 139 144 # replace any '\n' occurring in text with carriage return 140 145 $text =~ s/\\n/\n/gi; 141 146 142 147 if ($cfg_file =~ /\w/) { 143 148 … … 177 182 178 183 my $textlayer = gimp_text ($image, $backlayer, 0, 0, $text, 0, 1, 179 $fontsize, PIXELS, "*", $fontname, $fontweight,184 $fontsize, PIXELS, $foundry, $fontname, $fontweight, 180 185 $fontslant, $fontwidth, $fontspacing); 181 186 … … 205 210 ($image, $backlayer) = &create_image ($off_img); 206 211 $textlayer = gimp_text ($image, $backlayer, 0, 0, $text, 0, 1, 207 $fontsize, PIXELS, "*", $fontname, $fontweight,212 $fontsize, PIXELS, $foundry, $fontname, $fontweight, 208 213 $fontslant, $fontwidth, $fontspacing); 209 214 … … 211 216 212 217 my $y_offset = ($height-$textheight)-int($fontsize/5); 213 if ($text =~ /[gjpqyJ]/) { ## capital J is a descender in lucida font 218 219 my $descenders = ""; 220 221 # russian descenders (KOI8-R) 222 # $descenders .= chr(0xD2); 223 # $descenders .= chr(0xD5); 224 225 if ($text =~ /[gjpqyJ$descenders]/) { ## capital J is a descender in lucida font 214 226 # descenders - put text at bottom of image, otherwise 215 227 # go for fontsize/5 pixels above bottom. This is kind of hacky -
trunk/gsdl/bin/script/gimp/green_bar.pl
r1037 r2236 40 40 use parsargv; 41 41 use util; 42 use unicode; 42 43 43 44 # set trace level to watch functions as they are executed … … 49 50 50 51 my ($cfg_file, $width, $height, $text, $filename, $width_space, 51 $dont_center, $bgcolor, $fontcolor, $fontsize, $fo ntname,52 $dont_center, $bgcolor, $fontcolor, $fontsize, $foundry, $fontname, 52 53 $fontweight, $fontslant, $fontwidth, $fontspacing, $image_dir); 53 54 … … 70 71 print STDERR " -fontcolor hex_value text color [$black]\n"; 71 72 print STDERR " -fontsize number font point size [17]\n"; 73 print STDERR " -foundry string [*]\n"; 72 74 print STDERR " -fontname string [lucida]\n"; 73 75 print STDERR " -fontweight string [medium]\n"; … … 88 90 $fontcolor = $black; 89 91 $fontsize = 17; 92 $foundry = "*"; 90 93 $fontname = "lucida"; 91 94 $fontweight = "medium"; … … 109 112 "fontcolor/#[0-9A-Fa-f]{6}/$black", \$fontcolor, 110 113 'fontsize/^\d+$/17', \$fontsize, 114 'foundry/.*/*', \$foundry, 111 115 'fontname/.*/lucida', \$fontname, 112 116 'fontweight/.*/medium', \$fontweight, … … 160 164 161 165 my $textlayer = gimp_text ($image, $backlayer, 0, 0, $text, 0, 1, 162 $fontsize, PIXELS, "*", $fontname, $fontweight,166 $fontsize, PIXELS, $foundry, $fontname, $fontweight, 163 167 $fontslant, $fontwidth, $fontspacing); 164 168 … … 185 189 ($image, $backlayer) = &create_image (); 186 190 $textlayer = gimp_text ($image, $backlayer, 0, 0, $text, 0, 1, 187 $fontsize, PIXELS, "*", $fontname, $fontweight,191 $fontsize, PIXELS, $foundry, $fontname, $fontweight, 188 192 $fontslant, $fontwidth, $fontspacing); 189 193 … … 191 195 192 196 my $y_offset = ($height-$textheight)-int($fontsize/5); 193 if ($text =~ /[gjpqy]/) { 197 198 my $descenders = ""; 199 200 # russian descenders (KOI8-R) 201 # $descenders .= chr(0xD2); 202 # $descenders .= chr(0xD5); 203 204 if ($text =~ /[gjpqyJ$descenders]/) { ## capital J is a descender in lucida font 194 205 # descenders - put text at bottom of image, otherwise 195 206 # go for fontsize/5 pixels above bottom. This is kind of hacky -
trunk/gsdl/bin/script/gimp/title_icon.pl
r1267 r2236 37 37 use parsargv; 38 38 use util; 39 use unicode; 39 40 40 41 # set trace level to watch functions as they are executed … … 48 49 local ($cfg_file, $size, $imagefile, $width, $height, $imageheight, $stripecolor, $stripewidth, 49 50 $stripe_alignment, $i_transparency, $text, $text_alignment, $filename, $textspace_x, 50 $textspace_y, $bgcolor, $fontcolor, $fontsize, $minfontsize, $fo ntname,51 $textspace_y, $bgcolor, $fontcolor, $fontsize, $minfontsize, $foundry, $fontname, 51 52 $fontweight, $fontslant, $fontwidth, $fontspacing, $image_dir, $dont_wrap); 52 53 … … 81 82 print STDERR " -fontsize number font point size [17]\n"; 82 83 print STDERR " -minfontsize number minimum point size font will be reduced to fit image [10]\n"; 84 print STDERR " -foundry string [*]\n"; 83 85 print STDERR " -fontname string [lucida]\n"; 84 86 print STDERR " -fontweight string [medium]\n"; … … 108 110 $fontsize = int (17 * $size); 109 111 $minfontsize = int (10 * $size); 112 $foundry = "*"; 110 113 $fontname = "lucida"; 111 114 $fontweight = "medium"; … … 138 141 'fontsize/^\d+$/17', \$fontsize, 139 142 'minfontsize/^\d+$/10', \$minfontsize, 143 'foundry/.*/*', \$foundry, 140 144 'fontname/.*/lucida', \$fontname, 141 145 'fontweight/.*/medium', \$fontweight, … … 259 263 if (length($text)) { 260 264 $text =~ s/\\n/\n/gi; 265 261 266 while (1) { 262 267 $textlayer = gimp_text ($image, $backlayer, 0, 0, $text, 0, 1, $fsize, 263 PIXELS, "*", $fontname, $fontweight, $fontslant,268 PIXELS, $foundry, $fontname, $fontweight, $fontslant, 264 269 $fontwidth, $fontspacing); 265 270 -
trunk/gsdl/bin/script/translate.pl
r1970 r2236 41 41 use parsargv; 42 42 use util; 43 use unicode; 43 44 44 45 # these html entities will be translated correctly when occurring in … … 188 189 $text =~ s/&([^;]*);/$rmap{$1}/g; 189 190 191 # special case for russian images - fonts expect text to be koi8-r encoded 192 if ($language_symbol eq "ru") { 193 $text = &unicode::unicode2koi8r(&unicode::utf82unicode($text)); 194 } 195 190 196 # edit image macros 191 197 $image_macros =~ s/(_httpimg_\/)(?:[^\/\}]*\/)?([^\}]*\.(?:gif|jpe?g|png))/$1$language_symbol\/$2/gs; … … 195 201 # generate images 196 202 my $options = "-text \"$text\" -filenamestem $image_name"; 197 $options .= " -fontsize 12 -height 20 -whitespace -image_dir $image_dir"; 203 # special case for russian images 204 if ($language_symbol eq "ru") { 205 $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir"; 206 $options .= " -foundry cronyx -fontname helvetica"; 207 } else { 208 $options .= " -fontsize 12 -height 20 -whitespace -image_dir $image_dir"; 209 } 198 210 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button.pl $options`; 199 211 … … 208 220 $options .= " -fontsize 17 -height 17 -fixed_width -width 87"; 209 221 $options .= " -image_dir $image_dir"; 222 # special case for russian images 223 if ($language_symbol eq "ru") { 224 $options .= " -foundry cronyx -fontname helvetica"; 225 } 210 226 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button.pl $options`; 211 227 … … 213 229 $options = "-text \"$text\" -filename ${image_name}gr.gif"; 214 230 $options .= " -image_dir $image_dir"; 231 # special case for russian images 232 if ($language_symbol eq "ru") { 233 $options .= " -foundry cronyx -fontname helvetica"; 234 } 215 235 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar.pl $options`; 216 236 … … 224 244 my $options = "-text \"$text\" -filenamestem $image_name"; 225 245 $options .= " -fixed_width -whitespace -image_dir $image_dir"; 246 if ($language_symbol eq "ru") { 247 $options .= " -fontsize 8 -foundry cronyx -fontname helvetica"; 248 } 226 249 `$ENV{'GSDLHOME'}/bin/script/gimp/flash_button.pl $options`; 227 250 … … 236 259 my $options = "-text \"$text\" -filename ${image_name}.gif -dont_center"; 237 260 $options .= " -width 537 -width_space 15 -image_dir $image_dir"; 261 if ($language_symbol eq "ru") { 262 $options .= " -foundry cronyx -fontname helvetica"; 263 } 238 264 `$ENV{'GSDLHOME'}/bin/script/gimp/green_bar.pl $options`; 239 265 … … 248 274 $options .= " -width $width -height 57 -stripe_alignment right -text_alignment right"; 249 275 $options .= " -fontsize 26 -fontweight bold"; 276 # special case for russian images 277 if ($language_symbol eq "ru") { 278 $options .= " -foundry cronyx -fontname helvetica"; 279 } 250 280 `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon.pl $options`; 251 281
Note:
See TracChangeset
for help on using the changeset viewer.