Playing card symbols
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Playing card symbols
I've been using Symbol,Unicode font for playing card symbols while developing on a Mac, and when this is viewed on a Windows machine, the symbols don't appear. What should be used instead so that they appear in either platform?
Dave
OS 10.6.8
LC 4.5.3
Dave
OS 10.6.8
LC 4.5.3
Re: Playing card symbols
I should add that I'd like the symbols to appear both as button labels and in fields. The button labels could be dealt with as icons from image files, but if there's a font substitution which would work, that would be simpler.
Dave
Dave
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Wed May 29, 2013 1:54 am
- Location: Sydney, Australia
Re: Playing card symbols
Does LiveCode 4.5.3 have the htmlText property?
In HTML there are entity references that you can use to display the playing card symbols. These are:
You can display these by setting the htmlText property of the control where you want the symbol to appear - like this:
This will put the 'clubs' symbol inside field "testField". There is no need to set the field's font, either: LiveCode knows that it needs to display the 'clubs' symbol, and it will pick an appropriate font from the user's system that can display it.
I hope this helps!
In HTML there are entity references that you can use to display the playing card symbols. These are:
Code: Select all
- Hearts Symbol: ♥
- Diamonds Symbol: ♦
- Spades Symbol: ♠
- Clubs Symbol: ♣
Code: Select all
set the htmlText of field "testField" to "♣"
I hope this helps!
Re: Playing card symbols
Thank you for the reply. I will try that out.
Dave
Dave
Re: Playing card symbols
I tried the suggestion, but it did not work for me. I just get the expression in the field, eg. ♣, etc.
Thanks, anyhow.
Dave
Thanks, anyhow.
Dave
Re: Playing card symbols
Further to this, I found that working backwards with the symbols in fields using the Symbol font, the htmlText of the fields were: <p>™</p><p>©</p><p>®</p><p>ß</p>. These are, in order, spades, hearts, diamonds and clubs. If the font is not specified in the field, the proper symbol does not appear. I can get the symbols to appear by using numtochar with one of 167 to 170, and this works on a friend's PC, also. But when he opened the little test app the first time, the symbols which were already in the fields appeared as squares. I'm wondering if some code in an openstack handler could preset the font for the fields where needed.
Dave
Dave
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Wed May 29, 2013 1:54 am
- Location: Sydney, Australia
Re: Playing card symbols
Sorry to hear that the html entities are not working for you!
Incidentally: © is the html entity for the copyright symbol (©). Also, ® is the html entity for the registered trademark symbol (®), and ß is the entity for the german "ß".
I wonder if this is a problem with your (older) version of LiveCode. Are you not able to use version 6 in this project? - it works with that. At my end, with version 6.0.1 of LiveCode:
1) create a new mainstack
2) add a new field, and name it "output"
3) add a new button, with the following script:
4) click the button
The field displays: ♠ ♣ ♥ ♦
Incidentally: © is the html entity for the copyright symbol (©). Also, ® is the html entity for the registered trademark symbol (®), and ß is the entity for the german "ß".
I wonder if this is a problem with your (older) version of LiveCode. Are you not able to use version 6 in this project? - it works with that. At my end, with version 6.0.1 of LiveCode:
1) create a new mainstack
2) add a new field, and name it "output"
3) add a new button, with the following script:
Code: Select all
on mouseUp
set the htmlText of field "output" to "♠ ♣ ♥ ♦"
end mouseUp
The field displays: ♠ ♣ ♥ ♦
Re: Playing card symbols
Perhaps there is a difference with this older version. However, as a hobbyist pensioner, I'm not about to spend the money to upgrade. It does what I want at this point (usually).
With your code and no font specified for the field, I just get the same thing over: ♠ ♥ etc. If I specify the font to be Symbol, I get the same thing in Greek letters.
However, if I use: set the htmlText of field "output" to "© ® ß ™"
and specify the font as Symbol, then I get the suit symbols.
Using the ASCII codes 167 to 170 I think will work, but I haven't heard back from my tester yet. I need a Windows machine here, too.
Thanks, anyhow.
Dave
With your code and no font specified for the field, I just get the same thing over: ♠ ♥ etc. If I specify the font to be Symbol, I get the same thing in Greek letters.
However, if I use: set the htmlText of field "output" to "© ® ß ™"
and specify the font as Symbol, then I get the suit symbols.
Using the ASCII codes 167 to 170 I think will work, but I haven't heard back from my tester yet. I need a Windows machine here, too.
Thanks, anyhow.
Dave
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Wed May 29, 2013 1:54 am
- Location: Sydney, Australia
Re: Playing card symbols
As you probably already know, the latest version of LiveCode has been released as Open Source. That means that you can download it, and use it, for free. You can even develop commercial software with it, if you want - provided your software is not closed-source.Perhaps there is a difference with this older version. However, as a hobbyist pensioner, I'm not about to spend the money to upgrade. It does what I want at this point (usually).
You would only need to spend money if you needed to purchase a commercial license for LiveCode. The commercial license would enable you to sell your apps on the Apple App Store, and release your software commercially as closed-source.
But for every other use - specially for "hobbyist pensioners" - the free, Community edition is the way to go! No need to spend any money!