/*
 * $VER: Title 1.00.00 (24.9.92)
 *
 * Arexx program for the ImageFX image processing system.
 * Written by Thomas Krehbiel
 *
 * Center a string of text on a black background screen,
 * render the results as a greyscale screen, and save
 * the rendered image to disk.
 *
 * Uses the CGTriumvirate.font outline font.
 *
 */

OPTIONS RESULTS

Render Mode Hires Lace
Render Colors 16
Render Dither 0 0 0

swidth = 640
sheight = 400

RequestNumber '"Font size:"' 80
IF rc ~= 0 THEN EXIT

size = result

DO FOREVER

   CreateBuffer swidth sheight Grey Force

   width = swidth + 1
   DO UNTIL width < swidth

      RequestString '"Enter your title:"'
      IF rc ~= 0 THEN EXIT

      title = result

      Text 'CGTriumvirate.font' size 100 title

      GetBrush ; IF result = "" THEN EXIT
      PARSE VAR result name width height .

      IF width > swidth THEN RequestNotify 'Text too wide.'

      END

   EdgeMode AntiAlias
   BrushHandle 0 0

   Point (swidth-width)%2 (sheight-height)%2

   KillBrush

   Render Go
   SaveRenderedAs ILBM 'RAM:Title_'||TRANSLATE(title,'___',' /:')||'.pic'
   Render Close

   END

EXIT
