[Sugar-devel] [PATCH] Scale TA font proportional to Sugar font-settings. (SL#1858)

Walter Bender walter.bender at gmail.com
Wed Oct 20 17:49:05 EDT 2010


On Wed, Oct 20, 2010 at 7:17 PM, Ishan Bansal <ishan at seeta.in> wrote:
> hi
>
> i had submitted a patch for the ticket #1858.
>
> Wish if you can review the patch and provide me suggestions on any changes
> required.

The issue as I recall is that your patch does not get the system font
scale from gconf.

regards.

-walter
>
> regards
>
> ishan
>
> ---------- Forwarded message ----------
> From: Ishan Bansal <ishan at seeta.in>
> Date: Sun, Sep 26, 2010 at 1:49 AM
> Subject: [PATCH] Scale TA font proportional to Sugar font-settings.
> (SL#1858)
> To: sugar-devel at lists.sugarlabs.org
>
>
> This patch scales the font in TA by using function zoom set in
> sugar.graphics.style (SL#1858)
> ---
>  TurtleArt/tawindow.py |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
> index ac16d9c..696a1bd 100644
> --- a/TurtleArt/tawindow.py
> +++ b/TurtleArt/tawindow.py
> @@ -35,6 +35,7 @@ try:
>     from sugar.graphics.objectchooser import ObjectChooser
>     from sugar.datastore import datastore
>     from sugar import profile
> +    from sugar.graphics import style
>  except ImportError:
>     pass
>
> @@ -127,17 +128,17 @@ class TurtleArtWindow():
>         self.orientation = HORIZONTAL_PALETTE
>         if olpc_xo_1():
>             self.lead = 1.0
> -            self.scale = 0.67
> +            self.scale = 0.67 * style.zoom(1)
>             self.color_mode = '565'
>             if self.running_sugar and not self.activity.new_sugar_system:
>                 self.orientation = VERTICAL_PALETTE
>         else:
>             self.lead = 1.0
> -            self.scale = 1.0
> +            self.scale = 1.0 * style.zoom(1)
>             self.color_mode = '888' # TODO: Read visual mode from gtk image
>
>         self.block_scale = BLOCK_SCALE
> -        self.trash_scale = 0.5
> +        self.trash_scale = 0.5 * style.zoom(1)
>         self.myblock = None
>         self.nop = 'nop'
>         self.loaded = 0
> @@ -2156,7 +2157,7 @@ class TurtleArtWindow():
>             blk.spr.set_label(blk.values[0].replace('\n', RETURN))
>         elif btype == 'start': # block size is saved in start block
>             if value is not None:
> -                self.block_scale = value
> +                self.block_scale = value * style.zoom(1)
>         elif btype in EXPANDABLE or btype in EXPANDABLE_BLOCKS or \
>              btype in EXPANDABLE_ARGS or btype == 'nop':
>             if btype == 'vspace' or btype in EXPANDABLE_BLOCKS:
> --
> 1.7.0.4
>
>
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list