[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] textboxes and buttons (solved)
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] textboxes and buttons (solved)
- From: Matthieu TC <matthieutc@xxxxxxxxx>
- Date: Thu, 22 Feb 2007 08:03:04 -0800 (PST)
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 22 Feb 2007 11:03:24 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=G76dCcOl5wHPI+NH9ebSwfycgJ+aLlZAczQUhRAAm5x7rbghmaC8DcE1V2FWMwf0l26afDyLkf3Cy1zU7vZmlV3e2Sznfens47+4abbbLo06mfQdlLc61Y6jKnIt9yF+3rtsBJez/RR/5/a+ZsK41nnZY60AMtctIN36kKrj1/A=;
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
> > > >I suprisingly solved the problem. It was one of encoding.
> > > >I replaced:
> > > >
> > > > self._text = self._text[:self._caret] + event.unicode +
> > > >self._text[self._caret:]
> > > >
> > > >with
> > > >
> > > > self._text = self._text[:self._caret] + str(event.unicode) +
> > > >self._text[self._caret:]
> > > >
> > > >in ocempgui's Editable.py, and everything seems dandy once
> > > >everything is cx_freezed.
> > > [...]
> > >
> > > This will break the box with encodings different from US-ASCII like e.g.
> > > ISO-8859-15 (latin-1 with EURO symbol) and various others. Do you
> > > have a cx_freze example I can easily use to track that issue down, so
> > > that I can fix that error?
> >
> > I just tried cx_freze with a small hello world example shipping with
> > OcempGUI. Freezing is done just fine (no errors), but the usual
> > 'freesansbold.ttf' exception is coming up on running the built
> > binary. No matter in which ways I added it to the zip, the built binary
> > denies to work.
> >
> > Long story short: build process is fine on my side, so I my first guess
> > is that the encoding error is raised by your code in some way.
> >
> > Regards
> > Marcus
>
> > Matthieu TC <matthieutc@xxxxxxxxx>:
> >
> > >I suprisingly solved the problem. It was one of encoding.
> > >I replaced:
> > >
> > > self._text = self._text[:self._caret] + event.unicode +
> > >self._text[self._caret:]
> > >
> > >with
> > >
> > > self._text = self._text[:self._caret] + str(event.unicode) +
> > >self._text[self._caret:]
> > >
> > >in ocempgui's Editable.py, and everything seems dandy once
> > >everything is cx_freezed.
> > [...]
> >
> > This will break the box with encodings different from US-ASCII like e.g.
> > ISO-8859-15 (latin-1 with EURO symbol) and various others. Do you
> > have a cx_freze example I can easily use to track that issue down, so
> > that I can fix that error?
>
> I just tried cx_freze with a small hello world example shipping with
> OcempGUI. Freezing is done just fine (no errors), but the usual
> 'freesansbold.ttf' exception is coming up on running the built
> binary. No matter in which ways I added it to the zip, the built binary
> denies to work.
>
> Long story short: build process is fine on my side, so I my first guess
> is that the encoding error is raised by your code in some way.
>
> Regards
> Marcus
I certainly don't touch or change the encoding voluntarily. Although my linux installation has always been tricky about encodings, so it may be a platform problem (e.g. my filenames cannot contain characters with accents).
I tried to input letters with accents and it did throw a "UnicodeEncodeError", which is unfortunate but not a showstopper.
As for the freesansbold.ttf, I solved it by using custom styles, which made the app look only for the fonts I wanted.
-matt