Ruby/Tk + UTF-8

I have an application (a program to quiz me in Greek) that currently
outputs to stdout and reads from stdin. It prints its questions using
UTF-8, which comes out nicely on a properly configured xterm.

I would like to port this program to Windows (specifically, 98). I
wrote a new interface using FOX, only to discover that FOX has no
Unicode support. Having read that Tk 8.1 and later has UTF-8 support, I
thought I would give Tk a try.

I’ve got a TkText widget that I print my UTF-8 text to. The TkText
widget is set up to use the Athena font
(http://greekbible.com/fonts/athena.zip). However, the font comes out
very ugly, and the Greek text shows up as gibberish.

I’ve tried using Tk.fromUTF8() to use a different encoding; the best I
could come up with was with the Symbol font, and while this gives me all
the greek letters, it’s missing most of the accent marks that I need.

I tried Ruby 1.6.6 and 1.7.2 from rubycentral.com.

Any ideas?

Paul

I believe the font is the problem. I looked at it and it doesn’t
appear to be Greek. Try SPIonic, a true type font. It can be found
here: ftp://ftp.sbl-site2.org/fonts/windows/SPIONIC_.TTF

-M.

···

On Thu, 26 Sep 2002 14:15:29 GMT, Paul Brannan pbrannan@atdesk.com wrote:

I’ve got a TkText widget that I print my UTF-8 text to. The TkText
widget is set up to use the Athena font
(Greek Bible). However, the font comes out
very ugly, and the Greek text shows up as gibberish.


To e-mail: use the initials of my name and add “at felinism dot com”.

It’s a Unicode font, and has the characters I need, though they aren’t
in the first 256. I use it to read the text at greekbible.com.

I will try the font you suggest. I already tried another cp437 font
(and used fromUTF8 to convert the UTF8 strings to CP437), but it didn’t
help.

Paul

···

On Fri, Sep 27, 2002 at 10:42:23PM +0900, Michael Vondung wrote:

On Thu, 26 Sep 2002 14:15:29 GMT, Paul Brannan pbrannan@atdesk.com > wrote:

I’ve got a TkText widget that I print my UTF-8 text to. The TkText
widget is set up to use the Athena font
(Greek Bible). However, the font comes out
very ugly, and the Greek text shows up as gibberish.

I believe the font is the problem. I looked at it and it doesn’t
appear to be Greek. Try SPIonic, a true type font. It can be found
here: ftp://ftp.sbl-site2.org/fonts/windows/SPIONIC_.TTF

I realised this after I had a cup of coffee (actually, while I had it)
and was going to post a “never mind!”, but you already responded. :slight_smile:

-M.

···

On Fri, 27 Sep 2002 14:16:47 GMT, Paul Brannan pbrannan@atdesk.com wrote:

It’s a Unicode font, and has the characters I need, though they aren’t
in the first 256. I use it to read the text at greekbible.com.


To e-mail: use the initials of my name and add “at felinism dot com”.