How to display these characters?

Just starting out? Need help? Post your questions and find answers here.
Caffeine
New User
New User
Posts: 6
Joined: Sat Aug 07, 2010 12:49 am

How to display these characters?

Post by Caffeine »

Hello, I'm trying to display the characters that can be seen on the website below within a string gadget.

http://www.alanwood.net/unicode/runic.html

Now, I've tried using Chr(5792) etc but nothing is showing up.

I've not coded for years, so forgive my stupidity on this. Can it be done? I know the actual string gadget is capable of displaying the characters because I can copy and paste them into it, I just can't write them in from my code.

I'm on Windows 7 by the way (Pure basic 4.*)

Any help would be greatly appreciated on this, thanks.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: How to display these characters?

Post by IdeasVacuum »

Hello Caffeine

Firstly, ensure you have fonts that support the specific Unicode characters you wish to use.

http://www.purebasic.fr/english/viewtop ... 13&t=42552

http://www.xs4all.nl/~bluez/purebasic/p ... #2_unicode
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Caffeine
New User
New User
Posts: 6
Joined: Sat Aug 07, 2010 12:49 am

Re: How to display these characters?

Post by Caffeine »

Thanks for the quick reply. So if the user doesn't have a font capable of displaying these characters, they simply won't show up?

My intention is to have some words written in those runic characters (this would be within a String Gadget) that can then be copied to the clipboard to be pasted elsewhere, e.g a text editor.

I was hoping it would have been a simple solution, but I'm now starting to think that isn't going to be the case :roll:
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: How to display these characters?

Post by IdeasVacuum »

Without the font, the string will look something like this: ????????

If a User is to copy and paste into another app, that app must of course be designed to support Unicode too.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Caffeine
New User
New User
Posts: 6
Joined: Sat Aug 07, 2010 12:49 am

Re: How to display these characters?

Post by Caffeine »

Hi and thanks again for the input. Ok having slept on it I have now gone back to the very basics.

I have installed a font that uses the runic character set. I have set up a window with a String Gadget that uses the installed font. Now if I copy this character ᚠ from the site in the link in the first post, and paste it into my string gadget, it displays. So I know all that works. So it has to be something to do with the way I am trying to generate the character from within my code?

Even if I try SetClipboardText (Chr(5792)) it simply displays a "space" with no character when I paste. Or if I set my gadget text like the following, it displays a space rather than the character.

Global Runetxt$ = Chr(5792)

SetGadgetText(#string_1, Runetxt$)

Any further ideas on this? am I on the right track?

Thanks again for all your help.
freak
PureBasic Team
PureBasic Team
Posts: 5961
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: How to display these characters?

Post by freak »

> Global Runetxt$ = Chr(5792)

If you select "File -> File format -> Encoding: Utf8", this should work.

This is a limitation of the compiler. It can only handle literal unicode characters if the file is UTF8. The expression "Chr(<fixed number>)" is treated as a literal character too, this is why it is affected as well.
quidquid Latine dictum sit altum videtur
Caffeine
New User
New User
Posts: 6
Joined: Sat Aug 07, 2010 12:49 am

Re: How to display these characters?

Post by Caffeine »

Thank you so much, it works ᚠ

You're a star, thanks! :D
Caffeine
New User
New User
Posts: 6
Joined: Sat Aug 07, 2010 12:49 am

Re: How to display these characters?

Post by Caffeine »

One last question. Will I need "Create unicode executable" checked when I create the exe?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: How to display these characters?

Post by Trond »

Yes.
Post Reply