[fxruby-users] Printing text in bold

Don Wilde dwilde1 at gmail.com
Mon Nov 10 19:06:27 EST 2008

On Mon, Nov 10, 2008 at 4:10 PM, Stuart Clarke <stuart_clarke86 at yahoo.com>wrote:

> Hi all,
> I have a FX GUI up and running on my system which displays text in a text
> frame. It becomes quite difficult for me to pick things out in this text
> within the GUI, therefore is it possible to print some of the text in say
> bold or a different colour? The data I am printing out is extracted from an
> array. Therefore do I have to do something when the data is pushed into the
> array?
> Thanks in advance!

Hi, Stuart -

It appears to me that a font element is associated with a whole FXRuby
object. I don't believe it's possible to change font in mid-stream.

There is no reason, though, why you can't build your display from a series
of FXLabels (or FXTextFields with TEXTFIELD_READONLY) set to different
weights of text or different sizes, one per line.

It should be possible to (with appropriate :padding set and no LAYOUT_FILL)
create a linear stream of text blocks, word by word, in the layout manager.
The packer would stack them one after another, left to right and then down.
Obviously more work than inserting <B>BOLD</B>, but do-able.

For hardcopy printing, you can build a Postscript or RTF document and print

HTH, let us know what you generate!

-- :D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081110/e157c4fc/attachment.html>

More information about the fxruby-users mailing list