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

James Cameron quozl at laptop.org
Wed Sep 22 00:15:22 EDT 2010


On Wed, Sep 22, 2010 at 09:10:21AM +0530, Kandarp Kaushik wrote:
> This patch scales the font in TA by using ZOOM_FACTOR
> set in sugar.graphics.style (SL#1858)

But the font size is set by the gconf float
/desktop/sugar/font/default_size ... available as
sugar.graphics.style.FONT_SIZE

Using ZOOM_FACTOR is too general, based on SUGAR_SCALING, and so Turtle
Art won't scale fonts in proportion to the font-size setting.

> @@ -125,16 +126,16 @@ class TurtleArtWindow():
>          self.orientation = HORIZONTAL_PALETTE
>          if olpc_xo_1():
>              self.lead = 1.0
> -            self.scale = 0.67
> +            self.scale = 0.67 * ZOOM_FACTOR
>              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 * ZOOM_FACTOR
>              self.color_mode = '888' # TODO: Read visual mode from gtk image
>  
> -        self.block_scale = BLOCK_SCALE
> +        self.block_scale = BLOCK_SCALE * ZOOM_FACTOR
>          self.trash_scale = 0.5
>          self.myblock = None
>          self.nop = 'nop'
> @@ -2035,7 +2036,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 * ZOOM_FACTOR
>          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:

But it seems here you are not scaling the fonts, but rather block sizes.
I'm confused.

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list