Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Simon Schampijer
On 01/10/2010 07:00 PM, Sayamindu Dasgupta wrote:
 Hello,
 I just wanted to announce that I would be more than happy to do the
 remaining work to be done for
 http://wiki.sugarlabs.org/go/Features/Font_configuration
 The main work involved is to implement a xsettings manager which will
 be monitoring the relevant Sugar GConf keys and updating the
 corresponding Xsettings as and when they change. Currently I'm
 considering customizing the existing sample xsettings manager which
 comes with the spec[1] and see how that works out. The manager would
 be started during Sugar startup, as done in GNOME
 (gnome-settings-daemon).
 Thanks,
 Sayamindu

 [1] http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html


Hi Sayamindu and Daniel,

great you are interested to work on this Feature!

* Settings-daemon
As you said, the settings-daemon would be a great thing to have for 
several reasons. I think a daemon would help us as well in terms of 
global key bindings.

* Owner
Should we change the owner of the Feature to you, or does Daniel keeps 
on monitoring the Feature?

* UI
Another low hanging fruit seems to me to have the UI to increase and 
decrease the font size. Daniel describes it as being an option in the 
control panel. Now as we have the gconf option, this sounds like a 
doable task to me. Maybe as well a task to someone else who wants to 
gain a few karma points with core hacking ;D

* Activity guidelines [1]
The activity guidelines seem to make sense at first glance. We should go 
through them in detail and communicate them. Regarding deprecating 
sugar.style.FONT_* - we should decide quickly before the API-Freeze.

@Daniel: Thanks for bringing this Feature up and for writing such a 
detailed on the point Feature page, congrats!

Regards,
Simon

[1] 
http://wiki.sugarlabs.org/go/Features/Font_configuration#Consideration_for_activities
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Art Hunkins
With respect to the proposed UI and low-hanging fruit:

The font-configuring code I use in OurMusic-2 strictly adheres to Daniel's 
suggestions.

Basicly, Daniel's suggestion would pick up the proposed UI-set font value 
from:
  settings = gtk.settings_get_default()
  font_name = settings.get_property(gtk-font-name)
then manipulate and display individual text instances with:
  font = widget.get_pango_context().get_font_description()
  font.set_size(int(font.get_size() [and whatever])

This presumes that the UI would change the value found with the first set of 
two code lines above, and have nothing to do with the second set. However, 
this latter set is based on system defaults which *remain unchanged* under 
the proposed feature. These defaults are not likely to change for other 
reasons either.

Am I correct concerning these defaults, and should code based on the above 
continue to work on all XO and SoaS systems?

Art Hunkins

- Original Message - 
From: Simon Schampijer si...@schampijer.de
To: sugar-devel@lists.sugarlabs.org
Sent: Monday, January 11, 2010 7:31 AM
Subject: Re: [Sugar-devel] [FEATURE] Fonts-configuration


 On 01/10/2010 07:00 PM, Sayamindu Dasgupta wrote:
 Hello,
 I just wanted to announce that I would be more than happy to do the
 remaining work to be done for
 http://wiki.sugarlabs.org/go/Features/Font_configuration
 The main work involved is to implement a xsettings manager which will
 be monitoring the relevant Sugar GConf keys and updating the
 corresponding Xsettings as and when they change. Currently I'm
 considering customizing the existing sample xsettings manager which
 comes with the spec[1] and see how that works out. The manager would
 be started during Sugar startup, as done in GNOME
 (gnome-settings-daemon).
 Thanks,
 Sayamindu

 [1] 
 http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html


 Hi Sayamindu and Daniel,

 great you are interested to work on this Feature!

 * Settings-daemon
 As you said, the settings-daemon would be a great thing to have for
 several reasons. I think a daemon would help us as well in terms of
 global key bindings.

 * Owner
 Should we change the owner of the Feature to you, or does Daniel keeps
 on monitoring the Feature?

 * UI
 Another low hanging fruit seems to me to have the UI to increase and
 decrease the font size. Daniel describes it as being an option in the
 control panel. Now as we have the gconf option, this sounds like a
 doable task to me. Maybe as well a task to someone else who wants to
 gain a few karma points with core hacking ;D

 * Activity guidelines [1]
 The activity guidelines seem to make sense at first glance. We should go
 through them in detail and communicate them. Regarding deprecating
 sugar.style.FONT_* - we should decide quickly before the API-Freeze.

 @Daniel: Thanks for bringing this Feature up and for writing such a
 detailed on the point Feature page, congrats!

 Regards,
Simon

 [1]
 http://wiki.sugarlabs.org/go/Features/Font_configuration#Consideration_for_activities
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Art Hunkins
First off: my apologies to all that I speak Linux and Sugar and all things 
related, so poorly. I'm just trying to finish off a couple of activities 
(OurMusic and OurMusicMC) so they work as I would like, and so they continue 
to work that way in the future. I also apologize to Daniel for 
misrepresenting his code. I simply assert that I have incorporated it and 
built upon it in a way that does not interfere with default font settings 
(as Daniel states is so important to do; default settings should rightly 
remain the domain of users and deployments).

As all are aware, my particular interest is in sizing displayed text to 
appropriately fill any particular screen width. Furthermore, anytime a user 
(or deployment) opts for a larger-than-default size (via the proposed UI or 
other method) displayed text is to be larger (thus activating scrollbars), 
but *if smaller-than-default* (though it's hard to imagine such a 
selection), still fills any given screen width.

My code, given in full below, does this - for XO1/1.5, SoaS Strawberry, SoaS 
Blueberry (and hopefully future incarnations of Fedora SoaS), as well as 
potential future non-Fedora SoaSes. It works fine and has been tested on 
varying systems except for XO1.5 and non-Fedora SoaSes (obviously - and I 
may be way off base here; I've assumed a similar set of font conditions to 
SoaS Blueberry).

My only concern is whether my code will still work once the proposed UI is 
implemented. I'd appreciate any and all insight to this end.

def scale_font(self, widget):
  settings = gtk.settings_get_default()
  font_name = settings.get_property(gtk-font-name)
  font_size = int(font_name[-2:])
  scale_steps = font_size - 10
  font = widget.get_pango_context().get_font_description()
  width = gtk.gdk.screen_width()
  size = width * .0008
  if os.path.exists(/etc/olpc-release) or 
os.path.exists(/sys/power/olpc-pm):
if scale_steps  -3:
  font.set_size(int(font.get_size() + 3) * pango.SCALE_LARGE * 
(scale_steps + 3) * size)
else:
  font.set_size(int(font.get_size() + 3) * size)
  elif os.path.exists(/etc/fedora-release):
if open(/etc/fedora-release).read().find(Strawberry) != -1:
  size = width * .00135
  if scale_steps  0:
font.set_size(int(font.get_size() + 3) * pango.SCALE_LARGE * 
scale_steps * size)
  else:
font.set_size(int(font.get_size() + 3) * size)
else:
  if scale_steps  0:
font.set_size(int(font.get_size() * pango.SCALE_LARGE * 
scale_steps * size))
  else:
font.set_size(int(font.get_size() * size))
  else:
if scale_steps  0:
  font.set_size(int(font.get_size() * pango.SCALE_LARGE * 
scale_steps * size))
else:
  font.set_size(int(font.get_size() * size))
  widget.modify_font(font)


Art Hunkins

- Original Message - 
From: Daniel Drake d...@laptop.org
To: Art Hunkins abhun...@uncg.edu
Cc: Simon Schampijer si...@schampijer.de; 
sugar-devel@lists.sugarlabs.org
Sent: Monday, January 11, 2010 12:40 PM
Subject: Re: [Sugar-devel] [FEATURE] Fonts-configuration


2010/1/11 Art Hunkins abhun...@uncg.edu:
 With respect to the proposed UI and low-hanging fruit:

 The font-configuring code I use in OurMusic-2 strictly adheres to Daniel's
 suggestions.

 Basicly, Daniel's suggestion would pick up the proposed UI-set font value
 from:
 settings = gtk.settings_get_default()
 font_name = settings.get_property(gtk-font-name)
 then manipulate and display individual text instances with:
 font = widget.get_pango_context().get_font_description()
 font.set_size(int(font.get_size() [and whatever])

I don't understand why you need to get the gtk-font-name property.
That is not part of my suggestion. Activities should never be
concerned with this property.

 This presumes that the UI would change the value found with the first set 
 of
 two code lines above, and have nothing to do with the second set. However,
 this latter set is based on system defaults which *remain unchanged* under
 the proposed feature. These defaults are not likely to change for other
 reasons either.

 Am I correct concerning these defaults, and should code based on the above
 continue to work on all XO and SoaS systems?

I don't understand your description or questions, sorry.  Perhaps you
could explain what you're trying to do. Eithre way, I get the feeling
that you are deviating from the guidelines I am proposing.

Daniel 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Daniel Drake
2010/1/11 Art Hunkins abhun...@uncg.edu:
 My code, given in full below, does this - for XO1/1.5, SoaS Strawberry, SoaS
 Blueberry (and hopefully future incarnations of Fedora SoaS), as well as
 potential future non-Fedora SoaSes. It works fine and has been tested on
 varying systems except for XO1.5 and non-Fedora SoaSes (obviously - and I
 may be way off base here; I've assumed a similar set of font conditions to
 SoaS Blueberry).

Your code does not adhere to my suggested guidelines, which state that
if filling a specific area is required then you should dynamically
figure out the font size using regular pango functionality. See the
Measure activity for an example.

 My only concern is whether my code will still work once the proposed UI is
 implemented. I'd appreciate any and all insight to this end.

I'd say your code is unlikely to continue working well in the future
regardless of whether this feature is implemented. I also think that
it won't even work very well at the moment, e.g. you seem to assume
that all blueberry users have identical displays.

Daniel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Art Hunkins
So, is there a way to auto-fill *all size* displays (width-wise) just by 
using regular pango functionality and querying for width of screen?

Don't you need also to query default font size to be able to do this?

Art Hunkins

- Original Message - 
From: Daniel Drake d...@laptop.org
To: Art Hunkins abhun...@uncg.edu
Cc: Simon Schampijer si...@schampijer.de; 
sugar-devel@lists.sugarlabs.org
Sent: Monday, January 11, 2010 2:17 PM
Subject: Re: [Sugar-devel] [FEATURE] Fonts-configuration


 2010/1/11 Art Hunkins abhun...@uncg.edu:
 My code, given in full below, does this - for XO1/1.5, SoaS Strawberry, 
 SoaS
 Blueberry (and hopefully future incarnations of Fedora SoaS), as well as
 potential future non-Fedora SoaSes. It works fine and has been tested on
 varying systems except for XO1.5 and non-Fedora SoaSes (obviously - and I
 may be way off base here; I've assumed a similar set of font conditions 
 to
 SoaS Blueberry).

 Your code does not adhere to my suggested guidelines, which state that
 if filling a specific area is required then you should dynamically
 figure out the font size using regular pango functionality. See the
 Measure activity for an example.

 My only concern is whether my code will still work once the proposed UI 
 is
 implemented. I'd appreciate any and all insight to this end.

 I'd say your code is unlikely to continue working well in the future
 regardless of whether this feature is implemented. I also think that
 it won't even work very well at the moment, e.g. you seem to assume
 that all blueberry users have identical displays.

 Daniel 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Art Hunkins
Simple question:

When you talk of setting the default font in Gconf, is this the font type 
and size you can retrieve with:
  settings = gtk.settings_get_default()
  font_name = settings.get_property(gtk-font-name)
?

Art Hunkins

- Original Message - 
From: Daniel Drake d...@laptop.org
To: Art Hunkins abhun...@uncg.edu
Cc: Simon Schampijer si...@schampijer.de; 
sugar-devel@lists.sugarlabs.org
Sent: Monday, January 11, 2010 2:17 PM
Subject: Re: [Sugar-devel] [FEATURE] Fonts-configuration


 2010/1/11 Art Hunkins abhun...@uncg.edu:
 My code, given in full below, does this - for XO1/1.5, SoaS Strawberry, 
 SoaS
 Blueberry (and hopefully future incarnations of Fedora SoaS), as well as
 potential future non-Fedora SoaSes. It works fine and has been tested on
 varying systems except for XO1.5 and non-Fedora SoaSes (obviously - and I
 may be way off base here; I've assumed a similar set of font conditions 
 to
 SoaS Blueberry).

 Your code does not adhere to my suggested guidelines, which state that
 if filling a specific area is required then you should dynamically
 figure out the font size using regular pango functionality. See the
 Measure activity for an example.

 My only concern is whether my code will still work once the proposed UI 
 is
 implemented. I'd appreciate any and all insight to this end.

 I'd say your code is unlikely to continue working well in the future
 regardless of whether this feature is implemented. I also think that
 it won't even work very well at the moment, e.g. you seem to assume
 that all blueberry users have identical displays.

 Daniel 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Art Hunkins
Simple question #2 (of 2):

Is the font size setting found via:

font = widget.get_pango_context().get_font_description()

determined by the Gconf setting (that the new UI will allow the user to 
vary), or is it independent and set (preset)  in some other way?

Art Hunkins

- Original Message - 
From: Daniel Drake d...@laptop.org
To: Art Hunkins abhun...@uncg.edu
Cc: Simon Schampijer si...@schampijer.de; 
sugar-devel@lists.sugarlabs.org
Sent: Monday, January 11, 2010 2:17 PM
Subject: Re: [Sugar-devel] [FEATURE] Fonts-configuration


 2010/1/11 Art Hunkins abhun...@uncg.edu:
 My code, given in full below, does this - for XO1/1.5, SoaS Strawberry, 
 SoaS
 Blueberry (and hopefully future incarnations of Fedora SoaS), as well as
 potential future non-Fedora SoaSes. It works fine and has been tested on
 varying systems except for XO1.5 and non-Fedora SoaSes (obviously - and I
 may be way off base here; I've assumed a similar set of font conditions 
 to
 SoaS Blueberry).

 Your code does not adhere to my suggested guidelines, which state that
 if filling a specific area is required then you should dynamically
 figure out the font size using regular pango functionality. See the
 Measure activity for an example.

 My only concern is whether my code will still work once the proposed UI 
 is
 implemented. I'd appreciate any and all insight to this end.

 I'd say your code is unlikely to continue working well in the future
 regardless of whether this feature is implemented. I also think that
 it won't even work very well at the moment, e.g. you seem to assume
 that all blueberry users have identical displays.

 Daniel 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [FEATURE] Fonts-configuration

2010-01-11 Thread Daniel Drake
2010/1/11 Art Hunkins abhun...@uncg.edu:
 So, is there a way to auto-fill *all size* displays (width-wise) just by
 using regular pango functionality and querying for width of screen?

Yes. The Memorize activity does almost exactly this -- it renders text
to fill a specific tile rather than the whole screen, but the process
is the same.

 Don't you need also to query default font size to be able to do this?

No.

Daniel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel