discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create variables of type unichr in GS?


From: Alexander Malmberg
Subject: Re: How to create variables of type unichr in GS?
Date: Wed, 28 May 2003 23:33:32 +0200

Christopher Culver wrote:
> 
> I'm working on a Unicode character map for GNUstep now, but
> am a bit unsure of how to display Unicode characters. The character
> map should
> look something like gucharmap (gucharmap.sourceforge.net), with each
> cell
> showing a single Unicode character. However, I don't know how to use
> the
> GNUstep data type 'unichar'. Is there a way to assign a character to
> it
> through a hex value? For example, in Python, I would create a
> character
> containing "GREEK SMALL LETTER PI" like this:
> 
> unicode_character = unichr(0x3C0)
> 
> Is there a similar function in GNUstep?

unichar is just a typedef for unsigned short, so "unichar ch; ch=0x3c0;"
would work.

> And once I have a unichr variable, can I display it directly on the
> screen with the usual GUI functions?

If by usual you mean creating an NSString/NSAttributedString and using
NSStringDrawing methods, or using a text view, then yes. Exactly which
characters can be displayed depends on the font and backend, though.
back-art should be able to display any character in the bmp (ie.
anything you can fit in an unsigned short) that a font has a glyph for.

> Of course, if I look like I'm entirely on the wrong track, please
> correct me.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]