UnicodeDecodeError when using Chinese font name for clock or date

Bug #1346131 reported by kaiman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Variety
Fix Released
High
Peter Levi

Bug Description

ERROR: 2014-07-21 17:32:07,879: apply_clock() 'Could not apply clock:'
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/variety/variety/VarietyWindow.py", line 1152, in apply_clock
    cmd = self.build_imagemagick_clock_cmd(to_set, target_file)
  File "/opt/extras.ubuntu.com/variety/variety/VarietyWindow.py", line 1068, in build_imagemagick_clock_cmd
    clock_filter = self.replace_clock_filter_fonts(clock_filter)
  File "/opt/extras.ubuntu.com/variety/variety/VarietyWindow.py", line 1080, in replace_clock_filter_fonts
    date_font_name, date_font_size = Util.gtk_to_fcmatch_font(self.options.clock_date_font)
  File "/opt/extras.ubuntu.com/variety/variety/Util.py", line 356, in gtk_to_fcmatch_font
    rest = gtk_font_name.replace(family, '').strip().replace(' ', ':')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)

variey.conf
# Clock settings
# clock_enabled = <True or False>
# clock_font = <FontName Size>, default is "Ubuntu Condensed, 70"
# clock_date_font = <FontName Size>, default is "Ubuntu Condensed, 30"
clock_enabled = True
clock_font = Sawasdee 70
clock_date_font = 幼圆 30

Related branches

Revision history for this message
Peter Levi (peterlevi) wrote :

Attach here that font please (the ttf file, from under /usr/share/fonts/truetype or ~/.local/fonts). Thanks.

summary: - set chinese font name fail show clock
+ UnicodeDecodeError when using Chinese font name for clock or date
Changed in variety:
importance: Undecided → High
assignee: nobody → Peter Levi (peterlevi)
Revision history for this message
kaiman (kaigfm) wrote :

Variety 0.4.18 show chinese clock is ok with the font.

Peter Levi (peterlevi)
Changed in variety:
status: New → Fix Committed
Peter Levi (peterlevi)
Changed in variety:
milestone: none → 0.5.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.