Opened 11 years ago

Closed 10 years ago

#3436 closed defect (fixed)

Fototoon: font size is wrong in xo

Reported by: godiard Owned by: humitos
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: FotoToon Version: Unspecified
Severity: Unspecified Keywords: 12.2.0, patch
Cc: humitos, godiard Distribution/OS: Unspecified
Bug Status: Unconfirmed


The font size in the xo is not consistent with the font size in other activities, like Paint or Write. Probably need calculate the size according to dpi.

If we change it, need check we not break files created with older Fototoon versions, then we should try recalculate the old values. The file format have a version, we need check the version and recalculate if needed.

Attachments (2)

0001-Use-pango-to-handle-fonts-SL-3436.patch (15.9 KB) - added by humitos 11 years ago.
Patch to manage fonts with pango
0001-Use-pango-to-handle-fonts-SL-3436.2.patch (16.1 KB) - added by humitos 10 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by godiard

  • Keywords 12.1.0 added

comment:2 Changed 11 years ago by humitos

  • Cc humitos added

comment:4 Changed 11 years ago by humitos

I tried changing the resolution in the pangocairo.CairoFontMap but it didn't work:

import pangocairo
font_map_default = pangocairo.cairo_font_map_get_default()

comment:5 Changed 11 years ago by humitos

  • Owner changed from godiard to humitos
  • Status changed from new to accepted

Changed 11 years ago by humitos

Patch to manage fonts with pango

comment:6 Changed 11 years ago by humitos

  • Keywords patch added

I've just uploaded a patch that change the way that fonts are managed. This is because "cairo fonts are not designed to be used in production" and besides we need to set the DPI font depending on the screen that the activity is running.

For example, in my Desktop PC a value of 95 DPI is used and in the XO a value of 200 DPI is used. Those values are taken from gtk.settings_get_default().get_property('gtk-xft-dpi') but there is a problem with this: a value of 200 is too big for the XO display so the font is shown too big. This value should be near to 170 / 175 (I got this value comparing the 12 points font size in Write activity with the 12 points font size in FotoToon activity)

On the other hand, there are some regression issues with this patch. They are mentioned on the commit message as well:

  • 'Up' and 'Down' keys do not work to move between text lines
  • The user's cursor is not shown when a globe text is being edited
  • The ability to expand just vertically the globe doesn't work

So, I'm not sure what I should do with this patch (apply or not until the regression issues were fixed) and how to solve the DPI issue.

comment:7 Changed 11 years ago by godiard

  • Keywords 12.2.0 added; 12.1.0 removed

The change needed is bigger than what we can do for 12.1.0

Moved to 12.2.0.

comment:8 Changed 10 years ago by humitos

Well, the "magic number" here is 133 for the DPI.

I got this number after a talk with Martin Langhoff while I was porting Typing Turtle and it's related with the XO's Display

comment:9 Changed 10 years ago by humitos

  • Cc godiard added

This new patch solves the issue related with the DPI fonts on the XO

comment:10 Changed 10 years ago by godiard

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in Fototoon 14

Note: See TracTickets for help on using tickets.