comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » widget fonts
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
widget fonts [message #18303] Thu, 16 December 1999 00:00 Go to next message
Marc Schellens is currently offline  Marc Schellens
Messages: 14
Registered: November 1999
Junior Member
Is there a way to scale the font for widgets (i.e button labels) with
the motif interface?

thanks,
:-) marc
sec : u Re: Widget Fonts [message #24355 is a reply to message #18303] Mon, 26 March 2001 16:29 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Martin Schultz wrote:
>
<snip lotsa widget font stuff>
>
> Cheers,
> Martin
>
> PS: By pure chance, I recently discovered IDL's xfont utility.
> Apparently it only works for Unix platforms, although it shouldn't be
> too hard to write a tool that would be platform independent.
>

Not so, Martin! XFONT has worked on VMS since '92 ...

Andrew C.

------------------------------------------------------------ ---------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group `-<-'
Surveillance Systems Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Salisbury electrons
South Australia 5108

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ ---------
Re: Widget Fonts [message #24367 is a reply to message #18303] Mon, 26 March 2001 10:14 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning wrote:
>
> Bernard Puc (bpuc@va.aetc.com) writes:
>
>> Is there a way to get the current default widget font? I can define it
>> using widget_control, default_font = ***, but I can't seem to determine
>> what its set to. What I'd like to be able to do is define say a label
>> in a larger size of the default font. Any ideas?
>
> As far as I know, there is no way to get at this
> information programmatically. IDL is picking up
> system font information. I can change various
> fonts by playing with the Appearances/Font
> properties on my Windows machine, but so far not
> the font that is used for most things in widgets. :-(
>
> Cheers,
>
> David

So it seems, the only way to control the fonts is to set them
explicitely and store them either in some UValue field of the widget
or use object oriented widgets where you should be able to

thewidget->SetProperty, defaultfont=defaultfont

and redisplay. You can then try to apply some arithmetics on
defaultfont to choose a somewhat larger yet related font for the
labels (or you just set this explicitly as, say, labelfont). In order
to please Pavel who will want to run it on a Mac, too, please make
sure that your solution works for all platforms. In a recent program
by David (with a little influence of myself ;-) we use the following:

; Set widget font names.

thisOS = StrUpCase(!Version.os_family)
CASE thisOS OF
'WINDOWS': BEGIN
IF N_Elements(labelfont) EQ 0 THEN self.labelfont = 'Times*Bold'
IF N_Elements(defaultfont) EQ 0 THEN self.defaultfont = 'MS Sans
Serif*10'
END
'MACOS': BEGIN
IF N_Elements(labelfont) EQ 0 THEN self.labelfont = 'Times*Bold'
IF N_Elements(defaultfont) EQ 0 THEN self.defaultfont =
'Times*10'
END
ELSE: BEGIN
IF N_Elements(labelfont) EQ 0 THEN self.labelfont =
'-*-times-bold-r-*-*-12-*'
IF N_Elements(defaultfont) EQ 0 THEN self.defaultfont =
'-*-times-medium-r-*-*-12-*'
END
ENDCASE
Widget_Control,
Default_Font=self.defaultfont



This only works if the widget is currently not realized.

Cheers,
Martin


PS: By pure chance, I recently discovered IDL's xfont utility.
Apparently it only works for Unix platforms, although it shouldn't be
too hard to write a tool that would be platform independent.


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
Re: Widget Fonts [message #24368 is a reply to message #18303] Mon, 26 March 2001 10:07 Go to previous message
Bernard Puc is currently offline  Bernard Puc
Messages: 65
Registered: January 1998
Member
David Fanning wrote:
>
> Bernard Puc (bpuc@va.aetc.com) writes:
>
>> Is there a way to get the current default widget font? I can define it
>> using widget_control, default_font = ***, but I can't seem to determine
>> what its set to. What I'd like to be able to do is define say a label
>> in a larger size of the default font. Any ideas?
>
> As far as I know, there is no way to get at this
> information programmatically. IDL is picking up
> system font information. I can change various
> fonts by playing with the Appearances/Font
> properties on my Windows machine, but so far not
> the font that is used for most things in widgets. :-(
>

So, I guess what I have to do is manually figure out what the system
default font is, and declare that as the widget default font up front
and then I can specify different sizes of that font.

Another observation which I wonder has anyone else seen: I use the
widget_button menu keyword to create dropdown button menus. The font
used in the dropdown menu is always the default system font - it never
shows up in the font I specify with the widget_control command.

--
Bernard Puc AETC, INC.
bpuc@va.aetc.com 1225 Jefferson Davis Highway #800
(703) 413-0500 Arlington, VA 22202
Re: Widget Fonts [message #24371 is a reply to message #18303] Mon, 26 March 2001 07:58 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Bernard Puc (bpuc@va.aetc.com) writes:

> Is there a way to get the current default widget font? I can define it
> using widget_control, default_font = ***, but I can't seem to determine
> what its set to. What I'd like to be able to do is define say a label
> in a larger size of the default font. Any ideas?

As far as I know, there is no way to get at this
information programmatically. IDL is picking up
system font information. I can change various
fonts by playing with the Appearances/Font
properties on my Windows machine, but so far not
the font that is used for most things in widgets. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: converting to array
Next Topic: Re: pointer question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:39:02 PDT 2025

Total time taken to generate the page: 0.00652 seconds