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

Ishan Bansal ishan at seeta.in
Sat Sep 25 16:19:48 EDT 2010


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



More information about the Sugar-devel mailing list