? .DS_Store
? .buildpath
? .bzr
? .git
? .project
? .settings
? captcha-HEAD.kpf
? image_captcha/.DS_Store
? image_captcha/fonts/.DS_Store
? image_captcha/fonts/.gitignore
? image_captcha/fonts/1456Gutenberg.TTF
? image_captcha/fonts/Army.ttf
? image_captcha/fonts/BABYK___.TTF
? image_captcha/fonts/LiberationFonts
? image_captcha/fonts/actionj.ttf
? image_captcha/fonts/dropacha.ttf
? image_captcha/fonts/dropacha.zip
? image_captcha/fonts/skinck.ttf
? image_captcha/fonts/subeve.ttf
? image_captcha/fonts/tiza.ttf
? translations/.DS_Store
Index: image_captcha/image_captcha.user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/image_captcha/image_captcha.user.inc,v
retrieving revision 1.19
diff -u -b -u -p -r1.19 image_captcha.user.inc
--- image_captcha/image_captcha.user.inc	24 Apr 2009 22:16:48 -0000	1.19
+++ image_captcha/image_captcha.user.inc	11 Jul 2009 18:08:57 -0000
@@ -92,7 +92,9 @@ function _image_captcha_generate_image($
   imagefilledrectangle($image, 0, 0, $width, $height, $background_color);
 
   // draw text
-  $result = _image_captcha_image_generator_print_string($image, $width, $height, $font, $font_size, $code);
+  global $language;
+  $rtl = (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL); // @todo: the check if LANGUAGE_RTL is defined can be dropped for Drupal 7.
+  $result = _image_captcha_image_generator_print_string($image, $width, $height, $font, $font_size, $code, $rtl);
   if (!$result) {
     return FALSE;
   }
@@ -222,7 +224,7 @@ function _image_captcha_image_generator_
 /**
  * Helper function for drawing text on the image.
  */
-function _image_captcha_image_generator_print_string(&$image, $width, $height, $font, $font_size, $text) {
+function _image_captcha_image_generator_print_string(&$image, $width, $height, $font, $font_size, $text, $rtl=FALSE) {
   // get characters
   $characters = _image_captcha_utf8_split($text);
   $character_quantity = count($characters);
@@ -259,6 +261,9 @@ function _image_captcha_image_generator_
   foreach ($characters as $c => $character) {
     // initial position of character: in the center of its cage
     $center_x = ($c + 0.5) * $ccage_width;
+    if ($rtl) {
+      $center_x = $width - $center_x;
+    }
     $center_y = 0.5 * $height;
 
     // get character dimensions for ttf fonts
