I guess, there might be some differences in the default system fonts
between XP and 7,
You may try to experiment with SetFont(...) on the respective widgets.
However, I can display these characters instantly without messing with
fonts - Win7 -64, Home Premium (Czech), py2.7, 2.8.11.0 (unicode).
Maybe the fonts also differ between language versions?
vbr
--
Max Landaeus, are you sure that you are using the Unicode version of wxPython?
On Fri, Oct 15, 2010 at 9:16 AM, Max Landaeus <m...@landaeus.com> wrote:
>
>
> On 15/10/2010 9:53 PM, Boštjan Mejak wrote:
>
> Max Landaeus, are you sure that you are using the Unicode version of
> wxPython?
>
> Yes, I'm running 2.8.11.0 (msw-unicode). The characters displays correctly
> on my systems with XP and Vista, it's only the one with Win7-x64 that
> doesn't work.
> Max
>
Could you please make a small runnable sample application that
reproduces the issue?
I remember running into this when I upgraded to windows 7 but for the
life of me can't remember what the fix was at the moment.
Cody
I've run into similar issues before on XP. If I remember correctly on
XP it has something to do with what language support or international
locales are installed, or something like that. Perhaps that triggered
the installation of a different set of fonts that have a more complete
set of glyphs. Win7 might be similar.
--
Robin Dunn
Software Craftsman
http://wxPython.org
And yet, apparently a default GUI font that isn't complete.
> Unicode is
> everywhere. By ignoring,it, you are merely ensuring that all your
> software works only in America.
I don't think anyone was suggesting ignoring Unicode altogether, but in
this particular instance -- it's a good idea to use the default system
font for labeling buttons, etc, and apparently MS is delivering systems
with default fonts that aren't complete (I don't know how rare is it to
use the arrow symbols) -- so sticking with ANSI is a fail safe.
Personally, I'd probably use bitmap buttons in that case, anyway.
> MS Sans Serif (the
> default dialog font) has never contained those characters,
Exactly my point -- despite being Unicode since 1992 -- they still don't
ship a complete version of the font used for dialogs. Sigh.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
....
The characters displayed correctly when I started up my Win7 system this morning! There has been a reboot in between - could it be that some other application has changed the system font earlier? I guess I have to watch out.
Anyway, attached is a runnable sample. To keep the code short I removed all functionality, but I left the widget intact with all the controls. The buttons with the Unicode characters starts around line 64.
But since this sample (as well as my full application) now displays correctly on my Win7 system I can not guarantee that this actually reproduces the error. Anyway, it would be interesting to see if anybody else has problems displaying the Unicode-arrows.
...
The characters displayed correctly when I started up my Win7 system this morning! There has been a reboot in between - could it be that some other application has changed the system font earlier? I guess I have to watch out.
Anyway, attached is a runnable sample. To keep the code short I removed all functionality, but I left the widget intact with all the controls. The buttons with the Unicode characters starts around line 64.
But since this sample (as well as my full application) now displays correctly on my Win7 system I can not guarantee that this actually reproduces the error. Anyway, it would be interesting to see if anybody else has problems displaying the Unicode-arrows.
--------------------------------------------------
From: "Tim Roberts" <ti...@probo.com>
Sent: Friday, October 15, 2010 6:57 PM
To: "wxPython-users" <wxpytho...@googlegroups.com>
Subject: [wxPython-users] Re: Problem with unicode characters in buttons on
Win7
> Steve wrote:
>>
>> Personally I would say that until unicode becomes as prevalent as ANSI
>> you would be better off avoiding using it,
>
> That's terrible advice. Exactly how long would you expect to wait?
> Windows has had Unicode as its default character set since 1992.
> That's a hell of a long time in computer terms. Unicode is
> everywhere. By ignoring,it, you are merely ensuring that all your
> software works only in America.
>
Personally I would say that unless you are willing to specify fonts, (and
possibly ship them), that include the unicode characters that you need then
I would avoid unicode unless I need it - i.e. if I am aiming for an
international application then I would take the extra steps but not just for
a dialog button when there are several alternatives available. I will start
using unicode for everything when either all available fonts are complete,
not likely to happen any time soon, or my target platforms all have a font
manager that has one complete font available that I can either specify or
that will automatically be substituted for any missing characters, this is
the thing that has really been missing IMHO.
> The original poster's problem is simply in assuming that the default
> font always contains the characters he needs. MS Sans Serif (the
> default dialog font) has never contained those characters, but he
> should easily be able to choose one that does. Arial would do it, and
> is universally available.
>
> I, too, would like to see a small runnable sample.
> --
> Tim Roberts, ti...@probo.com
> Providenza & Boekelheide, Inc.
>
Providenza & Boekelheide, Inc.
No, not quite. All that declaration does is tell the interpreter (and
some code editors) to treat string literals in the code as if they are
encoded with the named codec. Then it will know how to convert the
literal to unicode if needed at runtime. In other words, it lets you
have non-ascii string or unicode literals in your source code. For
example you can accomplish the same thing without the codec declaration
by using something like this, because you are telling the interpreter
exactly how to make the literal without needing to embed non-ascii
characters in your source file.:
label=u'\u2190'
Whether you can actually display those unicode values at runtime in the
UI is a totally separate matter.
label=u'\u2190'
Whether you can actually display those unicode values at runtime in the UI is a totally separate matter.
--
label=u'\u2190'Whether you can actually display those unicode values at runtime in the UI is a totally separate matter.
This is my point. Maybe his interpreter is having hard time encoding those raw unicode codes into actual arrows. He should have put the arrow characters in the string literal for the characters to be correctly displayed on the button widget. Like this: label=u'←' label=u'⇄' and label=u'→'