Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolpc <olpc@xo-05-25-69.localdomain>2010-02-21 22:07:46 (GMT)
committer olpc <olpc@xo-05-25-69.localdomain>2010-02-21 22:07:46 (GMT)
commitab4aae9b3d8d9f9dbdb97b4114179559d50735b8 (patch)
tree50e1a74d2395789b84c12704bf95b751e3332c3a
parent62cfb4a105505f435b4fb3b7e3e936d289cebd90 (diff)
Fine-tune default font displays through XO-1.5 and SoaS Blueberry
-rw-r--r--csndsugui.py21
-rw-r--r--ourmusic.py5
2 files changed, 22 insertions, 4 deletions
diff --git a/csndsugui.py b/csndsugui.py
index d7c72f5..d97e279 100644
--- a/csndsugui.py
+++ b/csndsugui.py
@@ -47,11 +47,23 @@ class BasicGUI:
def scale_font(self, widget):
font = widget.get_pango_context().get_font_description()
- font_size = font.get_size()
+
+# The FONT DISPLAY in this activity can be resized (smaller or larger)
+# by changing the value of "resize" below. "Resize" can be positive
+# or negative, and is not limited to integers. A value of 1 equals a
+# point in font size.
+ resize = 0
+
+ font_size = font.get_size() + (resize * 1024)
width = gtk.gdk.screen_width()
- mult = width * .0008
- if os.path.exists("/etc/fedora-release") and open("/etc/fedora-release").read().find("Strawberry")!= -1:
- mult = width * .0013
+ mult = width * .00076
+ if os.path.exists("/etc/olpc-release") or os.path.exists("/etc/power/olpc-pm"):
+ mult = width * .00082
+ elif os.path.exists("/etc/fedora-release"):
+ if open("/etc/fedora-release").read().find("Strawberry") != -1:
+ mult = width * .00132
+ elif open("/etc/fedora-release").read().find("Blueberry") != -1:
+ mult = width * .00085
font.set_size(int(font_size * mult))
widget.modify_font(font)
@@ -795,3 +807,4 @@ class CsoundGUI(BasicGUI):
self.arglist = None
self.replay = False
self.stopcb = True
+
diff --git a/ourmusic.py b/ourmusic.py
index 2fdaf1d..13d3e64 100644
--- a/ourmusic.py
+++ b/ourmusic.py
@@ -47,6 +47,10 @@
# Extreme power management (under Power) or Wireless radio (under
# Network). Stereo headphones (an inexpensive set will work fine) or
# external amplifier/speaker system are highly recommended.
+#
+# The font display of this activity can be resized in csndsugui.py,
+# using any text editor. Further instructions are found toward the
+# beginning of csndsugui.py.
import csndsugui
from sugar.activity import activity
@@ -137,6 +141,7 @@ zero controls before start. \
but4 = win.cbbutton(nbox, self.version4, "4 OurMusicASCII")
but4.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0x7700, 0))
but4.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(0, 0x7700, 0))
+ win.text(" <b>MIDI DEVICE REQUIRED</b> for 1 &amp; 3", nbox, brown)
bbox = win.box(False, all)
self.bb = bbox
self.w = win