Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Text formatting

Posted by matt (matt), 22 May 2003

Text formatting urgghhhhhhh.

I am not even sure if this is possible, if it is can you tell me or point to a reference source where I can find how to change text to bold and change font.

And yes I have got a new job as a secretary making reports look pretty.

Thanks in advance


p.s. Some good news, Rachel is pregnant and due on Nov 21 and yes it is mine (I think).

Posted by admin (Graham Ellis), 22 May 2003
Do you know what format you're going to be using? HTML? RTF? Markup for these pages where you can make things bold or italic?    It can usually be done, but you need to know the format!

Posted by matt (matt), 24 May 2003
The format I need will always be RTF.


Posted by admin (Graham Ellis), 24 May 2003
Oh ... RTF is a dog of a format.   If you want an idea of just how much of a dog, have a look at:

There's even an RTF pocket guide published by O'Reilly - think it's one of the few books I haven't got.  ISBN 0-596-00475-3, published May 2003.

Have a search for RTF on the CPAN .... there's a number.  RTF:ocument came up first for me, and looks like it might do the job for you.   Here's the sort of thing (this example from the module's documentation. rrr

use RTF::Document;

   # Document properties

   $rtf = new RTF::Document(
       doc_page_width => '8.5in',
       doc_page_height => '11in'

   # Font definitions

   $fAvantGarde = $rtf->add_font ("AvantGarde",
      { family=>swiss,
      } );
   $fCourier = $rtf->add_font ("Courier",
     { family=>monospace, pitch=>fixed,
       alternates=>["Courier New", "American Typewriter"]
     } );

   # Color definitions

   $cRed   = $rtf->add_color ( { red=>255 } );
   $cGreen = $rtf->add_color ( { green=>128 } );
   $cCustm = $rtf->add_color ( { red=>0x66, blue=>0x33, green=>0x33 } );

   $cBlack = $rtf->add_color ( { name=>'black' } );
   $cWhite = $rtf->add_color ( { gray=>'100%' } );

   $cNavy = $rtf->add_color ( { blue=>'100%', gray=>'50%' } );

   # style definitions

   $sNormal = $rtf->add_style( "Normal",
     { font=>$fAvantGarde, font_size=>'12pt',
       color_foreground=>$cBlack },
     { type=>paragraph, default=>1 }

   $sGreen = $rtf->add_style( "Green",
     { color_foreground=>$cGreen },
     { type=>character, additive=>1 }

   # Mix any combo of properties and text...

   $rtf->add_text( $rtf->root(),
      "Default text\n\n",

      { bold=>1, underline=>continuous },
      "Bold/Underlined Text\n\n",

      { font_size=>'20pt', font=>$fCourier,
        color_foreground=>$cRed },
      "Bigger, Red and Monospaced.\n\n",

      { style_default=>paragraph },
      { style_default=>character },

      "This is ",
      [ { style=>$sGreen }, "green" ],
      " styled.\n\n"


   open FILE, ">MyFile.rtf";
   binmode FILE;
   print FILE $rtf->rtf();
   close FILE;

Example is Copyright (c) 1999-2000 Robert Rothenberg. "All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself."  I think I'm within those terms to quote it in this way ...

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2023: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho