Hi,
I am trying to show the various braille patterns on display using the unicode range from U+2800 to U+28FF.
I am using a rich edit , but when I change font, on the screen the dots do not appear at all.
If I set as encoding utf8 I get a warning that does not exists such fonts and if I set default the warning is not shown but the result is bad.
I use a correct unicode font. In others application it works fine.
Can somebody help me?
Gianluca
Gianluca Casalino wrote:
I am trying to show the various braille patterns on display using the
unicode range from U+2800 to U+28FF.
I am using a rich edit , but when I change font, on the screen the dots
do not appear at all.
If I set as encoding utf8 I get a warning that does not exists such
fonts and if I set default the warning is not shown but the result is bad.
I use a correct unicode font. In others application it works fine.
I'm not quite sure I understand your sequence of events. If you change
the font to one that does not include those glyphs, then you'll get the
"not found" glyphs instead.
Can you set up and post a short sample that demonstrates this so we can
try it?
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Ok.
I declare:
class mainEditor(wx.TextCtrl):
def __init__(self, parent, id, size, style):
super(mainEditor, self).__init__(parent,id=id, size=size,style=style)
# self.Bind(wx.EVT_KEY_UP, self.OnKeyDown)
In the frame class I instanziate:
self.editor = mainEditor(self, -1, size = wx.Size(800, 525), style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
# lbFi
When I need to show the font braille I use this code:
def loadFile(self, file):
result=tasks.loadFile(file)
font=wx.Font(12,wx.MODERN,wx.NORMAL,wx.FONTWEIGHT_NORMAL, False, face="currer new", encoding=wx.FONTENCODING_ISO8859_1)
if globalVars.fileShowed == globalVars.FILE_EXT['FILE_PRINT'][1]:
# wx.MessageBox("bra file")
font=wx.Font(24,wx.FONTFAMILY_DEFAULT,wx.NORMAL,wx.FONTWEIGHT_NORMAL,False, face="Braille", encoding= wx.FONTENCODING_DEFAULT)
self.panel.editor.SetFont(font)
if I use wx.FONTENCODING_UTF8 an error occurs.
The unicode set dedicated to braille signs is from 0x2800 to 0x28ff.
Arial Unicode ms should perform the right symbols.
Regards
Gianluca
Hello,
you do not show us:
if you live on Windows
if you use the unicode build of wxPython and which version
if you can see the braille character for your font on windows/accessories/System Tools/Character map (assuming you are using windows)
if you are really sure that Python “understood” that you confront it with unicode code points (just feeding UTF-8 as byte string is not enough)
I found out at Windows 7 that only Segoe UI Symbol contains braille symbols, but Windows seems to “inject” the symbols also into fonts which do not contain them (in contrast to another used unicode symbol)
Therefore I used your code, made a self-contained example of it and pasted it onto
Forget the part for freezing, it is posted for completeness
It works on
Windows 7/Python 2.7/wxPython 2.8.12.1 and 2.9.4.0
Sorry.
I am using
python 2.7 wxpython 2.8 unicode and windows xp.
Windows side is all ok.
In other editor
/word processor the font works correctly.
If I declare wx.FONTENCODING_UTF
( I get this warning:""no font for displaying text in encodinc 'unicode 8 bits' 'utf
8"would you select a font to display the text in this encoding?"
If I answer
yes and select the right font, the text is bad displayed again.
Gianluca' found.Il 28/11/2013 14.23, nepix32 ha scritto:
···
Hello,
you do not show us:
if you live on Windows
if you use the unicode build of wxPython and which version
if you can see the braille character for your font on windows/accessories/System Tools/Character map (assuming you are using windows)
if you are really sure that Python "understood" that you confront it with unicode code points (just feeding UTF-8 as byte string is not enough)
I found out at Windows 7 that only Segoe UI Symbol contains braille symbols, but Windows seems to "inject" the symbols also into fonts which do not contain them (in contrast to another used unicode symbol)
Therefore I used your code, made a self-contained example of it and pasted it onto
Usage unicode for wxPython - Pastebin.com
Forget the part for freezing, it is posted for completeness
It works on
Windows 7/Python 2.7/wxPython 2.8.12.1 and 2.9.4.0
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Have you tried the example I have posted on pastebin (it should work also on WinXP)? The only thing a ‘normal’ WinXP is missing to make the example work is probably a proper font with braille characters on the proper unicode code points. So when you replace 'Segoe UI Symbol" in the onclick method by your braille font name, what happens then?
If you use the unicode build of wxpython, all you have to do is to convert your input to unicode! Be aware that python unicode (u’someunicodetext’) is NOT UTF-8! It took me a while to understand the difference between the two. I have not tested if wxPython (!) accepts UTF-8 encoded string, I always have used Unicode character strings to use Umlauts and Unicode characters.
If I declare wx.FONTENCODING_UTF
( I get this warning:"“no font for displaying text in encodinc ‘unicode 8 bits’ 'utf
8"would you select a font to display the text in this encoding?”
If I answer
yes and select the right font, the text is bad displayed again.
I cannot make any sense from this, what is producing the error message and where are you “answering yes and select the right font”? Python?
OK, but you are not asking for Arial Unicode here. You are asking for a font called “Braille” (or “currier new” — did you actually mean “Courier New”?).
For Arial Unicode, I don’t think you want FONTENCODING_UTF8. I think you want FONTENCODING_UNICODE.
···
On Nov 28, 2013, at 1:00 AM, Gianluca Casalino <gilucasa@gmail.com> wrote:
When I need to show the font braille I use this code:
def loadFile(self, file):
result=tasks.loadFile(file)
font=wx.Font(12,wx.MODERN,wx.NORMAL,wx.FONTWEIGHT_NORMAL,
False, face="currer new", encoding=wx.FONTENCODING_ISO8859_1)
if globalVars.fileShowed == globalVars.FILE_EXT['FILE_PRINT'][1]:
# wx.MessageBox("bra file")
font=wx.Font(24,wx.FONTFAMILY_DEFAULT,wx.NORMAL,wx.FONTWEIGHT_NORMAL,False,
face="Braille", encoding= wx.FONTENCODING_DEFAULT)
self.panel.editor.SetFont(font)if I use wx.FONTENCODING_UTF8 an error occurs.
The unicode set dedicated to braille signs is from 0x2800 to 0x28ff.
Arial Unicode ms should perform the right symbols.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Hello,
I tried my previous code snippet at home on an XP machine, and it failed to display Braille Characters, while working at Windows 7 and Windows 8 (wxPython 2.8.12.1)
I did the following to make it work (partially):
Downloaded a free Braille font:
http://yudit.org/download/fonts/UBraille/UBraille.ttf
Installed it.
Changed facename in my example script to “Braille” and (IMPORTANT) removed style flag wx.TE_RICH2 which was a show stopper for me on Win7
(see modified pastebin example
http://pastebin.com/DXZZV0D3
)
result see attached PNG (Braille working for TextCtrl, but no characters)
If you want a result like on Windows 7, you need a font like Segoe UI Symbol which contains alphanumeric and symbols, uncomment line 85 to set this font specifically for the StaticText. As you see, no fiddeling with Encoding necessary.
For code snippet:
Changed facename in my example script to “Braille” and (IMPORTANT) removed style flag wx.TE_RICH2 which was a show stopper for me on Win7
sorry, it should read as “… show stopper … on WinXP”
···
On Friday, November 29, 2013 8:59:38 AM UTC+1, nepix32 wrote:
the situation does not change.
If I declare wx.FONTENCODING_UNICODE, pyth
Il 29/11/2013 7.25, Tim Roberts ha scron asks me to choose a new font.
THe font Braille I use has the right signs for chars unicode I need.
It works fine in word for Windows and in the chars Map application.
Gianlucaitto:
···
On Nov 28, 2013, at 1:00 AM, Gianluca Casalino <gilucasa@gmail.com> wrote:
When I need to show the font braille I use this code:
def loadFile(self, file):
result=tasks.loadFile(file)
font=wx.Font(12,wx.MODERN,wx.NORMAL,wx.FONTWEIGHT_NORMAL,
False, face="currer new", encoding=wx.FONTENCODING_ISO8859_1)
if globalVars.fileShowed == globalVars.FILE_EXT['FILE_PRINT'][1]:
# wx.MessageBox("bra file")
font=wx.Font(24,wx.FONTFAMILY_DEFAULT,wx.NORMAL,wx.FONTWEIGHT_NORMAL,False,
face="Braille", encoding= wx.FONTENCODING_DEFAULT)
self.panel.editor.SetFont(font)if I use wx.FONTENCODING_UTF8 an error occurs.
The unicode set dedicated to braille signs is from 0x2800 to 0x28ff.
Arial Unicode ms should perform the right symbols.OK, but you are not asking for Arial Unicode here. You are asking for a font called �Braille� (or �currier new� � did you actually mean �Courier New�?).
For Arial Unicode, I don�t think you want FONTENCODING_UTF8. I think you want FONTENCODING_UNICODE.
the problem is that I can not use richedit.
Now using a Normal textEdit all works fine.
Another problem is that NVDA *the screen reader I sue( does not report font information and formatting information as I have to use a normal text edit control.
Gianluca
···
Il 29/11/2013 8.59, nepix32 ha scritto:
Hello,
I tried my previous code snippet at home on an XP machine, and it failed to display Braille Characters, while working at Windows 7 and Windows 8 (wxPython 2.8.12.1)
I did the following to make it work (partially):
Downloaded a free Braille font:
http://yudit.org/download/fonts/UBraille/UBraille.ttf
Installed it.Changed facename in my example script to "Braille" and (IMPORTANT) removed style flag wx.TE_RICH2 which was a show stopper for me on Win7
(see modified pastebin example
wxPython unicode on Windows7 - Pastebin.com
)result see attached PNG (Braille working for TextCtrl, but no characters)
If you want a result like on Windows 7, you need a font like Segoe UI Symbol which contains alphanumeric *and* symbols, uncomment line 85 to set this font specifically for the StaticText. As you see, no fiddeling with Encoding necessary.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Another q
uestion.
Is a way to check if a font is already present or installed and a way to install it from code?
Is it enough to copy ttf file into windows/fonts directory?
Gianluca C.
···
Il 29/11/2013 8.59, nepix32 ha scritto:
Hello,
I tried my previous code snippet at home on an XP machine, and it failed to display Braille Characters, while working at Windows 7 and Windows 8 (wxPython 2.8.12.1)
I did the following to make it work (partially):
Downloaded a free Braille font:
http://yudit.org/download/fonts/UBraille/UBraille.ttf
Installed it.Changed facename in my example script to "Braille" and (IMPORTANT) removed style flag wx.TE_RICH2 which was a show stopper for me on Win7
(see modified pastebin example
wxPython unicode on Windows7 - Pastebin.com
)result see attached PNG (Braille working for TextCtrl, but no characters)
If you want a result like on Windows 7, you need a font like Segoe UI Symbol which contains alphanumeric *and* symbols, uncomment line 85 to set this font specifically for the StaticText. As you see, no fiddeling with Encoding necessary.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.