title: dm-script looses font family when saving images
body: <p>When I add text annotations to an image without showing the image, the font family is always <em>monospace</em>. How do I fix this?</p>
  
  <p><strong>Edit:</strong> After some more testing the problem appears for both, with <code>showImage()</code> and without. When opening the saved image the font family is lost.</p>
  
  <hr>
  
  <p>I want to open all image files in one directory and add annotations to every file without showing the file to the user. Everything is working fine except that the font family always is <em>monospace</em>. </p>
  
  <p>The following image shows the text added without a call of <code>showImage()</code> on the left. On the right this is the exact same code but with one call of <code>showImage()</code>. As one can see, the font family is wrong. The code is shown below.</p>
  
  <p><strong>Edit:</strong> As mentioned above, the right image is equal to the left image when I close the right image and open it again.</p>
  
  <p><a href="https://i.stack.imgur.com/IbpmU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IbpmU.png" alt="Text annotations created with showImage() and without showImage()"></a></p>
  
  <pre class="lang-c prettyprint-override"><code>String path = "/temporary/path/for/saving/test-img.dm4";
  
  // create dummy image and save it
  image img := RealImage("The Image", 4, 512, 512);
  img = itheta
  img.saveImage(path);
  
  // - - -
  // open the image and process it
  
  img := openImage(path);
  // img.showImage(); // &lt;- This makes the difference between left and right image 
                      //    *Edit*: Both images loose their font family if they are
                      //    closed and opened again
  
  ImageDisplay disp;
  if(img.ImageCountImageDisplays() == 0){
      disp = ImageCreateImageDisplay(img, -2);
  }
  else{
      disp = img.ImageGetImageDisplay(0);
  }
  
  Component text = NewTextAnnotation(100, 300, "Some text", 20);
  text.ComponentSetForegroundColor(0, 0, 140);
  text.ComponentSetFontFaceName("sans-serif");
  disp.ComponentAddChildAtEnd(text);
  
  // save so the image can be opened if it is not shown anyway
  img.saveImage(path);
  </code></pre>