« Return to Thread: Initial widget fonts

Re: Initial widget fonts

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View in Thread

On Friday 29 May 2009, you wrote:
> Context. This is in context of an IDE based on FOX. Users can change the font associated with text area, and we have no problem there. The problem is the font used in widgets buttons, menu item etc. In Windows it seems to pick up whatever font Windows is using. In Linux, particularly 64 bit, the widget font is not readable.
>
> I have tried to chase the code, and play with any font handle that I thought is related to startup widget fonts. Nothing seems to work.
>
> Question. I need to set the widget font for menus, buttons etc to be the same as desktop is using. What do I need to do in order to accomplish that? How do I get a handle to that font so I can change it dynamically (e.g. at user request as we are doing for text area)?

The widget font is determined at application startup time.

        1) The font is first initialized to a sensible default value;

        2) Next, on Windows, its changed to the value read from the system configuration.

        3) Afterward, the FOX registry is consulted; if a font is specified, then
           the value determined previously is replaced by the value from the registry.

The FOX ControlPanel application can be changed to set the font in the FOX registry
graphically.  

You can of course also change the font programmatically, by invoking each control's
setFont() function.  Most widgets initialize their fonts from the (shared, FXApp
managed) default font.

While you can change a widget's font at any time, there is no easy way to change
it in a whole-sale fashion, except for looping through the widget hierarchy and
setting it for each type of control (unless the font data of the stock-font are
changed prior to realizing it, or maybe by destroying, then recreating the stock
font after changing its font data).


Hope this helps,


                        - Jeroen



--
+----------------------------------------------------------------------------+
| Copyright (C) 08:00 05/30/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

 « Return to Thread: Initial widget fonts