[Sugar-devel] More information on font scaling problem

Tomeu Vizoso tomeu at sugarlabs.org
Fri Jun 5 11:30:13 EDT 2009


On Fri, Jun 5, 2009 at 17:11, James Simmons<jim.simmons at walgreens.com> wrote:
> Tomeu,
>
> The thing is, in the code below I *am* using style.zoom.  It seems to have
> no effect at all.

What I would have supposed that would work is using in 0.84 a fixed
font size of 10 and on the XO style.zoom(X). I didn't wanted to imply
that X could be 10, I think we were using a smaller font size in the
Sugar UI.

Maybe Aleksey could add a zoom() function to sugar.port that on 0.82
would do some scaling based on the screen resolution and on 0.84 would
return the value unchanged?

Regards,

Tomeu

> My test environment on Fedora 10 is .82.  My XO, running the latest (I
> believe) release candidate of Sugar is .82.  Most of the XO's that might use
> Read Etexts will be running .82 or worse and will not be eager to upgrade.
> For that reason I'm trying to make my Activity work around the limitations
> of older versions of Sugar.  As an example, .82 still has the bug that
> custom metadata is not saved across reboots.  I was using a custom metadata
> field to store the page number that the user stopped reading on.  In my
> latest this page number is saved at the end of the Title of the Journal
> entry, like this:
>
> Off on a Comet! by Jules Verne P64
>
> Aleksey and I also put in code that suppresses the Speech tab when neither
> speech-dispatcher nor the gstreamer plugin for espeak is installed.
>
> James Simmons
>
>
> Tomeu Vizoso wrote:
>
> On Wed, Jun 3, 2009 at 16:40, James Simmons<jim.simmons at walgreens.com>
> wrote:
>
>
> I mentioned before that I'm having a font sizing problem on the XO
> running .82.  When I set a font on a textviewer it looks OK running
> under sugar-devel or SoaS by is *much* larger on the XO.
>
>
> Sorry, in an earlier email i replied to you what would work in 0.84,
> didn't realized you were talking about 0.82.
>
> In 0.84 Pango knows the resolution of the screen and scales all fonts
> accordingly. This means that by using, say 10, the font will always
> look good in all hw.
>
> In 0.82 didn't knew about the screen, so we were scaling all fonts by
> using style.zoom().
>
> Aleksey, do you have an idea about what can do activity authors that
> wish to provide a single bundle that looks good both in 0.82 and 0.84?
>
> Thanks,
>
> Tomeu
>
>
>
> This is the
> code I'm currently using:
>
> self.scrolled = gtk.ScrolledWindow()
> self.scrolled.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
> self.scrolled.props.shadow_type = gtk.SHADOW_NONE
> self.textview = gtk.TextView()
> self.textview.set_editable(False)
> self.textview.set_cursor_visible(False)
> self.textview.set_left_margin(50)
> self.textview.connect("key_press_event", self.keypress_cb)
> buffer = self.textview.get_buffer()
> buffer.connect("mark-set", self.mark_set_cb)
> self.font_desc = pango.FontDescription("sans %d" % style.zoom(10))
> self.textview.modify_font(self.font_desc)
> self.scrolled.add(self.textview)
> self.textview.show()
> self.scrolled.show()
> v_adjustment = self.scrolled.get_vadjustment()
> self.clipboard = gtk.Clipboard(display=gtk.gdk.display_get_default(),
> selection="CLIPBOARD")
> self.page = 0
> self.textview.grab_focus()
>
> The "sans 10" font is really too small for SoaS but on the XO it makes
> 80 columns of text fill the width of the screen.  Any ideas?
>
> James Simmons
>
>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
>


More information about the Sugar-devel mailing list