Working with graphics : wingdings on labels possible?

To add comments, please log in or register
Tusher Ahmed
204
Tusher Ahmed  

So far i know icons/wingdings require  price/time values to be plotted. 

Is there any trick to plot icons as a label on charts? (at a fixed x/y coordinate offsets )

kypa
1038
kypa  

Wingdings don't show outside Windows most of the time and they are generally retarded. Try Unicode or ASCII symbols.

Tusher Ahmed
204
Tusher Ahmed  
kypa:

Wingdings don't show outside Windows most of the time and they are generally retarded. Try Unicode or ASCII symbols.


Would you please show a code example using unicode? (i want to make sure I use Unicode, the rightway).

Plus, how would you change icon's size , in that method?

Fernando Carreiro
4800
Fernando Carreiro  
Tusher Ahmed: Would you please show a code example using unicode? (i want to make sure I use Unicode, the rightway).

Here are some examples of using Unicode:

//---- Set Copyright String
   string strCopyright = "Copyright \x00A9 2018, Fernando M. I. Carreiro, All rights reserved";

//---- Get Account Currency
   string strCurrency = AccountCurrency();
   if( strCurrency == "USD" ) strCurrency = "\x0024"; // $
   if( strCurrency == "EUR" ) strCurrency = "\x20AC"; // €
   if( strCurrency == "GBP" ) strCurrency = "\x00A3"; // £
   if( strCurrency == "JPY" ) strCurrency = "\x00A5"; // ¥
Tusher Ahmed
204
Tusher Ahmed  
Fernando Carreiro:

Here are some examples of using Unicode:

Thanks Fernando.

Would you confirm that it will work on all windows/Mac machines? Will there be any conflict with code-page & other local settings?

kypa
1038
kypa  

Unicode icon size would be just font size for label/text/button/canvas/whatever. This way it should also adjust to DPI by itself.

Fernando, try the switch operator a.k.a. One If To Rule Them All. It will change your life.

Fernando Carreiro
4800
Fernando Carreiro  
kypa: Fernando, try the switch operator a.k.a. One If To Rule Them All. It will change your life.

I always use "switch" in my code. However, "switch" does not work on strings, only on expressions of integer type!

kypa
1038
kypa  
I found out switch operator exists a few days ago. Still overexcited of the discovery, didn't even think whether it would work on strings. Thank you for knowledge.
Tusher Ahmed
204
Tusher Ahmed  

Just noticed : not all unicodes work.

And  failure ends up with a question ( '"?'" ) mark .

Ex. try \x2794

Fernando Carreiro
4800
Fernando Carreiro  
Tusher Ahmed: Just noticed : not all unicodes work. And  failure ends up with a question ( '"?'" ) mark. Ex. try \x2794

Which font are you using? It may not support all the characters. Verify that the font actually supports that character by looking at them in the Character Map application.

For example, the Arial font does not support character U+2794, so try using another arrow symbol that is supported by that font (eg. U+2192 "→", U+25BA "►").

Tusher Ahmed
204
Tusher Ahmed  
Fernando Carreiro:
Which font are you using? It may not support all the characters. Verify that the font actually supports that character by looking at them in the Character Map application.

For example : Using Arial & \x2191  doesn't result in the up-arrow. Its fails with a ? mark.

\x2192 doesn't work either.


Suppose this was the use-case: Where I  clearly defined the font to be used

ObjectSetText( "objname","\x2192",30,"Arial",clrLime); 
   


   

12
To add comments, please log in or register