Click here to Skip to main content
15,883,711 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all,
I am developing a C# application which must the menustrips,toolstrips and other labels display text with symbols such as ℇ,ɛ,ɔ, . When I set the controls above to font which support these characters and compile a release version for friends, they claim the special characters get shown as boxes. I want to know if there is to do this nicely without the boxes. I even tried using custom fonts from .ttf files but still can't get it. Please any help is welcomed.
Posted
Updated 15-Jun-11 3:00am
v2

My first thought is that your friends do not have the font file that you used. When that happens, the OS makes a best guess at a replacement font, which might not have the characters you are using. In that case, the missing characters are rendered as small place holders, showing that there is something there that the system does not know how to draw.

The easiest solution would be to make sure you use a common font with the characters you need. The Arial font on my Windows machine has the characters you want, and should be on most, if not all, of your users' machines as well.

The second solution would be to add your font file to the installation project, and have it installed with your app. I have no idea how to go about doing that, but I can't imagine that it would be too difficult.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 15-Jun-11 17:00pm    
Reasonable, my 5. "Arial Unicode MS" covers the most of code points.
--SA
charles henington 15-Jun-11 20:16pm    
my 5 see my post below on simple way to add font
Sounds like a localisation issue. Have a read of this CP Article.NET - Localization[^]
 
Share this answer
 
Easy way to add font would be
C#
PrivateFontCollection pfc = new PrivateFontCollection();
            pfc.AddFontFile("path to font");
            label1.Font = new Font(pfc.Families[0], 16, FontStyle.Regular);


the pfc.Families[0] is because there is only one font added to the collection. the Family would be the font[index] say there were more font files just add those to the collection then choose the font to use by the index
 
Share this answer
 
v3
Hi,

I have noticed that the fonts 'Cambria Math' and 'MS Mincho' include symbols you have mentioned here, I used these fonts on menustrip, toolstripmenuitems & contextmenustripitems, they are appearing as intended. Are you sure you are using the correct fonts for displaying these characters?

Regards,
Imran Nazir
 
Share this answer
 
Comments
charles henington 15-Jun-11 20:27pm    
he mentioned already that he was using the correct font and that it shows up but friends cant view it as intended. So in a nuttshell he is using a Font that is installed on his system but not on there system see my post above how to include fonts not installed on their system to get the results wanted :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900