Initial widget fonts

View: New views
5 Messages — Rating Filter:   Alert me  

Initial widget fonts

by Zorabi Honargohar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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)?
 
Thank you very much.
Z.
 

------------------------------------------------------------------------------
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

Re: Initial widget fonts

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Parent Message unknown Re: Initial widget fonts

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 30 May 2009, you wrote:
> Thank you.
>
> If I understand it correctly, the following scenario should work.
>
> 1. Let user select the font for startup.
> 2. Inform user the font will take effect on next startup.

That would work.

> If this is true, I hope the following quesiton is sensible.
>
> What are the section and keywords in registry for application startup font?

Look in file ~/.foxrc/<vendorkey>/<appkey>.  You can add a registy key
like:

        [SETTINGS]
        normalfont=helvetica [adobe],90,medium,regular,,iso10646-1

Note that the ControlPanel application changes this key in the file
~/.foxrc/Desktop, which will affect all FOX applications.

The above pertains to Linux; on Windows, you'll find the same key structure in
the system registry.


        Hope this helps,


                        - Jeroen


--
+----------------------------------------------------------------------------+
| Copyright (C) 22:40 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

Re: Initial widget fonts

by Sander Jansen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or do:

    getApp()->getNormalFont()->destroy();
    getApp()->getNormalFont()->setFontDesc(newfontdescription);
    getApp()->getNormalFont()->create();

and then do a global layout() / redraw so all widgets know about the new font.

Sander

On Sat, May 30, 2009 at 10:51 PM, Jeroen van der Zijp <jeroen@...> wrote:

> On Saturday 30 May 2009, you wrote:
>> Thank you.
>>
>> If I understand it correctly, the following scenario should work.
>>
>> 1. Let user select the font for startup.
>> 2. Inform user the font will take effect on next startup.
>
> That would work.
>
>> If this is true, I hope the following quesiton is sensible.
>>
>> What are the section and keywords in registry for application startup font?
>
> Look in file ~/.foxrc/<vendorkey>/<appkey>.  You can add a registy key
> like:
>
>        [SETTINGS]
>        normalfont=helvetica [adobe],90,medium,regular,,iso10646-1
>
> Note that the ControlPanel application changes this key in the file
> ~/.foxrc/Desktop, which will affect all FOX applications.
>
> The above pertains to Linux; on Windows, you'll find the same key structure in
> the system registry.
>
>
>        Hope this helps,
>
>
>                        - Jeroen
>
>
> --
> +----------------------------------------------------------------------------+
> | Copyright (C) 22:40 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
>


--
"And any fool knows a dog needs a home
A shelter from pigs on the wing"



------------------------------------------------------------------------------
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

signature.asc (278 bytes) Download Attachment

Re: Initial widget fonts

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 31 May 2009, Sander Jansen wrote:
> Or do:
>
>     getApp()->getNormalFont()->destroy();
>     getApp()->getNormalFont()->setFontDesc(newfontdescription);
>     getApp()->getNormalFont()->create();
>
> and then do a global layout() / redraw so all widgets know about the new font.

Yes, that would work also.  Basically, it would re-initialize the same font
object with new font data.  All the widgets which have copied the default
font would instantly have the new font.

Since the new font has different metrics than the old one, and the font
was changed out from under each widget, an explicit layout is needed since
otherwise the widget isn't aware of the change.


                - Jeroen



--
+----------------------------------------------------------------------------+
| Copyright (C) 18:50 05/31/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