[Sugar-devel] [PATCH] Scale TA font proportional to Sugar font-settings. (SL#1858)
Walter Bender
walter.bender at gmail.com
Wed Sep 22 04:21:48 EDT 2010
On Wed, Sep 22, 2010 at 12:15 AM, James Cameron <quozl at laptop.org> wrote:
> 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.
He is scaling the fonts and the block sizes. The original ticket was
about using the gconf setting. It could be interesting to scale the
blocks initially based on the zoom as well. So perhaps the patch
should do both, but get the font zoom from gconf as you suggest.
-walter
> --
> James Cameron
> http://quozl.linux.org.au/
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
--
Walter Bender
Sugar Labs
http://www.sugarlabs.org
More information about the Sugar-devel
mailing list