title: PHP imagettftext partially bold
body: <p>I'm training my PHP skills to generate images. I need only one thing which doesn't work. I don't think it's possible on the way I want, but there should be another way. The code I already have is this:</p>
  
  <pre><code>&lt;?php
  $textSize = 10;
  $text = addslashes("Wietse: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada aliquet dolor, vitae tristique lectus imperdiet nec. Pellentesque et.");
  $maxWidth = 448;
  
  //Create image
  $im = imagecreate(468, 60);
  
  // Black background and White text
  $bg = imagecolorallocate($im, 0, 0, 0);
  $textColor = imagecolorallocate($im, 255, 255, 255);
  
  // Split in multiple lines
  $words = explode(' ', $text);
  $lines = array();
  $line = "";
  foreach ($words as $word) {
      $box = imagettfbbox($textSize, 0, './arial.ttf', $line . $word);
      $width = $box[4] - $box[0];
      if($width &gt; $maxWidth) {
          $line = trim($line);
          $line .= "\n";
      }
      $line .= $word . ' ';
  }
  
  // Write the text in the image
  imagettftext($im, $textSize, 0, 10, $textSize + 10, $textColor, './arial.ttf', $line); // write text to image
  
  // Output the image
  header('Content-type: image/png');
  imagepng($im);
  imagedestroy($im);
  ?&gt;
  </code></pre>
  
  <p>Which results in this image:</p>
  
  <p><img src="https://i.stack.imgur.com/E1g6B.png" alt="Image"></p>
  
  <p>It works fine, but my name, Wietse, should be Bold. I don't think it's possible to do this on a simple way, but it should be possible. I can add another <code>imagettftext()</code> with a Bold Arial font, but the Lorum ipsum text should start next to the name and the second line should continue on the same X coordinates as the name. Like it is now.
  I also have another wish, but I think it's too difficult because this text can have any position. But if someone knows how to do this he's great. This is that the link (<a href="http://www.google.com" rel="noreferrer">http://www.google.com</a>) has an underline. I don't think I need to tell further information.</p>
  
  <p>Thanks on purpose!</p>