Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 09, 2019 11:41 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 7:23 am 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
I have a menu of symbols and most work fine, but the eighth note symbol (♪) and the degree symbol (〫) show up as square boxes when I compile my app for Windows. Is there some special way of coding this to get it to show up right? I'm testing the app on XP.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 7:31 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
probably not as I do not believe you can change the text encoding of the menu text.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 8:16 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
probably yes - but you need to use different symbols for MacOS and Windows.

For Mac and Win only the first 128 symbols have the same ascii number - the symbols from 129 to 255 are different, and so the degree sign has a different number for each. On Mac it is Asc(161), on Win it is Asc(248)

So make a dynamic constant, and set it differently for Mac and Windows.

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 8:17 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
P.S. Have a look at http://www.theasciicode.com.ar/ascii-table-codes/ascii-codes-248.html

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 8:24 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
Actually, I just added the degree symbol to a Menu and tried it on my Mac, and compiled for both Mac & WinXP - tried it on a MBP under MacOS 10.6.8 and a PC with WinXP -> shows up fine on both

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 8:55 am 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
Yes, I was able to get the degree symbol to show up by retyping it (I must have pasted it in from the symbol list I was using). Hopefully if I can figure out how to type the eighth note on my mac that'll work too.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 9:42 am 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
apparently there's no way to type an eighth note on a mac that i could find. adding it from the character viewer doesn't help either. I still end up with a box in Windows. works fine on a mac, though. kind of weird that if i select that symbol from my menu it will place a box symbol in the listbox, but if i select that box, it turns back into an eighth note. unfortunately it does not output as an eighth note. i even tried copying it to a text doc on Windows and transferring it over to the Mac to paste into my RS project. didn't help. i may have to drop that symbol from my list for now till I can find a solution. thanks for the help.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 1:06 pm 
Offline

Joined: Fri Dec 01, 2006 3:09 pm
Posts: 650
Location: Tennessee, USA
I find it helpful to create a string property to hold unusual characters and set them using their Unicode value such as:

Dim eighthNote As String
eighthNote = Encodings.UTF8.Chr(&h266a)

The Unicode value can be gotten from the Character Viewer on the Mac by selecting the character in the character viewer and holding the cursor over the character until a little text popup appears showing the Unicode value pops up. Knowing that you can use that Unicode value as shown above.

Now eighthNote is sure to hold the proper character. But, that won't necessarily fix your problem. You are encountering one of the differences between OS X and Windows. On OS X if a character does not exist within the font being used the operating system will automatically substitute a similar font that does contain the character when it presents that character. I do not believe any such automatic substitution happens in WIndows. So on Windows you have to be sure that you are using a font for the control, or whatever, that contains the character you wish to display.


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 1:53 pm 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
So whether or not the symbol shows up depends on what the user has set as their default OS font?


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 3:51 pm 
Offline

Joined: Mon Aug 14, 2006 9:33 pm
Posts: 1774
IMO - very few fonts are going to contain a glyph for an eighth note. Create a small graphic of your eighth note and use that instead.

_________________
Roger Clary
Class One Software
Educational Software for Lifelong Learning
http://www.classonesoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: degree and eighth note symbols in menu
PostPosted: Fri Aug 05, 2011 9:18 pm 
Offline

Joined: Fri Dec 09, 2005 6:25 pm
Posts: 357
I created an icon for the eighth note symbol. This works, but it's like a character space to the left of the rest of the symbols in the menu, which I guess can't be helped. At least it's there now. I also switched the listbox to use Arial as the font, so I'm no longer getting a box in the listbox instead of the note symbol. Thanks for the help!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group