Opened 16 years ago

Closed 16 years ago

#291 closed defect (fixed)

font settings not saved

Reported by: msieczka Owned by: martinl
Priority: major Milestone: 6.4.0
Component: wxGUI Version: svn-develbranch6
Keywords: Cc: grass-dev@…
CPU: All Platform: All

Description

  1. enter Preferences > Display > Set font
  1. choose e.g. Arial
  1. Save
  1. quit and restart wxGUI
  1. use e.g. scalebar - your font setting was not saved as you see

Also, I don't how to change encoding in Preferences > Display > Set font. Anything I enter instead of the default "ISO-8859-1" is discarded next time I enter the dialog.

Change History (6)

comment:1 by martinl, 16 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned
Version: unspecifiedsvn-develbranch6

Fixed in r33299.

in reply to:  description ; comment:2 by glynn, 16 years ago

Replying to msieczka:

Also, I don't how to change encoding in Preferences > Display > Set font. Anything I enter instead of the default "ISO-8859-1" is discarded next time I enter the dialog.

The font encoding needs to be set to whatever Python uses when passing strings to the OS. This will probably be the locale's encoding unless it explicitly uses something else. Also, the encoding only affects FreeType fonts; stroke fonts are essentially ASCII.

in reply to:  2 ; comment:3 by msieczka, 16 years ago

Replying to glynn:

The font encoding needs to be set to whatever Python uses when passing strings to the OS. This will probably be the locale's encoding unless it explicitly uses something else.

On my system encoding is pl_PL.UTF-8. Should I set the encoding in Preferences > Display > Set font be set to that, instead of ISO-8859-1?

in reply to:  3 ; comment:4 by glynn, 16 years ago

Replying to msieczka:

On my system encoding is pl_PL.UTF-8.

"pl_PL.UTF-8" is the locale; the encoding is just "UTF-8".

Should I set the encoding in Preferences > Display > Set font be set to that, instead of ISO-8859-1?

Probably. Try using some non-ASCII characters in e.g. d.text text="..." and see what works.

If you have a Unicode version of wxWidgets, it's likely to use Unicode internally (e.g. for anything you type into a text field). That will get converted to a byte string (either by wxWidgets or by Python) by the time that it's passed to d.text, and it will probably use the locale's encoding to perform the conversion.

in reply to:  4 comment:5 by msieczka, 16 years ago

Replying to glynn:

Replying to msieczka:

On my system encoding is pl_PL.UTF-8.

"pl_PL.UTF-8" is the locale; the encoding is just "UTF-8".

Should I set the encoding in Preferences > Display > Set font be set to that, instead of ISO-8859-1?

Probably. Try using some non-ASCII characters in e.g. d.text text="..." and see what works.

If you have a Unicode version of wxWidgets, it's likely to use Unicode internally (e.g. for anything you type into a text field). That will get converted to a byte string (either by wxWidgets or by Python) by the time that it's passed to d.text, and it will probably use the locale's encoding to perform the conversion.

Whatever encoding I specify, e.g. ISO-8859-1 or UTF-8, Polish non-ASCII chars are always rendered correct. I'm not sure if this is normal - when I specify ISO-8859-1 I'd expect those chars to be rendered wrong.

As for the original bug report, it is fixed. Remaining issues:

  1. The text overlay dialog is missing a show/hide checkbox.
  1. If multiple labels are added, dragging them with a *right* mouse key does some strange swapping.

comment:6 by cmbarton, 16 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r35121 (develbranch_6), r35122 (release branch 6.4), and r35123 (trunk)

Note: See TracTickets for help on using tickets.