Discussion:
(unknown)
diliup gabadamudalige
2014-09-21 18:19:38 UTC
Permalink
hi!

ANybody has used unicode with pygame? I need help displaying my native text
using unicode.
--
Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
diliup gabadamudalige
2014-09-21 19:36:36 UTC
Permalink
# -*- coding: utf-8 -*-
import pygame, sys


pygame.font.init()

screen = pygame.display.set_mode((640,480))

unistring = u"හගෝ ශානික "

fnt = pygame.font.Font("kaputaunicode.ttf",40)

while True:
screen.blit(fnt.render(unistring,True,(255,255,255)),(0,0))

pygame.display.flip()
for key in pygame.event.get():
if key.type == pygame.QUIT:
pygame.quit()
sys.exit()

this code works but it prints the the second character after the fourth.
Any ideas why it's doing that?
Post by diliup gabadamudalige
hi!
ANybody has used unicode with pygame? I need help displaying my native
text using unicode.
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
Bartosz Debski
2014-09-22 13:08:52 UTC
Permalink
Hi Diliup,

I'm using unicode without problem in Polish, German and French. Usually
it's the font you are using is the problem. I would check those font you
selected have correct mappings for characters you want to use.

Try to load this font into your system and check in eg. OpenOffice or Gimp
does programs render those characters. If they don't then 100% your font
has not those characters mapped.

Cheers
Bart
Post by diliup gabadamudalige
# -*- coding: utf-8 -*-
import pygame, sys
pygame.font.init()
screen = pygame.display.set_mode((640,480))
unistring = u"හගෝ ශානික "
fnt = pygame.font.Font("kaputaunicode.ttf",40)
screen.blit(fnt.render(unistring,True,(255,255,255)),(0,0))
pygame.display.flip()
pygame.quit()
sys.exit()
this code works but it prints the the second character after the fourth.
Any ideas why it's doing that?
Post by diliup gabadamudalige
hi!
ANybody has used unicode with pygame? I need help displaying my native
text using unicode.
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you
are not the intended recipient or have received it in error, please delete
it and all copies from your system and notify the sender immediately by
return e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
diliup gabadamudalige
2014-09-22 13:36:10 UTC
Permalink
Dear Bart,

Thank you for your response. I realized that the problem is actually in the
font rendering in pygame cause of the way our language uses its symbols. I
decided to convert all unicode into standard font mapping and it has worked
very well.
Post by Bartosz Debski
Hi Diliup,
I'm using unicode without problem in Polish, German and French. Usually
it's the font you are using is the problem. I would check those font you
selected have correct mappings for characters you want to use.
Try to load this font into your system and check in eg. OpenOffice or Gimp
does programs render those characters. If they don't then 100% your font
has not those characters mapped.
Cheers
Bart
Post by diliup gabadamudalige
# -*- coding: utf-8 -*-
import pygame, sys
pygame.font.init()
screen = pygame.display.set_mode((640,480))
unistring = u"හගෝ ශානික "
fnt = pygame.font.Font("kaputaunicode.ttf",40)
screen.blit(fnt.render(unistring,True,(255,255,255)),(0,0))
pygame.display.flip()
pygame.quit()
sys.exit()
this code works but it prints the the second character after the fourth.
Any ideas why it's doing that?
On Sun, Sep 21, 2014 at 11:49 PM, diliup gabadamudalige <
Post by diliup gabadamudalige
hi!
ANybody has used unicode with pygame? I need help displaying my native
text using unicode.
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you
are not the intended recipient or have received it in error, please delete
it and all copies from your system and notify the sender immediately by
return e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you
are not the intended recipient or have received it in error, please delete
it and all copies from your system and notify the sender immediately by
return e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
--
Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**********************************************************************************************
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**********************************************************************************************
Loading...