shams Posted August 28, 2017 Share Posted August 28, 2017 (edited) I use the ar-php library with still gd library to wirte the text on image, some arabic letters has more chars in the above and below, this text lines are too short on image, but other letters without extra chars are in the normal length, this is the code <?php require_once __DIR__.'/../vendor/autoload.php'; use GDText\Box; use GDText\Color; require('../I18N/Arabic.php'); $Arabic = new I18N_Arabic('Glyphs'); $box = new Box($im); $box->setFontFace(__DIR__.'/../fonts/BahijRegular.ttf'); $box->setFontSize(20); $box->setFontColor(new Color(0 , 0, 0)); // $box->setTextShadow(new Color(0, 0, 0, 50), 0, -2); $box->setBox(5, 20, 580, 300); $box->setTextAlign('right', 'top'); $im = imagecreatefromjpeg(__DIR__.'/../img/img.jpeg'); $text = file_get_contents('/home/user/message'); $text = $Arabic->utf8Glyphs($text); $box->draw($text); header("Content-type: image/jpeg"); imagejpeg($im); This is the output of this code: http://ibb.co/ea1sZ5 The first five lines are too short while others text is normal length, is it possible to make these lines longer? Edited August 28, 2017 by shams Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.