<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>FWIW, this is the "font-sizing code" I ended up
using in my three activities (OurMusic, SunMoonMusic and FileMix). It
is contained near the beginning of the csndsugui.py module.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>It contains an option for the user to resize text
in the given activity for the particular monitor, and sizes for
OLPC (XO-1/XO-1.5), SoaS 0.84 and up. Thank goodness, from Mirabelle upward,
SoaS seems not to be changing font size.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>All multiplication factors were determined
empirically - by filling a screen width with text (the starting point was the
OLPC display), then seeing what modifications were necessary for the various
incarnations of SoaS.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The code works well for all versions of Sugar I've
tried, as well as monitors.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> def scale_font(self,
widget):<BR> font =
widget.get_pango_context().get_font_description()</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial># The FONT DISPLAY in this activity can be resized
(smaller or larger)<BR># by changing the value of "resize" below. "Resize" can
be positive<BR># or negative, and is not limited to integers. A value of 1
equals a<BR># point in font size.<BR> resize =
0</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> font_size =
font.get_size() + (resize * 1024)<BR> width =
gtk.gdk.screen_width()<BR> mult = width *
.00076<BR> if os.path.exists("/etc/olpc-release")
or
os.path.exists("/etc/power/olpc-pm"):<BR>
mult = width * .00082<BR> elif
os.path.exists("/etc/fedora-release"):<BR>
release =
open("/etc/fedora-release").read()<BR>
if release.find("SoaS release 1 ") !=
-1:<BR> mult = width *
.00132<BR> elif release.find("SoaS
release 2 ") != -1:<BR>
mult = width * .00085<BR> elif
release.find("Fedora release ") !=
-1:<BR> mult = width *
.00119<BR> font.set_size(int(font_size *
mult))<BR> widget.modify_font(font)</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Art Hunkins</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=gonzalo@laptop.org href="mailto:gonzalo@laptop.org">Gonzalo
Odiard</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=sugar-devel@lists.sugarlabs.org
href="mailto:sugar-devel@lists.sugarlabs.org">sugar-devel</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, December 04, 2010 11:48
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Sugar-devel] UI: Advice
about UI changes in Write</DIV>
<DIV><FONT size=2 face=Arial></FONT><FONT size=2 face=Arial></FONT><FONT
size=2 face=Arial></FONT><BR></DIV>Sascha<BR>I understand your comments, but I
think we need to prioritize the simple use of the more useful features.<BR>A
spinbutton is not IMHO a good interface to change the zoom level, but I am not
sure, that's the reason <BR>why I asked to the UI team. Another option is add
a button to set the zoom at Page width, or Page height, <BR>but probably
another hacker will complain about too much
controls...<BR><BR>Gonzalo<BR><BR> <BR><BR>
<DIV class=gmail_quote>On Sat, Dec 4, 2010 at 7:18 AM, Sascha Silbe <SPAN
dir=ltr><<A
href="mailto:sascha-ml-reply-to-2010-3@silbe.org">sascha-ml-reply-to-2010-3@silbe.org</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Excerpts from Gonzalo Odiard's message of Fri Dec 03
14:00:58 +0100 2010:<BR>
<DIV class=im><BR>> You can increment/decrement the zoom with Ctrl
+ / - to any level.<BR><BR></DIV>Is that discoverable? What are the
increments (step size)? How fast is<BR>it?<BR><BR>It usually takes me only
very few tries to choose the correct zoom level<BR>by entering a number
(good first guess + something similar to binary<BR>search). If I can only
single-step (in addition to the few fixed zoom<BR>levels), it'll either be a
bad match (too large increment) or take a lot<BR>of key presses / time (fine
increment => many steps).<BR>
<DIV>
<DIV></DIV>
<DIV class=h5><BR>Sascha<BR><BR>--<BR><A href="http://sascha.silbe.org/"
target=_blank>http://sascha.silbe.org/</A><BR><A
href="http://www.infra-silbe.de/"
target=_blank>http://www.infra-silbe.de/</A><BR></DIV></DIV><BR>_______________________________________________<BR>Sugar-devel
mailing list<BR><A
href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</A><BR><A
href="http://lists.sugarlabs.org/listinfo/sugar-devel"
target=_blank>http://lists.sugarlabs.org/listinfo/sugar-devel</A><BR><BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Sugar-devel mailing
list<BR>Sugar-devel@lists.sugarlabs.org<BR>http://lists.sugarlabs.org/listinfo/sugar-devel<BR></BLOCKQUOTE></BODY></HTML>